-
Notifications
You must be signed in to change notification settings - Fork 52
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
Create liveliness endpoint #1506
base: main
Are you sure you want to change the base?
Conversation
04bc7db
to
445429d
Compare
fda104a
to
472375b
Compare
478b82a
to
be9db41
Compare
be9db41
to
44d0f76
Compare
d8fabe2
to
d484f7b
Compare
de0e65d
to
8498b9b
Compare
0270ec1
to
2865f60
Compare
12aec5f
to
7aff4d1
Compare
start health server on defined ports (Port 0 is not allowed)
7aff4d1
to
f09bc70
Compare
…alth/liveness) to avoid breaking changes
fbd69ea
to
f853498
Compare
...uler/src/main/java/org/cloudfoundry/autoscaler/scheduler/conf/HealthServerConfiguration.java
Show resolved
Hide resolved
...uler/src/main/java/org/cloudfoundry/autoscaler/scheduler/conf/HealthServerConfiguration.java
Outdated
Show resolved
Hide resolved
...uler/src/main/java/org/cloudfoundry/autoscaler/scheduler/rest/BasicAuthenticationFilter.java
Show resolved
Hide resolved
...uler/src/main/java/org/cloudfoundry/autoscaler/scheduler/conf/HealthServerConfiguration.java
Outdated
Show resolved
Hide resolved
...uler/src/main/java/org/cloudfoundry/autoscaler/scheduler/rest/BasicAuthenticationFilter.java
Outdated
Show resolved
Hide resolved
...uler/src/main/java/org/cloudfoundry/autoscaler/scheduler/rest/BasicAuthenticationFilter.java
Outdated
Show resolved
Hide resolved
if (ObjectUtils.isEmpty(unprotectedEndpointsConfig)) { // health endpoints are authorized | ||
isUserAuthenticatedOrSendError(chain, httpRequest, httpResponse); | ||
} else if (!ObjectUtils.isEmpty(unprotectedEndpointsConfig)) { | ||
Map<String, Boolean> validateMap = checkValidEndpoints(unprotectedEndpointsConfig); |
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 think a config-check should rather go into the config-class itself (see former comments).
- The name may be misleading. I rather understand it as a
nonExistingEndpoints
. - Why do we need a boolean? Isn't pure existence enough? Then a set (as mentioned above) would be more appropriate.
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.
As an additional note, when I think about what we want to do: It would simplify a lot to have a function with the following signature in the class HealthServerConfiguration
:
public boolean endpointIsUnprotected(<Some type> endpoint) {…
It is then reusable here! And as it will be quite performant, this simplification would then make as well obvious that we do not need the special case treatment in the lines 58-59 of the current implementation.
...uler/src/main/java/org/cloudfoundry/autoscaler/scheduler/rest/BasicAuthenticationFilter.java
Outdated
Show resolved
Hide resolved
src/scheduler/src/main/java/org/cloudfoundry/autoscaler/scheduler/rest/MultiPortFilter.java
Outdated
Show resolved
Hide resolved
src/scheduler/src/test/java/org/cloudfoundry/autoscaler/scheduler/util/HealthUtils.java
Outdated
Show resolved
Hide resolved
…ler/rest/BasicAuthenticationFilter.java Co-authored-by: joergdw <[email protected]>
…ler/conf/HealthServerConfiguration.java Co-authored-by: joergdw <[email protected]>
…ler/conf/HealthServerConfiguration.java Co-authored-by: joergdw <[email protected]>
6a0c834
to
73cf734
Compare
73cf734
to
87416bc
Compare
4180e19
to
145d426
Compare
5c84978
to
e237065
Compare
e237065
to
0a8b9db
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
This change introduces new
/health/liveness endpoint
, allowing users to check the health of the individual servicesThe response
Also, the following existing endpoints are now moved to the new paths
Golang Microservices
Scheduler Microservice
By default, all health routes are protected with basic auth.
However, routes can be configured to be unprotected by using the configuration
autoscaler.apiserver.health.unprotected_endpoints