Skip to content

Commit e27f6ed

Browse files
committed
chart(update): replace another mininal kubectl container for patch job
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 35fafaf commit e27f6ed

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

Diff for: charts/selenium-grid/CONFIGURATION.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
3232
| global.seleniumGrid.imageTag | string | `"4.24.0-20240907"` | Image tag for all selenium components |
3333
| global.seleniumGrid.nodesImageTag | string | `"4.24.0-20240907"` | Image tag for browser's nodes |
3434
| global.seleniumGrid.videoImageTag | string | `"ffmpeg-7.0.2-20240907"` | Image tag for browser's video recorder |
35-
| global.seleniumGrid.kubectlImage | string | `"bitnami/kubectl:latest"` | kubectl image is used to execute kubectl commands in utility jobs |
35+
| global.seleniumGrid.kubectlImage | string | `"jitesoft/kubectl:latest"` | kubectl image is used to execute kubectl commands in utility jobs |
3636
| global.seleniumGrid.imagePullSecret | string | `""` | Pull secret for all components, can be overridden individually |
3737
| global.seleniumGrid.logLevel | string | `"INFO"` | Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging |
3838
| global.seleniumGrid.defaultNodeStartupProbe | string | `"exec"` | Set default startup probe method for all nodes (supplied values: httpGet, exec). If not set, the default is httpGet |
@@ -305,6 +305,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
305305
| autoscaling.patchObjectFinalizers.enabled | bool | `true` | Enable patching finalizers for KEDA scaled resources. Workaround for Hook post-upgrade selenium-grid/templates/x-node-hpa.yaml failed: object is being deleted: scaledobjects.keda.sh "x" already exists |
306306
| autoscaling.patchObjectFinalizers.activeDeadlineSeconds | int | `120` | Deadline (in seconds) for patch job to complete |
307307
| autoscaling.patchObjectFinalizers.annotations | object | `{"helm.sh/hook":"post-install,post-upgrade,post-rollback,pre-delete","helm.sh/hook-delete-policy":"hook-succeeded,before-hook-creation","helm.sh/hook-weight":"-1"}` | Annotations for patch job |
308+
| autoscaling.patchObjectFinalizers.imagePullSecret | string | `""` | Custom pull secret for container in patch job |
309+
| autoscaling.patchObjectFinalizers.resources | object | `{"limits":{"cpu":"50m","memory":"50Mi"},"requests":{"cpu":"10m","memory":"10Mi"}}` | Define resources for container in patch job |
308310
| autoscaling.scaledOptions | object | `{"maxReplicaCount":8,"minReplicaCount":0,"pollingInterval":10}` | Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) |
309311
| autoscaling.scaledOptions.minReplicaCount | int | `0` | Minimum number of replicas |
310312
| autoscaling.scaledOptions.maxReplicaCount | int | `8` | Maximum number of replicas |

Diff for: charts/selenium-grid/templates/patch-keda/patch-keda-objects-job.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,19 @@ spec:
3030
containers:
3131
- name: {{ template "seleniumGrid.keda.patchObjectsJob.fullname" $ }}
3232
image: {{ $.Values.global.seleniumGrid.kubectlImage }}
33-
command: ["/bin/bash", "-c"]
33+
command: ["/bin/sh", "-c"]
3434
args:
3535
- |
3636
echo "Cleaning up ScaledObjects, ScaledJobs and HPAs for {{ .Release.Name }} when upgrading or disabling autoscaling."
37-
kubectl get ScaledObjects,ScaledJobs -n {{ .Release.Namespace }} -l component.autoscaling={{ .Release.Name }} -o=json | jq '.metadata.finalizers = null' | kubectl apply -f - || true ;
37+
kubectl patch ScaledObjects,ScaledJobs -n {{ .Release.Namespace }} -l component.autoscaling={{ .Release.Name }} -p '{"metadata":{"finalizers":null}}' || true ;
3838
kubectl delete ScaledObjects,ScaledJobs -n {{ .Release.Namespace }} -l component.autoscaling={{ .Release.Name }} --wait || true ;
3939
kubectl delete hpa -n {{ .Release.Namespace }} -l component.autoscaling={{ .Release.Name }} --wait || true ;
40+
{{- with $.Values.autoscaling.patchObjectFinalizers.resources }}
41+
resources: {{ toYaml . | nindent 12 }}
42+
{{- end }}
43+
{{- if or $.Values.global.seleniumGrid.imagePullSecret $.Values.autoscaling.patchObjectFinalizers.imagePullSecret }}
44+
imagePullSecrets:
45+
- name: {{ default $.Values.global.seleniumGrid.imagePullSecret $.Values.autoscaling.patchObjectFinalizers.imagePullSecret }}
46+
{{- end }}
4047
restartPolicy: Never
4148
{{- end }}

Diff for: charts/selenium-grid/values.yaml

+11-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ global:
1313
# -- Image tag for browser's video recorder
1414
videoImageTag: ffmpeg-7.0.2-20240907
1515
# -- kubectl image is used to execute kubectl commands in utility jobs
16-
kubectlImage: bitnami/kubectl:latest
16+
kubectlImage: jitesoft/kubectl:latest
1717
# -- Pull secret for all components, can be overridden individually
1818
imagePullSecret: ""
1919
# -- Log level for all components. Possible values describe here: https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging
@@ -796,6 +796,16 @@ autoscaling:
796796
"helm.sh/hook": post-install,post-upgrade,post-rollback,pre-delete
797797
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
798798
"helm.sh/hook-weight": "-1"
799+
# -- Custom pull secret for container in patch job
800+
imagePullSecret: ""
801+
# -- Define resources for container in patch job
802+
resources:
803+
requests:
804+
cpu: 10m
805+
memory: 10Mi
806+
limits:
807+
cpu: 50m
808+
memory: 50Mi
799809
# -- Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject)
800810
scaledOptions:
801811
# -- Minimum number of replicas

0 commit comments

Comments
 (0)