Skip to content

Commit 4b6d675

Browse files
authored
K8s: Expose config session request timeout in Helm chart values (#3006)
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
1 parent a43e8cd commit 4b6d675

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

charts/selenium-grid/CONFIGURATION.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
4949
| global.seleniumGrid.updateStrategy.rollingUpdate | object | `{"maxSurge":1,"maxUnavailable":0}` | Specify for strategy RollingUpdate |
5050
| global.seleniumGrid.affinity | object | `{}` | Specify affinity for all components, can be overridden individually |
5151
| global.seleniumGrid.topologySpreadConstraints | list | `[]` | Specify topologySpreadConstraints for all components, can be overridden individually |
52+
| global.seleniumGrid.sessionRequestTimeout | int | `300` | Timeout in seconds. A new incoming session request is added to the queue. Requests sitting in the queue for longer than the configured time will timeout. |
5253
| global.seleniumGrid.nodeMaxSessions | int | `1` | Specify number of max sessions per node. Can be overridden by individual component (this is also set to scaler trigger parameter `nodeMaxSessions` if `autoscaling` is enabled) |
5354
| global.seleniumGrid.nodeDrainAfterSessionCount | int | `0` | Set number of sessions will be executed in a Node before detaching it from Hub and shutting it down |
5455
| global.seleniumGrid.nodeEnableManagedDownloads | bool | `true` | This causes the Node to auto manage files downloaded for a given session on the Node (https://www.selenium.dev/documentation/webdriver/drivers/remote_webdriver/#enable-downloads-in-the-grid) |
@@ -300,6 +301,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
300301
| components.sessionQueue.imageTag | string | `nil` | Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) |
301302
| components.sessionQueue.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
302303
| components.sessionQueue.imagePullSecret | string | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
304+
| components.sessionQueue.sessionRequestTimeout | string | `""` | Override global sessionRequestTimeout |
303305
| components.sessionQueue.extraEnvironmentVariables | list | `[]` | Specify extra environment variables for Session Queue |
304306
| components.sessionQueue.extraEnvFrom | list | `[]` | Specify extra environment variables from ConfigMap and Secret for Session Queue |
305307
| components.sessionQueue.affinity | object | `{}` | Specify affinity for Session Queue pods, this overwrites global.seleniumGrid.affinity parameter |
@@ -331,6 +333,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
331333
| hub.annotations | object | `{}` | Custom annotations for Selenium Hub pods |
332334
| hub.labels | object | `{}` | Custom labels for Selenium Hub pods |
333335
| hub.disableUI | bool | `false` | Disable the Grid UI |
336+
| hub.sessionRequestTimeout | string | `""` | Override global sessionRequestTimeout |
334337
| hub.newSessionThreadPoolSize | string | `nil` | Configure fixed-sized thread pool for the Distributor to create new sessions as it consumes new session requests from the queue |
335338
| hub.publishPort | int | `4442` | Port where events are published |
336339
| hub.publishNodePort | int | `31442` | NodePort exposed where events are published |

charts/selenium-grid/templates/hub-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ spec:
134134
- name: SE_DISTRIBUTOR_SLOT_SELECTOR
135135
value: {{ include "seleniumGrid.autoscaling.distributor.slotSelector" $ | quote }}
136136
{{- end }}
137+
{{- $sessionRequestTimeout := default $.Values.global.seleniumGrid.sessionRequestTimeout $.Values.hub.sessionRequestTimeout | int64 }}
138+
- name: SE_SESSION_REQUEST_TIMEOUT
139+
value: {{ $sessionRequestTimeout | quote }}
137140
{{- with .Values.hub.extraEnvironmentVariables }}
138141
{{- tpl (toYaml .) $ | nindent 12 }}
139142
{{- end }}

charts/selenium-grid/templates/session-queue-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ spec:
5151
fieldPath: status.podIP
5252
- name: SE_SESSION_QUEUE_PORT
5353
value: {{ .Values.components.sessionQueue.port | quote }}
54+
{{- $sessionRequestTimeout := default $.Values.global.seleniumGrid.sessionRequestTimeout $.Values.components.sessionQueue.sessionRequestTimeout | int64 }}
55+
- name: SE_SESSION_REQUEST_TIMEOUT
56+
value: {{ $sessionRequestTimeout | quote }}
5457
{{- with .Values.components.extraEnvironmentVariables }}
5558
{{- tpl (toYaml .) $ | nindent 12 }}
5659
{{- end }}

charts/selenium-grid/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ global:
5050
# topologyKey: kubernetes.io/hostname
5151
# whenUnsatisfiable: DoNotSchedule
5252
# Note: If not define labelSelector, it will be added automatically based on "app" label in each component
53+
# -- Timeout in seconds. A new incoming session request is added to the queue. Requests sitting in the queue for longer than the configured time will timeout.
54+
sessionRequestTimeout: 300
5355
# -- Specify number of max sessions per node. Can be overridden by individual component (this is also set to scaler trigger parameter `nodeMaxSessions` if `autoscaling` is enabled)
5456
nodeMaxSessions: 1
5557
# Noted: In case of autoscaling enabled, with scaling type `job`, Node will be drained following `nodeMaxSessions` by default
@@ -756,6 +758,8 @@ components:
756758
imagePullPolicy: IfNotPresent
757759
# -- Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)
758760
imagePullSecret: ""
761+
# -- Override global sessionRequestTimeout
762+
sessionRequestTimeout: ""
759763

760764
# -- Specify extra environment variables for Session Queue
761765
extraEnvironmentVariables: []
@@ -849,6 +853,8 @@ hub:
849853
labels: {}
850854
# -- Disable the Grid UI
851855
disableUI: false
856+
# -- Override global sessionRequestTimeout
857+
sessionRequestTimeout: ""
852858
# -- Configure fixed-sized thread pool for the Distributor to create new sessions as it consumes new session requests from the queue
853859
newSessionThreadPoolSize:
854860
# -- Port where events are published

tests/charts/ci/base-auth-ingress-values.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ global:
22
seleniumGrid:
33
logLevel: INFO
44
stdoutProbeLog: true
5+
sessionRequestTimeout: 800
56

67
serverConfigMap:
78
env:
@@ -19,8 +20,6 @@ isolateComponents: true
1920

2021
hub:
2122
extraEnvironmentVariables: &extraEnvironmentVariables
22-
- name: SE_SESSION_REQUEST_TIMEOUT
23-
value: "800"
2423
- name: SE_SESSION_RETRY_INTERVAL
2524
value: "5"
2625
- name: SE_HEALTHCHECK_INTERVAL

0 commit comments

Comments
 (0)