Skip to content

Commit aa55ed1

Browse files
nefelim4agdiemol
andauthored
helm: add lifecycle preStop hook & startupProbe, fix port number (#1609)
helm: add lifecycle preStop hook & startupProbe, fix port number in values.yaml * Fix typos in templates Co-authored-by: Vadim Grek <[email protected]> * Resolve conflicts Co-authored-by: Diego Molina <[email protected]>
1 parent 3e962cd commit aa55ed1

File tree

5 files changed

+96
-6
lines changed

5 files changed

+96
-6
lines changed

charts/selenium-grid/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ This table contains the configuration parameters of the chart and their default
7373
| `chromeNode.imageTag` | `4.3.0-20220726` | Image of chrome nodes |
7474
| `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
7575
| `chromeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) |
76-
| `chromeNode.ports` | `[5553]` | Port list to enable on container |
76+
| `chromeNode.ports` | `[5555]` | Port list to enable on container |
7777
| `chromeNode.seleniumPort` | `5900` | Selenium port (spec.ports[0].targetPort in kubernetes service) |
7878
| `chromeNode.seleniumServicePort` | `6900` | Selenium port exposed in service (spec.ports[0].port in kubernetes service) |
7979
| `chromeNode.annotations` | `{}` | Annotations for chrome-node pods |
@@ -89,6 +89,9 @@ This table contains the configuration parameters of the chart and their default
8989
| `chromeNode.service.type` | `ClusterIP` | Service type |
9090
| `chromeNode.service.annotations` | `{}` | Custom annotations for service |
9191
| `chromeNode.dshmVolumeSizeLimit` | `1Gi` | Size limit for DSH volume mounted in container (if not set, default is "1Gi") |
92+
| `chromeNode.startupProbe` | `{}` | Probe to check pod is started successfully |
93+
| `chromeNode.terminationGracePeriodSeconds` | `30` | Time to graceful terminate container (default: 30s) |
94+
| `chromeNode.lifecycle` | `{}` | hooks to make pod correctly shutdown or started |
9295
| `chromeNode.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod |
9396
| `chromeNode.extraVolumes` | `[]` | Extra Volumes declarations to be used in the pod (can be any supported volume type: ConfigMap, Secret, PVC, NFS, etc.) |
9497
| `firefoxNode.enabled` | `true` | Enable firefox nodes |
@@ -97,7 +100,7 @@ This table contains the configuration parameters of the chart and their default
97100
| `firefoxNode.imageTag` | `4.3.0-20220726` | Image of firefox nodes |
98101
| `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
99102
| `firefoxNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) |
100-
| `firefoxNode.ports` | `[5553]` | Port list to enable on container |
103+
| `firefoxNode.ports` | `[5555]` | Port list to enable on container |
101104
| `firefoxNode.seleniumPort` | `5900` | Selenium port (spec.ports[0].targetPort in kubernetes service) |
102105
| `firefoxNode.seleniumServicePort` | `6900` | Selenium port exposed in service (spec.ports[0].port in kubernetes service) |
103106
| `firefoxNode.annotations` | `{}` | Annotations for firefox-node pods |
@@ -113,6 +116,9 @@ This table contains the configuration parameters of the chart and their default
113116
| `firefoxNode.service.type` | `ClusterIP` | Service type |
114117
| `firefoxNode.service.annotations` | `{}` | Custom annotations for service |
115118
| `firefoxNode.dshmVolumeSizeLimit` | `1Gi` | Size limit for DSH volume mounted in container (if not set, default is "1Gi") |
119+
| `firefoxNode.startupProbe` | `{}` | Probe to check pod is started successfully |
120+
| `firefoxNode.terminationGracePeriodSeconds` | `30` | Time to graceful terminate container (default: 30s) |
121+
| `firefoxNode.lifecycle` | `{}` | hooks to make pod correctly shutdown or started |
116122
| `firefoxNode.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod |
117123
| `firefoxNode.extraVolumes` | `[]` | Extra Volumes declarations to be used in the pod (can be any supported volume type: ConfigMap, Secret, PVC, NFS, etc.) |
118124
| `edgeNode.enabled` | `true` | Enable edge nodes |
@@ -121,7 +127,7 @@ This table contains the configuration parameters of the chart and their default
121127
| `edgeNode.imageTag` | `4.3.0-20220726` | Image of edge nodes |
122128
| `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
123129
| `edgeNode.imagePullSecret` | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry) |
124-
| `edgeNode.ports` | `[5553]` | Port list to enable on container |
130+
| `edgeNode.ports` | `[5555]` | Port list to enable on container |
125131
| `edgeNode.seleniumPort` | `5900` | Selenium port (spec.ports[0].targetPort in kubernetes service) |
126132
| `edgeNode.seleniumServicePort` | `6900` | Selenium port exposed in service (spec.ports[0].port in kubernetes service) |
127133
| `edgeNode.annotations` | `{}` | Annotations for edge-node pods |
@@ -137,6 +143,9 @@ This table contains the configuration parameters of the chart and their default
137143
| `edgeNode.service.type` | `ClusterIP` | Service type |
138144
| `edgeNode.service.annotations` | `{}` | Custom annotations for service |
139145
| `edgeNode.dshmVolumeSizeLimit` | `1Gi` | Size limit for DSH volume mounted in container (if not set, default is "1Gi") |
146+
| `edgeNode.startupProbe` | `{}` | Probe to check pod is started successfully |
147+
| `edgeNode.terminationGracePeriodSeconds` | `30` | Time to graceful terminate container (default: 30s) |
148+
| `edgeNode.lifecycle` | `{}` | hooks to make pod correctly shutdown or started |
140149
| `edgeNode.extraVolumeMounts` | `[]` | Extra mounts of declared ExtraVolumes into pod |
141150
| `edgeNode.extraVolumes` | `[]` | Extra Volumes declarations to be used in the pod (can be any supported volume type: ConfigMap, Secret, PVC, NFS, etc.) |
142151
| `customLabels` | `{}` | Custom labels for k8s resources |

charts/selenium-grid/templates/chrome-node-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ spec:
6161
{{- with .Values.chromeNode.resources }}
6262
resources: {{- toYaml . | nindent 12 }}
6363
{{- end }}
64+
{{- with .Values.chromeNode.lifecycle }}
65+
lifecycle: {{- toYaml . | nindent 12 }}
66+
{{- end }}
67+
{{- with .Values.chromeNode.startupProbe }}
68+
startupProbe: {{- toYaml . | nindent 12 }}
69+
{{- end }}
6470
{{- if or .Values.global.seleniumGrid.imagePullSecret .Values.chromeNode.imagePullSecret }}
6571
imagePullSecrets:
6672
- name: {{ default .Values.global.seleniumGrid.imagePullSecret .Values.chromeNode.imagePullSecret }}
@@ -75,6 +81,7 @@ spec:
7581
{{- with .Values.chromeNode.priorityClassName }}
7682
priorityClassName: {{ . }}
7783
{{- end }}
84+
terminationGracePeriodSeconds: {{ .Values.chromeNode.terminationGracePeriodSeconds }}
7885
volumes:
7986
- name: dshm
8087
emptyDir:

charts/selenium-grid/templates/edge-node-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ spec:
6161
{{- with .Values.edgeNode.resources }}
6262
resources: {{- toYaml . | nindent 12 }}
6363
{{- end }}
64+
{{- with .Values.edgeNode.lifecycle }}
65+
lifecycle: {{- toYaml . | nindent 12 }}
66+
{{- end }}
67+
{{- with .Values.edgeNode.startupProbe }}
68+
startupProbe: {{- toYaml . | nindent 12 }}
69+
{{- end }}
6470
{{- with .Values.edgeNode.nodeSelector }}
6571
nodeSelector: {{- toYaml . | nindent 8 }}
6672
{{- end }}
@@ -75,6 +81,7 @@ spec:
7581
{{- with .Values.edgeNode.priorityClassName }}
7682
priorityClassName: {{ . }}
7783
{{- end }}
84+
terminationGracePeriodSeconds: {{ .Values.edgeNode.terminationGracePeriodSeconds }}
7885
volumes:
7986
- name: dshm
8087
emptyDir:

charts/selenium-grid/templates/firefox-node-deployment.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ spec:
6161
{{- with .Values.firefoxNode.resources }}
6262
resources: {{- toYaml . | nindent 12 }}
6363
{{- end }}
64+
{{- with .Values.firefoxNode.lifecycle }}
65+
lifecycle: {{- toYaml . | nindent 12 }}
66+
{{- end }}
67+
{{- with .Values.firefoxNode.startupProbe }}
68+
startupProbe: {{- toYaml . | nindent 12 }}
69+
{{- end }}
6470
{{- with .Values.firefoxNode.nodeSelector }}
6571
nodeSelector: {{- toYaml . | nindent 8 }}
6672
{{- end }}
@@ -75,6 +81,7 @@ spec:
7581
{{- with .Values.firefoxNode.priorityClassName }}
7682
priorityClassName: {{ . }}
7783
{{- end }}
84+
terminationGracePeriodSeconds: {{ .Values.firefoxNode.terminationGracePeriodSeconds }}
7885
volumes:
7986
- name: dshm
8087
emptyDir:

charts/selenium-grid/values.yaml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ chromeNode:
303303

304304
# Port list to enable on container
305305
ports:
306-
- 5553
306+
- 5555
307307
# Selenium port (spec.ports[0].targetPort in kubernetes service)
308308
seleniumPort: 5900
309309
# Selenium port exposed in service (spec.ports[0].port in kubernetes service)
@@ -361,6 +361,26 @@ chromeNode:
361361
# Priority class name for chrome-node pods
362362
priorityClassName: ""
363363

364+
# Wait for pod startup
365+
startupProbe: {}
366+
# httpGet:
367+
# path: /status
368+
# port: 5555
369+
# failureThreshold: 120
370+
# periodSeconds: 5
371+
# Time to wait for pod termination
372+
terminationGracePeriodSeconds: 30
373+
# Allow pod correctly shutdown
374+
lifecycle: {}
375+
# preStop:
376+
# exec:
377+
# command:
378+
# - bash
379+
# - -c
380+
# - |
381+
# curl -X POST 127.0.0.1:5555/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' && \
382+
# while curl 127.0.0.1:5555/status; do sleep 1; done
383+
364384
extraVolumeMounts: []
365385
# - name: my-extra-volume
366386
# mountPath: /home/seluser/Downloads
@@ -389,7 +409,7 @@ firefoxNode:
389409

390410
# Port list to enable on container
391411
ports:
392-
- 5553
412+
- 5555
393413
# Selenium port (spec.ports[0].targetPort in kubernetes service)
394414
seleniumPort: 5900
395415
# Selenium port exposed in service (spec.ports[0].port in kubernetes service)
@@ -447,6 +467,26 @@ firefoxNode:
447467
# Priority class name for firefox-node pods
448468
priorityClassName: ""
449469

470+
# Wait for pod startup
471+
startupProbe: {}
472+
# httpGet:
473+
# path: /status
474+
# port: 5555
475+
# failureThreshold: 120
476+
# periodSeconds: 5
477+
# Time to wait for pod termination
478+
terminationGracePeriodSeconds: 30
479+
# Allow pod correctly shutdown
480+
lifecycle: {}
481+
# preStop:
482+
# exec:
483+
# command:
484+
# - bash
485+
# - -c
486+
# - |
487+
# curl -X POST 127.0.0.1:5555/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' && \
488+
# while curl 127.0.0.1:5555/status; do sleep 1; done
489+
450490
extraVolumeMounts: []
451491
# - name: my-extra-volume
452492
# mountPath: /home/seluser/Downloads
@@ -474,7 +514,7 @@ edgeNode:
474514
imagePullSecret: ""
475515

476516
ports:
477-
- 5553
517+
- 5555
478518
# Selenium port (spec.ports[0].targetPort in kubernetes service)
479519
seleniumPort: 5900
480520
# Selenium port exposed in service (spec.ports[0].port in kubernetes service)
@@ -533,6 +573,26 @@ edgeNode:
533573
# Priority class name for edge-node pods
534574
priorityClassName: ""
535575

576+
# Wait for pod startup
577+
startupProbe: {}
578+
# httpGet:
579+
# path: /status
580+
# port: 5555
581+
# failureThreshold: 120
582+
# periodSeconds: 5
583+
# Time to wait for pod termination
584+
terminationGracePeriodSeconds: 30
585+
# Allow pod correctly shutdown
586+
lifecycle: {}
587+
# preStop:
588+
# exec:
589+
# command:
590+
# - bash
591+
# - -c
592+
# - |
593+
# curl -X POST 127.0.0.1:5555/se/grid/node/drain --header 'X-REGISTRATION-SECRET;' && \
594+
# while curl 127.0.0.1:5555/status; do sleep 1; done
595+
536596
extraVolumeMounts: []
537597
# - name: my-extra-volume
538598
# mountPath: /home/seluser/Downloads

0 commit comments

Comments
 (0)