[stable/selenium] Add liveness probes and preStop hooks on browsers (#22210)

* Add liveness probes and preStop hooks on browsers

Signed-off-by: Gustavo Michels <gustavomichels@icloud.com>

* Bump up chart version

Signed-off-by: Gustavo Michels <gustavomichels@icloud.com>

* Make liveness probes and preStop hooks optional and disabled by default

Signed-off-by: Gustavo Michels <gustavomichels@icloud.com>

* Update README to include new options

Signed-off-by: Gustavo Michels <gustavomichels@icloud.com>
This commit is contained in:
Gustavo Michels
2020-05-11 10:31:51 -07:00
committed by GitHub
parent 35f2a3e7cc
commit f0e94196b0
11 changed files with 177 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: selenium
version: 1.1.0
version: 1.1.1
appVersion: 3.141.59
description: Chart for selenium grid
keywords:
+8
View File
@@ -91,6 +91,8 @@ The following table lists the configurable parameters of the Selenium chart and
| `chrome.imagePullSecrets` | The secret to use for pulling the image. Will override the global parameter if set | `nil` |
| `chrome.pullPolicy` | The pull policy for the node chrome image | `IfNotPresent` |
| `chrome.replicas` | The number of selenium node chrome pods. This is ignored if runAsDaemonSet is enabled. | `1` |
| `chrome.enableLivenessProbe` | When true will add a liveness check to the pod | `false` |
| `chrome.waitForRunningSessions` | When true will wait for current running sessions to finish before terminating the pod | `false` |
| `chrome.podAnnotations` | Annotations on the chrome pods | `{}` |
| `chrome.securityContext` | SecurityContext on the chrome pods | `{"runAsUser": 1000, "fsGroup": 1000}` |
| `chrome.extraEnvs` | Any additional environment variables to set in the pods | `[]` |
@@ -119,6 +121,8 @@ The following table lists the configurable parameters of the Selenium chart and
| `chromeDebug.imagePullSecrets` | The secret to use for pulling the image. Will override the global parameter if set | `nil` |
| `chromeDebug.pullPolicy` | The selenium node chrome debug pull policy | `IfNotPresent` |
| `chromeDebug.replicas` | The number of selenium node chrome debug pods. This is ignored if runAsDaemonSet is enabled. | `1` |
| `chromeDebug.enableLivenessProbe` | When true will add a liveness check to the pod | `false` |
| `chromeDebug.waitForRunningSessions` | When true will wait for current running sessions to finish before terminating the pod | `false` |
| `chromeDebug.podAnnotations` | Annotations on the Chrome debug pod | `{}` |
| `chromeDebug.securityContext` | SecurityContext on the Chrome debug pods | `{"runAsUser": 1000, "fsGroup": 1000}` |
| `chromeDebug.extraEnvs` | Any additional environment variables to set in the pods | `[]` |
@@ -147,6 +151,8 @@ The following table lists the configurable parameters of the Selenium chart and
| `firefox.imagePullSecrets` | The secret to use for pulling the image. Will override the global parameter if set | `nil` |
| `firefox.pullPolicy` | The selenium node firefox pull policy | `IfNotPresent` |
| `firefox.replicas` | The number of selenium node firefox pods. This is ignored if runAsDaemonSet is enabled. | `1` |
| `firefox.enableLivenessProbe` | When true will add a liveness check to the pod | `false` |
| `firefox.waitForRunningSessions` | When true will wait for current running sessions to finish before terminating the pod | `false` |
| `firefox.podAnnotations` | Annotations on the firefox pods | `{}` |
| `firefox.securityContext` | SecurityContext on the firefox pods | `{"runAsUser": 1000, "fsGroup": 1000}` |
| `firefox.extraEnvs` | Any additional environment variables to set in the pods | `[]` |
@@ -173,6 +179,8 @@ The following table lists the configurable parameters of the Selenium chart and
| `firefoxDebug.imagePullSecrets` | The secret to use for pulling the image. Will override the global parameter if set | `nil` |
| `firefoxDebug.pullPolicy` | The selenium node firefox debug pull policy | `IfNotPresent` |
| `firefoxDebug.replicas` | The number of selenium node firefox debug pods. This is ignored if runAsDaemonSet is enabled. | `1` |
| `firefoxDebug.enableLivenessProbe` | When true will add a liveness check to the pod | `false` |
| `firefoxDebug.waitForRunningSessions` | When true will wait for current running sessions to finish before terminating the pod | `false` |
| `firefoxDebug.podAnnotations` | Annotations on the firefox debug pods | `{}` |
| `firefoxDebug.securityContext` | SecurityContext on the firefox debug pods | `{"runAsUser": 1000, "fsGroup": 1000}` |
| `firefoxDebug.extraEnvs` | Any additional environment variables to set in the pods | `[]` |
@@ -32,6 +32,24 @@ spec:
name: jmx
protocol: TCP
{{- end }}
{{- if .Values.chrome.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.chrome.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.chrome.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.chrome.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
@@ -37,6 +37,24 @@ spec:
name: jmx
protocol: TCP
{{- end }}
{{- if .Values.chrome.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.chrome.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.chrome.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.chrome.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
@@ -34,6 +34,24 @@ spec:
{{- end }}
- containerPort: 5900
name: vnc
{{- if .Values.chromeDebug.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.chromeDebug.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.chromeDebug.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.chromeDebug.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
@@ -39,6 +39,24 @@ spec:
{{- end }}
- containerPort: 5900
name: vnc
{{- if .Values.chromeDebug.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.chromeDebug.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.chromeDebug.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.chromeDebug.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
@@ -32,6 +32,24 @@ spec:
name: jmx
protocol: TCP
{{- end }}
{{- if .Values.firefox.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.firefox.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.firefox.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.firefox.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
@@ -37,6 +37,24 @@ spec:
name: jmx
protocol: TCP
{{- end }}
{{- if .Values.firefox.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.firefox.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.firefox.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.firefox.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
@@ -35,6 +35,24 @@ spec:
{{- end }}
- containerPort: 5900
name: vnc
{{- if .Values.firefoxDebug.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.firefoxDebug.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.firefoxDebug.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.firefoxDebug.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
@@ -39,6 +39,24 @@ spec:
{{- end }}
- containerPort: 5900
name: vnc
{{- if .Values.firefoxDebug.enableLivenessProbe }}
livenessProbe:
httpGet:
path: /wd/hub/status
port: {{ default "5555" .Values.firefoxDebug.nodePort }}
initialDelaySeconds: 30
periodSeconds: 30
failureThreshold: 1
{{- end }}
{{- if .Values.firefoxDebug.waitForRunningSessions }}
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -c
- "while [ $(wget -q -O - http://localhost:{{ default "5555" .Values.firefoxDebug.nodePort }}/wd/hub/sessions | grep -c capabilities) -gt 0 ]; do sleep 1; done"
{{- end }}
env:
- name: HUB_PORT_4444_TCP_ADDR
value: {{ template "selenium.hub.fullname" . }}
+24
View File
@@ -173,6 +173,12 @@ chrome:
## The number of pods in the deployment. This is ignored if runAsDaemonSet is enabled.
replicas: 1
## When true will add a liveness check to the pod
enableLivenessProbe: false
## When true will wait for current running sessions to finish before terminating the pod
waitForRunningSessions: false
## Configure annotations on the chrome pods
podAnnotations: {}
@@ -272,6 +278,12 @@ chromeDebug:
## The number of pods in the deployment. This is ignored if runAsDaemonSet is enabled.
replicas: 1
## When true will add a liveness check to the pod
enableLivenessProbe: false
## When true will wait for current running sessions to finish before terminating the pod
waitForRunningSessions: false
## Configure annotations on the chrome debug pods
podAnnotations: {}
@@ -370,6 +382,12 @@ firefox:
## The number of pods in the deployment. This is ignored if runAsDaemonSet is enabled.
replicas: 1
## When true will add a liveness check to the pod
enableLivenessProbe: false
## When true will wait for current running sessions to finish before terminating the pod
waitForRunningSessions: false
## Configure annotations on the firefox pods
podAnnotations: {}
@@ -455,6 +473,12 @@ firefoxDebug:
## The number of pods in the deployment. This is ignored if runAsDaemonSet is enabled.
replicas: 1
## When true will add a liveness check to the pod
enableLivenessProbe: false
## When true will wait for current running sessions to finish before terminating the pod
waitForRunningSessions: false
## Configure annotations on the firefox debug pods
podAnnotations: {}