-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add stub upstream when config is empty in dbless mode #4316
Conversation
b4c4862
to
3c4529f
Compare
3c4529f
to
891e03f
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #4316 +/- ##
=======================================
- Coverage 65.0% 65.0% -0.1%
=======================================
Files 154 154
Lines 17382 17384 +2
=======================================
- Hits 11310 11301 -9
- Misses 5353 5364 +11
Partials 719 719
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll always 🤨 a bit at variable renames without explanations why, but doesn't make any difference functionally. Gateway probably should report ready if it successfully receives an empty config and not require this stub config workaround, but assuming we probably can't get that, so
- When a translated Kong configuration is empty in DB-less mode, the controller | ||
will now send the configuration with a single empty `Upstream`. This is to make | ||
Gateways using `/status/ready` as their health check ready after receiving the | ||
initial configuration (even if it's empty). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind reminding me what's the reason for this? I do #3499 but as I see it now is that this will circumvent the /status/ready
functionality: i.e. instead of waiting for first non-empty config we'll send the stub to make the GW ready which will serve basically nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's to make sure a Gateway always gets ready after getting the first (empty or not) config update from KIC. Effectively, Gateways using /status/ready
will stay not-ready until KIC sends the first config update to them. IMO it's expected to have KIC configure Gateways with an empty config when there's nothing in K8s API to translate and to assume these Gateways will be ready to serve traffic in such case, isn't it?
This will also ensure that a typical scenario we run in tutorials etc. is not broken:
- Deploy KIC + Kong using helm chart.
GET /path
returns 404.
Without this workaround, we'd have no Kong instances ready to serve and respond 404s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What this PR does / why we need it:
When a translated configuration is empty, the controller adds an empty
Upstream
namedkong
to a Kong configuration. It will happen for Gateways in DB-less mode only.Which issue this PR fixes:
Part of #3499.
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR