Skip to content

Commit

Permalink
feat(chart): Add node registration secret to exec preStop container
Browse files Browse the repository at this point in the history
Update default scalingStrategy.strategy: accurate
[skip ci]

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Jan 23, 2024
1 parent 19b1df5 commit acb7fe7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
9 changes: 8 additions & 1 deletion charts/selenium-grid/configs/node/nodePreStop.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
if [ ! -z "${SE_REGISTRATION_SECRET}" ];
then
HEADERS="X-REGISTRATION-SECRET: ${SE_REGISTRATION_SECRET}"
else
HEADERS="X-REGISTRATION-SECRET;"
fi

if curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; then
curl -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header 'X-REGISTRATION-SECRET;'
curl -k -X POST ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/se/grid/node/drain --header "${HEADERS}"
while curl -sfk ${SE_SERVER_PROTOCOL}://127.0.0.1:${SE_NODE_PORT}/status; do sleep 1; done
else
echo "Node is already drained. Shutting down gracefully!"
Expand Down
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Secret TLS fullname
Is registration secret enabled
*/}}
{{- define "seleniumGrid.tls.registrationSecret.enabled" -}}
{{- and .Values.tls.enabled .Values.tls.registrationSecret.enabled | ternary "true" "" -}}
{{- .Values.tls.registrationSecret.enabled | ternary "true" "" -}}
{{- end -}}

{{/*
Expand Down
2 changes: 1 addition & 1 deletion charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ autoscaling:
scaledJobOptions:
scalingStrategy:
# Change this to "accurate" when the calculation problem is fixed
strategy: default
strategy: accurate
# Number of Completed jobs should be kept
successfulJobsHistoryLimit: 0
# Number of Failed jobs should be kept (for troubleshooting purposes)
Expand Down
2 changes: 1 addition & 1 deletion tests/charts/ci/JobAutoscaling-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ isolateComponents: false
autoscaling:
enableWithExistingKEDA: true
scalingType: job
strategy: default
strategy: accurate
scaledOptions:
minReplicaCount: 0
maxReplicaCount: 5
Expand Down
2 changes: 1 addition & 1 deletion tests/charts/refValues/sample-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ autoscaling:
successfulJobsHistoryLimit: 0
failedJobsHistoryLimit: 5
scalingStrategy:
strategy: default
strategy: accurate

hub:
subPath: *gridAppRoot
Expand Down
2 changes: 1 addition & 1 deletion tests/charts/refValues/simplex-minikube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ autoscaling:
successfulJobsHistoryLimit: 0
failedJobsHistoryLimit: 5
scalingStrategy:
strategy: default
strategy: accurate

hub:
subPath: *gridAppRoot
Expand Down

0 comments on commit acb7fe7

Please sign in to comment.