Skip to content

Create liveliness endpoint#1506

Closed
asalan316 wants to merge 37 commits intomainfrom
create-liveliness-endpoint
Closed

Create liveliness endpoint#1506
asalan316 wants to merge 37 commits intomainfrom
create-liveliness-endpoint

Conversation

@asalan316
Copy link
Copy Markdown
Contributor

@asalan316 asalan316 commented Mar 2, 2023

This change introduces new /health/liveness endpoint, allowing users to check the health of the individual services
The response

{"overall_status":"UP","checks":[]}

Also, the following existing endpoints are now moved to the new paths

Golang Microservices

Exisiting Routes New Health Routes
/ /health/prometheus
/debug/pprof /health/debug/pprof
/debug/pprof /health/debug/pprof
- /health/liveness (new)
- /health (respond to /health/liveness )

Scheduler Microservice

Exisiting Routes New Health Routes
/health /health/prometheus
/prometheus /health/prometheus
- /health/liveness (new)
- /health (respond to /health/liveness )

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

@asalan316 asalan316 force-pushed the create-liveliness-endpoint branch 2 times, most recently from 04bc7db to 445429d Compare March 8, 2023 15:21
@joergdw joergdw added the 🚧🛠️ WIP📝 Work in progress label Mar 8, 2023
@joergdw joergdw requested a review from a team March 9, 2023 13:42
@joergdw joergdw force-pushed the create-liveliness-endpoint branch from fda104a to 472375b Compare March 13, 2023 09:56
@asalan316 asalan316 force-pushed the create-liveliness-endpoint branch from 478b82a to be9db41 Compare March 13, 2023 16:31
@joergdw joergdw force-pushed the create-liveliness-endpoint branch from be9db41 to 44d0f76 Compare March 14, 2023 09:08
@joergdw joergdw added the allow-acceptance-tests This label needs to be added to enable the acceptance tests to run. label Mar 14, 2023
@joergdw joergdw force-pushed the create-liveliness-endpoint branch 12 times, most recently from d8fabe2 to d484f7b Compare March 14, 2023 14:29
@joergdw joergdw removed the 🚧🛠️ WIP📝 Work in progress label Mar 14, 2023
@joergdw joergdw force-pushed the create-liveliness-endpoint branch 5 times, most recently from de0e65d to 8498b9b Compare March 17, 2023 15:28
@asalan316 asalan316 force-pushed the create-liveliness-endpoint branch 4 times, most recently from 0270ec1 to 2865f60 Compare March 28, 2023 14:58
joergdw and others added 11 commits May 11, 2023 17:20
Changes to get 'make test' running

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

commenting out 3 of 4/5 Collect statements for debugging

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

commenting out 4 of 4/5 Collect statements for debugging

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

adding print statements and commenting out 3 of 4/5 Collect statements for debugging

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

adding more print statements

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

adding more print statements

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

adding more print statements

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

adding more print statements

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

adding more debug print statements

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

Revert "adding more debug print statements"

This reverts commit eefc74f.

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

Revert "adding more print statements"

This reverts commit 958fd00.

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

Revert "adding more print statements"

This reverts commit 0b2d81b.

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

Revert "adding more print statements"

This reverts commit a25e782.

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

Revert "adding more print statements"

This reverts commit d433ce5.

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>

Adding print statements of status collect middleware to stderr

Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>
Co-authored-by: Susanne Salzmann <susanne.salzmann@sap.com>
Update spec/jobs/golangapiserver/apiserver_spec.rb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

revert refactoring

debug-> remove rate limiter atm to identify policy enpoints

Revert "debug-> remove rate limiter atm to identify policy enpoints"

This reverts commit f5e5c57.

add test to verify health configurations

enable default /actuator/health &a /actuator/promethus

use standalone prometheus server for health endpoints

Revert "enable default /actuator/health &a /actuator/promethus"

This reverts commit 86e5523.
…metheus lib)

wip:spring security

wip: block health route to main server (port 8080) via spring security

wip: Block health routes to main server (port 8080) using Request Filter

wip: add basic auth for protected resource using servlet filter

test health server configuration

Adding MultiPortFilter tests

finish MultiPortFilter tests
refactor: Basic and Port Filters

fix java formatting issues
Comment thread style-guide/google-format-ci-v0.1.sh
Comment thread docs/autocaler-scheduler-apisv1.drawio
Comment thread flake.nix
Comment thread spec/jobs/operator/operator_spec.rb
Comment thread src/autoscaler/api/brokerserver/broker_server.go Outdated
Comment thread src/autoscaler/api/brokerserver/broker_server.go Outdated
Comment thread src/autoscaler/api/brokerserver/broker_server.go Outdated
Comment thread src/autoscaler/api/brokerserver/broker_server_test.go Outdated
Comment thread src/autoscaler/api/publicapiserver/public_api_server.go
Comment thread src/autoscaler/healthendpoint/server.go Outdated
Comment thread src/autoscaler/healthendpoint/server.go Outdated
Comment thread src/autoscaler/healthendpoint/server.go Outdated
Comment thread docs/autocaler-scheduler-apisv1.drawio
if (ObjectUtils.isEmpty(unprotectedEndpointsConfig)) { // health endpoints are authorized
isUserAuthenticatedOrSendError(chain, httpRequest, httpResponse);
} else if (!ObjectUtils.isEmpty(unprotectedEndpointsConfig)) {
Map<String, Boolean> validateMap = checkValidEndpoints(unprotectedEndpointsConfig);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I think a config-check should rather go into the config-class itself (see former comments).
  2. The name may be misleading. I rather understand it as a nonExistingEndpoints.
  3. Why do we need a boolean? Isn't pure existence enough? Then a set (as mentioned above) would be more appropriate.

Copy link
Copy Markdown
Contributor

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.

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-acceptance-tests This label needs to be added to enable the acceptance tests to run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants