-
Notifications
You must be signed in to change notification settings - Fork 33
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
Readiness probe #365
Readiness probe #365
Conversation
Implements health and readiness probe endpoints for the controllers, reporting particularly the aggregated state of the AuthConfigs. New endpoints: - `/healthy`: Health probe (ping) - `/readyz`: Aggregated readiness probe (only AuthConfig reconciler currently reporting) - `/readyz/authconfigs`: Aggregated status of the AuthConfigs The default binding network address is `:8081`. It can be changed using the newly introduced flag (command-line arg) `--health-probe-addr`. The endpoints return either `200` ("ok") or `500` when 1+ probes fail. The query string parameters `verbose=true` and `exclude=authconfigs` are supported respectively to provide more verbose responses and exclude a particular probe ("authconfigs" in the example provided). Closes #355
It turns out this approach can be improved to solve the issue for the readiness probe. An AuthConfig being not ready (due to a host collision, for example) has nothing to do with the AuthConfig Reconciler (or even less with the Authorino instance!) not being ready. Exposing this endpoint through controller-runtime's readiness check mixes those two things together and introduces a risk of occasionally shutting the entire Authorino instance off because of a unexceptional situation of having one or more AuthConfigs not ready. This is because one could think that the |
Te check the aggregated readiness status of all AuthConfigs watched by the reconciler, any of the following endpoints can be used: - `/readyz?include=authconfigs` - all readiness checks + authconfigs - `/readyz/authconfigs` - only the authconfigs readiness check
No longer true. I've changed so the One who wants to include the readiness state of the AuthConfigs in the overall aggregated readiness probe check can call Alternatively, only the aggregated status of the AuthConfig CRs watched by that particular Authorino instance can be checked by calling |
@@ -30,3 +30,12 @@ func SubtractSlice(sl1, sl2 []string) []string { | |||
} | |||
return diff | |||
} | |||
|
|||
func SliceContains[T comparable](s []T, val T) bool { |
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.
now I have to learn Golang generics 🥳
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.
Looks good to me! The only issue I see is the one reported by Eguz regarding returning the map of statuses
Implements health and readiness probe endpoints for the controllers. ATM, the endpoints are trivial readiness and health check endpoints the by default always return "ok".
The aggregated status of all AuthConfigs watched by the controller is an opt-in check.
New endpoints introduced:
/healthy
: Health probe (ping)/readyz
: Aggregated readiness probe (by default, none)/readyz/authconfigs
: Aggregated status of all AuthConfigs watched by the controllerIn general, all endpoints return either
200
("ok") or500
(when 1+ probes fail).The default binding network address is
:8081
. It can be changed using a newly introduced flag (command-line arg)--health-probe-addr
.The following query string parameters are supported:
verbose=any
: more verbose response messages;include=authconfigs
: to include the aggregated status of AuthConfigs in the response;exclude=(check name)
: to exclude a particular probe - has no effect when passed on requests to/readyz/authconfigs
.Closes #355
Verification steps
$ make local-setup FF=1 $ kubectl port-forward deployment/authorino 8081:8081 &
$ curl "http://localhost:8081/readyz?verbose=true" [+]authconfigs ok healthz check passed
$ curl "http://localhost:8081/readyz?include=authconfigs" [-]authconfigs failed: reason withheld healthz check failed