Skip to content
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

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
75532c3
APPAUTOSCALER-544 : Adapt creation of health-service
joergdw Feb 22, 2023
00a13e4
APPAUTOSCALER-544 : Make BasicAuth deselectable.
joergdw Feb 23, 2023
e444bbc
APPAUTOSCALER-544 : Declare constants for paths;
joergdw Feb 23, 2023
89c1d27
poc- implement liveness endpoint
asalan316 Mar 1, 2023
b6a4f66
Rename health-endpoint and variables;
joergdw Mar 8, 2023
92d47e1
Fix eventgenerator-tests;
joergdw Mar 9, 2023
d4cf916
Fix metricsgateway-test-suite
joergdw Mar 13, 2023
09d6dc5
Sonarcloud should avoid test-files;
joergdw Mar 14, 2023
d52d757
Add health-configuration-parameters for the golangapiserver.
joergdw Mar 15, 2023
55ac5e7
Fix health-config-validation
joergdw Mar 15, 2023
6341057
Fix config for acceptance-tests
joergdw Mar 16, 2023
fa43fcf
Fix health-root-path in test configurations;
joergdw Mar 17, 2023
fdb2517
Fix test-configuration for apiserver
joergdw Mar 20, 2023
8e78959
Remove wrong health-endpoint from api-server.
joergdw Mar 20, 2023
88c62c0
refactoring of API Routes
salzmannsusan Mar 27, 2023
b4ab911
golangapiserver-> exposee health server port via route registrar
asalan316 Mar 28, 2023
ca1f623
golangAPIServer => add Bosh template test
asalan316 Mar 29, 2023
3e35094
scheduler->start a embedded tomcat health server (instead of from pro…
asalan316 Apr 6, 2023
16becb0
scheduler-> MultiPortFilter to differntiate health and main requests
OliverMautschke Apr 19, 2023
d3892e6
metricsforwarder-> Bosh Template Specs
asalan316 May 11, 2023
f9f2b22
metricsgateway-> Bosh Template Specs
asalan316 May 11, 2023
2e0fa57
metricsserver-> Bosh Template Specs
asalan316 May 11, 2023
a7ba83b
operator-> Bosh Template Specs
asalan316 May 11, 2023
d246a4d
scalingengine-> Bosh Template Specs
asalan316 May 11, 2023
b6818eb
Review-> Remove Health routes from broker server & public Api server
asalan316 May 22, 2023
d3a5531
Review-> Scehduler ->add java commons-codec for Base64 operations
asalan316 May 22, 2023
dc2876b
Review-> Docs -> add SVG for the scheduler API Docs
asalan316 May 22, 2023
f09bc70
Review -> Scheduler -> validate health port
asalan316 May 23, 2023
f853498
liveness information should also be available at /health (besides /he…
asalan316 May 24, 2023
9688bf5
Update src/scheduler/src/main/java/org/cloudfoundry/autoscaler/schedu…
asalan316 May 25, 2023
1906dd9
Update src/scheduler/src/main/java/org/cloudfoundry/autoscaler/schedu…
asalan316 May 25, 2023
6c3ffef
Update src/scheduler/src/main/java/org/cloudfoundry/autoscaler/schedu…
asalan316 May 25, 2023
4abcaad
change unprotected type to Set (instead of List)
asalan316 May 25, 2023
87416bc
Refactor BasicAuthenticationFilter
asalan316 May 30, 2023
145d426
change valid endpoints to Enum types
asalan316 May 31, 2023
3aeb2ae
Merge branch 'main' into create-liveliness-endpoint
asalan316 Jun 15, 2023
0a8b9db
add missing java files
asalan316 Jun 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ if has nix
then
unset GOPATH # Required for editors to discover the go-tools in the flake.
use flake
layout python python3
layout ruby
fi
4 changes: 4 additions & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sonar.sources = src/
sonar.exclusions = **/*test.go
sonar.test.exclusions = **/*test.go # This line is needed as well!

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ DEPENDENCIES
standard

BUNDLED WITH
2.1.4
2.4.10
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ MAKEFLAGS = -s
go_modules:= $(shell find . -maxdepth 3 -name "*.mod" -exec dirname {} \; | sed 's|\./src/||' | sort)
all_modules:= $(go_modules) db scheduler
.SHELLFLAGS := -eu -o pipefail -c ${SHELLFLAGS}
MVN_OPTS="-Dmaven.test.skip=true"
MVN_OPTS="-Dmaven.test.skip=true -Dmaven.plugin.validation=VERBOSE"
OS:=$(shell . /etc/lsb-release &>/dev/null && echo $${DISTRIB_ID} || uname )
db_type:=postgres
DB_HOST:=localhost
DBURL := $(shell case "${db_type}" in\
(postgres) printf "postgres://postgres:postgres@${DB_HOST}/autoscaler?sslmode=disable"; ;; \
(mysql) printf "root@tcp(${DB_HOST})/autoscaler?tls=false"; ;; esac)
Expand All @@ -25,6 +24,7 @@ DEST?=build
export BUILDIN_MODE?=false
export DEBUG?=false
export ACCEPTANCE_TESTS_FILE?=${DEST}/app-autoscaler-acceptance-tests-v${VERSION}.tgz
export DB_HOST:=localhost

$(shell mkdir -p target)
$(shell mkdir -p build)
Expand Down Expand Up @@ -123,11 +123,14 @@ test: test-autoscaler test-scheduler test-changelog test-changeloglockcleaner te
test-autoscaler: check-db_type init init-db test-certs
@echo " - using DBURL=${DBURL} OPTS=${OPTS}"
@make -C src/autoscaler test DBURL="${DBURL}" OPTS="${OPTS}"
test-autoscaler-suite: check-db_type init init-db test-certs

# ⚠ The target dependencies "autoscaler" and "scheduler" are needed by the integration tests.
# TODO: Introduce make-target for the .war-file and the needed autoscaler-files instead?
test-autoscaler-suite: check-db_type init init-db test-certs autoscaler scheduler
@echo " - using DBURL=${DBURL} TEST=${TEST} OPTS=${OPTS}"
@make -C src/autoscaler testsuite TEST=${TEST} DBURL="${DBURL}" OPTS="${OPTS}"

test-scheduler: check-db_type init init-db test-certs
@export DB_HOST=${DB_HOST}; \
cd src && mvn test --no-transfer-progress -Dspring.profiles.include=${db_type} && cd ..
test-changelog: init
@make -C src/changelog test
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,17 +350,18 @@ cf delete-service-broker autoscaler

## Monitoring the service

The app-autoscaler provides a number of health endpoints that are available externally that can be used to check the state of each component. Each health endpoint is protected with basic auth (apart from the api server), the usernames are listed in the table below, but the passwords are available in credhub.

Component | Health URL | Username | Password Key |
--------- | -----------| ---------| -------------|
eventgenerator|https://autoscaler-eventgenerator.((system_domain))/health|eventgenerator|/autoscaler_eventgenerator_health_password|
metricsforwarder|https://autoscaler-metricsforwarder.((system_domain))/health|metricsforwarder|/autoscaler_metricsforwarder_health_password|
metricsgateway|https://autoscaler-metricsgateway.((system_domain))/health|metricsgateway|/autoscaler_metricsgateway_health_password|
metricsserver|https://autoscaler-metricsserver.((system_domain))/health|metricsserver|/autoscaler_metricsserver_health_password|
scalingengine|https://autoscaler-scalingengine.((system_domain))/health|scalingengine|/autoscaler_scalingengine_health_password|
operator|https://autoscaler-operator.((system_domain))/health|operator|/autoscaler_operator_health_password|
scheduler|https://autoscaler-scheduler.((system_domain))/health|scheduler|/autoscaler_scheduler_health_password|
The app-autoscaler provides a number of health endpoints that are available externally that can be used to check the state of each component. Each health endpoint is protected with basic auth, the usernames are listed in the table below, but the passwords are available in credhub.

Component | Health URL | Username | Password Key |
--------- |--------------------------------------------------------------------------|------------------|----------------------------------------------|
apiserver | https://autoscaler-apiserver.((system_domain))/health/liveness | apiserver | /autoscaler_api_server_health_password |
eventgenerator| https://autoscaler-eventgenerator.((system_domain))/health/liveness | eventgenerator | /autoscaler_eventgenerator_health_password |
metricsforwarder| https://autoscaler-metricsforwarder.((system_domain))/health/liveness | metricsforwarder | /autoscaler_metricsforwarder_health_password |
metricsgateway| https://autoscaler-metricsgateway.((system_domain))/health/liveness | metricsgateway | /autoscaler_metricsgateway_health_password |
metricsserver| https://autoscaler-metricsserver.((system_domain))/health/liveness | metricsserver | /autoscaler_metricsserver_health_password |
scalingengine| https://autoscaler-scalingengine.((system_domain))/health/liveness | scalingengine | /autoscaler_scalingengine_health_password |
operator| https://autoscaler-operator.((system_domain))/health/liveness | operator | /autoscaler_operator_health_password |
scheduler| https://autoscaler-scheduler.((system_domain))/health/liveness | scheduler | /autoscaler_scheduler_health_password |

These endpoints can be disabled by using the ops file `example/operations/disable-basicauth-on-health-endpoints.yml`

Expand Down
29 changes: 14 additions & 15 deletions ci/autoscaler/scripts/run-acceptance-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,31 @@ fi
pushd "${autoscaler_dir}/src/acceptance" >/dev/null
cat > acceptance_config.json <<EOF
{
"api": "api.${system_domain}",
"admin_user": "admin",
"admin_password": "${cf_admin_password}",
"aggregate_interval": 120,
"api": "api.${system_domain}",
"apps_domain": "${system_domain}",
"skip_ssl_validation": ${skip_ssl_validation},
"use_http": false,
"service_name": "${deployment_name}",
"service_broker": "${deployment_name}",
"use_existing_organization": ${use_existing_organization},
"autoscaler_api": "${deployment_name}.${system_domain}",
"default_timeout": 60,
"existing_organization": "${existing_organization}",
"use_existing_space": ${use_existing_space},
"existing_space": "${existing_space}",
"service_plan": "autoscaler-free-plan",
"aggregate_interval": 120,
"default_timeout": 60,
"health_endpoints_basic_auth_enabled": true,
"name_prefix": "${name_prefix}",

"autoscaler_api": "${deployment_name}.${system_domain}",
"service_offering_enabled": ${service_offering_enabled},

"performance": {
"app_count": ${performance_app_count},
"app_percentage_to_scale": ${performance_app_percentage_to_scale},
"setup_workers": ${performance_setup_workers},
"update_existing_org_quota": ${performance_update_existing_org_quota}
}
},
"service_broker": "${deployment_name}",
"service_name": "${deployment_name}",
"service_offering_enabled": ${service_offering_enabled},
"service_plan": "autoscaler-free-plan",
"skip_ssl_validation": ${skip_ssl_validation},
"use_existing_organization": ${use_existing_organization},
"use_existing_space": ${use_existing_space},
"use_http": false
}
EOF

Expand Down
1 change: 1 addition & 0 deletions docs/autocaler-scheduler-apisv1.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2023-05-22T14:53:18.681Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/18.0.1 Chrome/100.0.4896.143 Electron/18.2.0 Safari/537.36" etag="t85FlPIPGBBftR37arXV" version="18.0.1" type="device"><diagram id="t1d-M7BKujPft_ienzus" name="Page-1">7Vxbl6K4Fv4t8+BaMw/W4iIqj3XR7tOnerpn7J4z/XRWhKiZRsIE8DK/fnYgIJBoWSpYttZDCbmzv+ydfYOW+ThfvWMomH2kLvZahuauWuZTyzB0TTPgh5es0xJD64mSKSOuaLUpGJF/cNZVlMbExWGpYUSpF5GgXOhQ38dOVCpDjNFludmEeuVZAzTFUsHIQZ5c+j/iRrO0tG9pm/L3mExn2cwdTdTMUdZYFIQz5NJlocgctMxHRmmUXs1Xj9jj1MvokvYbbqnNF8awH+3TYW3/0/7jr+DbB7vb6T/bf4brX39r6wKNMFpnT4xdIIC4pSya0Sn1kTfYlD4wGvsu5sNqcLdp80xpAIU6FP6Fo2gt0ERxRKFoFs09UQsrZus/Rf/k5hu/ubOy26dVsfJpnd2tSMS76Xewr9LbQke42/TjN8VunzEjcxxhJspk6gmChjRmDt5BMlvsQsSmONpF2rQdJ2dhAoHNO0xhNWwNDRj2UEQW5f2GxLad5u02yMKFAPc1QKfjLpAXi5neY+TBFjW0EWYLoIvR9eBxHsb8asqv+lpfl3ZHGfvljER4FKCEYEsQAWWctxIZ5ovwaidZRK2V8ZMQIGZP3C833KhnLDYrcGJXq4mShkTJj4j4u+movTk66h0DuOa8lLQkSmbEm1B40CK9un/HNKtoh4lcuYcGej9YJfTJ6jOaj5wZdmMvgQPNOTn9cRgkDRKcCFBazAVLT6dLe0pIAYGjMhxhxOh3/Eg9yqWJT30uFCfE8ypFyCNTH24dgI0LngcOF4Gz5V5UzInrJhJVhX95h5xgC5iaVdoCbRl/ONhk/O268O9K+L8bfPlx6a9bFVHWlwHoKvjPrIv+veumf8eUj5JG6a+b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GFr5nHP4AHevNIJfcFNVX/E7geVpVr1WliKbtavn9mnZb1Wb9an67G7V4+u79/zj6Rt/QIFSZeNeTbdD0sALRLF2mOOHOmIz67/6NcktCd1Sani/8g6YNNDBn6WE281n4NPmm6/pm4N/AQ==</diagram></mxfile>
4 changes: 4 additions & 0 deletions docs/images/autocaler-scheduler-apisv1.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions example/operation/disable-basicauth-on-health-endpoints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
- type: remove
path: /instance_groups/name=asactors/jobs/name=scalingengine/properties/autoscaler/scalingengine/health/password

- type: remove
path: /instance_groups/name=asactors/jobs/name=scheduler/properties/autoscaler/scheduler/health/basicAuthEnabled

- type: remove
path: /instance_groups/name=asactors/jobs/name=scheduler/properties/autoscaler/scheduler/health/username

Expand Down
30 changes: 29 additions & 1 deletion jobs/golangapiserver/spec
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,35 @@ properties:
autoscaler.apiserver.public_api.server.server_key:
description: "PEM-encoded server key"
autoscaler.apiserver.health.port:
default: 1080
default: 6206
autoscaler.apiserver.health.username:
default: ""
description: |
Username used for basic access authentication to connect to the protected health-endpoints.
Alternative of setting username_hash.
autoscaler.apiserver.health.username_hash:
default: ""
description: |
Hash-Value of the username used for basic access authentication to connect to the protected health-endpoints.
Alternative of setting the username.
autoscaler.apiserver.health.password:
default: ""
description: |
Password used for basic access authentication to connect to the protected health-endpoints.
Prefer usage of password_hash instead.
autoscaler.apiserver.health.password_hash:
default: ""
description: |
Hash-Value of the password used for basic access authentication to connect to the protected health-endpoints.
More secure alternative of setting the password. Set to `""` if you don't want to use it.
autoscaler.apiserver.health.unprotected_endpoints:
description: |
List of all health-endpoints, that run _without_ basic access authentication.
Valid endpoints are /debug/pprof, /health, /health/liveness, /health/prometheus, /health/readiness
default: [] # protect everything
autoscaler.apiserver.health.readiness_enabled:
default: false
description: "Set to true if you want to enable the endpoint on /health/readiness"
autoscaler.apiserver.use_buildin_mode:
default: true
description: ""
Expand Down
6 changes: 6 additions & 0 deletions jobs/golangapiserver/templates/apiserver.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ use_buildin_mode: <%= p("autoscaler.apiserver.use_buildin_mode") %>

health:
port: <%= p("autoscaler.apiserver.health.port") %>
username: <%= p("autoscaler.apiserver.health.username") %>
username_hash: <%= p("autoscaler.apiserver.health.username_hash") %>
password: <%= p("autoscaler.apiserver.health.password") %>
password_hash: <%= p("autoscaler.apiserver.health.password_hash") %>
unprotected_endpoints: <%= p("autoscaler.apiserver.health.unprotected_endpoints") %>
readiness_enabled: <%= p("autoscaler.apiserver.health.readiness_enabled") %>

db:
policy_db:
Expand Down
9 changes: 8 additions & 1 deletion jobs/metricsforwarder/spec
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ properties:
autoscaler.metricsforwarder.policy_poller_interval:
description: "The time interval to refresh cached policies from policy database"
default: 60s

autoscaler.metricsforwarder.health.port:
description: "The listening port of health endpoint"
default: 6403
Expand All @@ -143,6 +142,14 @@ properties:
autoscaler.metricsforwarder.health.password:
description: "the password of health endpoint"
default: ''
autoscaler.metricsforwarder.health.unprotected_endpoints:
description: |
List of all health-endpoints, that run _without_ basic access authentication.
Valid endpoints are /debug/pprof, /health, /health/liveness, /health/prometheus, /health/readiness
default: [] # protect everything
autoscaler.metricsforwarder.health.readiness_enabled:
default: false
description: "Set to true if you want to enable the endpoint on /health/readiness"
autoscaler.metricsforwarder.rate_limit.valid_duration:
description: "The rate limit evaluation duration"
default: 1s
Expand Down
11 changes: 5 additions & 6 deletions jobs/metricsforwarder/templates/metricsforwarder.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@
end
db_url
end

###########################################
# Template Main #
###########################################
job_name = 'metricsforwarder'
policy_db_url = build_db_url('policy_db', job_name)
if p("autoscaler.storedprocedure_db.address") != ''
storedprocedure_db_url = build_db_url('storedprocedure_db', job_name)
end

%>

###########################################
# Template Main #
###########################################
server:
port: <%= p("autoscaler.metricsforwarder.server.port") %>
logging:
Expand Down Expand Up @@ -74,7 +72,8 @@ health:
port: <%= p("autoscaler.metricsforwarder.health.port") %>
username: <%= p("autoscaler.metricsforwarder.health.username") %>
password: <%= p("autoscaler.metricsforwarder.health.password") %>

unprotected_endpoints: <%= p("autoscaler.metricsforwarder.health.unprotected_endpoints") %>
readiness_enabled: <%= p("autoscaler.metricsforwarder.health.readiness_enabled") %>
rate_limit:
valid_duration: <%= p("autoscaler.metricsforwarder.rate_limit.valid_duration") %>
max_amount: <%= p("autoscaler.metricsforwarder.rate_limit.max_amount") %>
Expand Down
9 changes: 9 additions & 0 deletions jobs/metricsgateway/spec
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,12 @@ properties:
autoscaler.metricsgateway.health.password:
description: "the password of health endpoint"
default: ''
autoscaler.metricsgateway.health.unprotected_endpoints:
description: |
List of all health-endpoints, that run _without_ basic access authentication.
Valid endpoints are /debug/pprof, /health, /health/liveness, /health/prometheus, /health/readiness
default: [] # protect everything
autoscaler.metricsgateway.health.readiness_enabled:
default: false
description: "Set to true if you want to enable the endpoint on /health/readiness"

13 changes: 6 additions & 7 deletions jobs/metricsgateway/templates/metricsgateway.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,16 @@
end
db_url
end

###########################################
# Template Main #
###########################################
job_name = 'metricsgateway'
policy_db_url = build_db_url('policy_db', job_name)

metricsserver_sorted_instances=link("metricsserver").instances.sort_by {|i|i.address}
metricsserver_addrs=metricsserver_sorted_instances.map{|i| "'wss://#{i.address}:#{link("metricsserver").p('autoscaler.metricsserver.collector.port')}'"}
metricsserver_nodeAddrs="[" + metricsserver_addrs.join(",") +"]"

%>


###########################################
# Template Main #
###########################################
logging:
level: <%= p("autoscaler.metricsgateway.logging.level") %>
envelop_chan_size: <%= p("autoscaler.metricsgateway.envelop_chan_size") %>
Expand Down Expand Up @@ -80,3 +76,6 @@ health:
port: <%= p("autoscaler.metricsgateway.health.port") %>
username: <%= p("autoscaler.metricsgateway.health.username") %>
password: <%= p("autoscaler.metricsgateway.health.password") %>
unprotected_endpoints: <%= p("autoscaler.metricsgateway.health.unprotected_endpoints") %>
readiness_enabled: <%= p("autoscaler.metricsgateway.health.readiness_enabled") %>

8 changes: 8 additions & 0 deletions jobs/metricsserver/spec
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ properties:
autoscaler.metricsserver.health.password:
description: "the password of health endpoint"
default: ''
autoscaler.metricsserver.health.unprotected_endpoints:
description: |
List of all health-endpoints, that run _without_ basic access authentication.
Valid endpoints are /debug/pprof, /health, /health/liveness, /health/prometheus, /health/readiness
default: [] # protect everything
autoscaler.metricsserver.health.readiness_enabled:
default: false
description: "Set to true if you want to enable the endpoint on /health/readiness"
autoscaler.changeloglock_timeout_seconds:
default: 180
description: "Liquibase changelog lock timeout duration in seconds"
14 changes: 7 additions & 7 deletions jobs/metricsserver/templates/metricsserver.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,18 @@
end
db_url
end

###########################################
# Template Main #
###########################################
job_name = 'metricsserver'
instance_metrics_db_url = build_db_url('instancemetrics_db', job_name)
policy_db_url = build_db_url('policy_db', job_name)

sorted_instances=link("metricsserver").instances.sort_by {|i|i.address}
nodeIndex=sorted_instances.index(sorted_instances.find{|i|i.id == spec.id})
addrs=sorted_instances.map{|i| "'#{i.address}'"}
nodeAddrs="[" + addrs.join(",") +"]"

nodeAddrs="[" + addrs.join(",") +"]"
%>

###########################################
# Template Main #
###########################################
logging:
level: <%= p("autoscaler.metricsserver.logging.level") %>
http_client_timeout: <%= p("autoscaler.metricsserver.http_client_timeout") %>
Expand Down Expand Up @@ -89,6 +86,9 @@ health:
port: <%= p("autoscaler.metricsserver.health.port") %>
username: <%= p("autoscaler.metricsserver.health.username") %>
password: <%= p("autoscaler.metricsserver.health.password") %>
unprotected_endpoints: <%= p("autoscaler.metricsserver.health.unprotected_endpoints") %>
readiness_enabled: <%= p("autoscaler.metricsserver.health.readiness_enabled") %>




Loading