Skip to content

Commit 49c4a2f

Browse files
authored
K8s: Add configs for sessions external datastore (#2491)
* K8s: Add configs for sessions external datastore * Add docker-compose file for reference --------- Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 7e6b9b3 commit 49c4a2f

27 files changed

+437
-27
lines changed

Diff for: Base/Dockerfile

+14-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ARG OPENTELEMETRY_VERSION=1.44.1
1111
ARG GRPC_VERSION=1.68.1
1212
ARG NETTY_VERSION=4.1.115.Final
1313
ARG CS_VERSION=2.1.18
14+
ARG POSTGRESQL_VERSION=42.7.4
15+
ARG MVN_SELENIUM_VERSION=4.27.0
1416

1517
#Arguments to define the user running Selenium
1618
ARG SEL_USER=seluser
@@ -118,8 +120,16 @@ RUN --mount=type=secret,id=SEL_PASSWD \
118120
&& if [ -f "/tmp/cs" ]; then \
119121
java -jar /tmp/cs fetch --classpath --cache /external_jars \
120122
io.opentelemetry:opentelemetry-exporter-otlp:${OPENTELEMETRY_VERSION} \
121-
io.grpc:grpc-netty:${GRPC_VERSION} io.netty:netty-codec-http:${NETTY_VERSION} > /external_jars/.classpath.txt \
122-
&& chmod 664 /external_jars/.classpath.txt ; \
123+
io.grpc:grpc-netty:${GRPC_VERSION} \
124+
io.netty:netty-codec-http:${NETTY_VERSION} \
125+
> /external_jars/.classpath.txt \
126+
&& chmod 664 /external_jars/.classpath.txt \
127+
&& java -jar /tmp/cs fetch --classpath --cache /external_jars \
128+
org.seleniumhq.selenium:selenium-session-map-jdbc:${MVN_SELENIUM_VERSION} \
129+
org.postgresql:postgresql:${POSTGRESQL_VERSION} \
130+
org.seleniumhq.selenium:selenium-session-map-redis:${MVN_SELENIUM_VERSION} \
131+
> /external_jars/.classpath_session_map.txt \
132+
&& chmod 664 /external_jars/.classpath_session_map.txt ; \
123133
fi \
124134
&& rm -fr /root/.cache/* \
125135
# (Note that .bashrc is only executed in interactive bash shells.)
@@ -165,6 +175,8 @@ ENV SE_BIND_HOST=false \
165175
SE_SUPERVISORD_CHILD_LOG_DIR="/tmp" \
166176
SE_SUPERVISORD_LOG_FILE="/tmp/supervisord.log" \
167177
SE_SUPERVISORD_PID_FILE="/tmp/supervisord.pid" \
178+
SE_SUPERVISORD_AUTO_RESTART=true \
179+
SE_SUPERVISORD_START_RETRIES=5 \
168180
SE_LOG_TIMESTAMP_FORMAT="%Y-%m-%d %H:%M:%S,%3N" \
169181
SE_LOG_LEVEL="INFO" \
170182
SE_HTTP_LOGS=false \

Diff for: Distributor/selenium-grid-distributor.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-distributor.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Diff for: EventBus/selenium-grid-eventbus.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-eventbus.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Diff for: Hub/selenium-grid-hub.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-hub.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ chart_test_autoscaling_disabled:
917917
./tests/charts/make/chart_test.sh NoAutoscaling
918918

919919
chart_test_autoscaling_deployment_https:
920-
PLATFORMS=$(PLATFORMS) CHART_FULL_DISTRIBUTED_MODE=true CHART_ENABLE_BASIC_AUTH=true \
920+
PLATFORMS=$(PLATFORMS) CHART_FULL_DISTRIBUTED_MODE=true CHART_ENABLE_BASIC_AUTH=true TEST_EXTERNAL_DATASTORE=postgresql \
921921
SECURE_INGRESS_ONLY_DEFAULT=true INGRESS_DISABLE_USE_HTTP2=true SELENIUM_GRID_PROTOCOL=https CHART_ENABLE_INGRESS_HOSTNAME=true SELENIUM_GRID_PORT=443 \
922922
SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=0 MAX_SESSIONS_FIREFOX=1 MAX_SESSIONS_EDGE=1 MAX_SESSIONS_CHROME=1 TEST_NAME_OVERRIDE=true \
923923
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) BASE_VERSION=$(BASE_VERSION) \
@@ -955,7 +955,7 @@ chart_test_autoscaling_job:
955955
./tests/charts/make/chart_test.sh JobAutoscaling
956956

957957
chart_test_autoscaling_playwright_connect_grid:
958-
PLATFORMS=$(PLATFORMS) CHART_ENABLE_TRACING=true CHART_ENABLE_BASIC_AUTH=true MATRIX_TESTS=CDPTests \
958+
PLATFORMS=$(PLATFORMS) CHART_FULL_DISTRIBUTED_MODE=true CHART_ENABLE_BASIC_AUTH=true TEST_EXTERNAL_DATASTORE=redis MATRIX_TESTS=CDPTests \
959959
BASIC_AUTH_USERNAME=docker-selenium BASIC_AUTH_PASSWORD=2NMI4jdBi6k7bENoeUfV25295VvzwAE9chM24a+2VL95uOHozo \
960960
SECURE_INGRESS_ONLY_DEFAULT=true SECURE_USE_EXTERNAL_CERT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -I | cut -d' ' -f1) SELENIUM_GRID_PORT=443 \
961961
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) KEDA_BASED_NAME=$(KEDA_BASED_NAME) KEDA_BASED_TAG=$(KEDA_BASED_TAG) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) BASE_VERSION=$(BASE_VERSION) \

Diff for: Router/selenium-grid-router.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-router.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Diff for: SessionQueue/selenium-grid-session-queue.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-session-queue.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Diff for: Sessions/Dockerfile

+12-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@ FROM ${NAMESPACE}/base:${VERSION}
44
ARG AUTHORS
55
LABEL authors=${AUTHORS}
66

7-
USER ${SEL_UID}
8-
97
#========================
108
# Selenium SessionMap Configuration
119
#========================
1210

13-
EXPOSE 5556
11+
USER root
1412

15-
COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-sessions.sh \
13+
COPY --chown="${SEL_UID}:${SEL_GID}" start-selenium-grid-sessions.sh generate_config \
1614
/opt/bin/
15+
RUN chmod +x /opt/bin/start-selenium-grid-sessions.sh /opt/bin/generate_config
1716

1817
COPY selenium-grid-sessions.conf /etc/supervisor/conf.d/
1918

20-
ENV SE_OTEL_SERVICE_NAME="selenium-session-map"
19+
USER ${SEL_UID}
20+
21+
EXPOSE 5556
22+
23+
ENV SE_OTEL_SERVICE_NAME="selenium-session-map" \
24+
# Path to the Configfile
25+
CONFIG_FILE=/opt/selenium/config.toml \
26+
GENERATE_CONFIG=true \
27+
SE_SESSIONS_MAP_EXTERNAL_DATASTORE=false

Diff for: Sessions/generate_config

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
if [[ -z "$CONFIG_FILE" ]]; then
4+
FILENAME="/opt/selenium/config.toml"
5+
else
6+
FILENAME="$CONFIG_FILE"
7+
fi
8+
9+
echo "[sessions]" >"$FILENAME"
10+
11+
if [ "${SE_SESSIONS_MAP_EXTERNAL_DATASTORE}" = "true" ]; then
12+
if [[ -n "${SE_SESSIONS_MAP_EXTERNAL_SCHEME}" ]]; then
13+
echo "scheme = \"${SE_SESSIONS_MAP_EXTERNAL_SCHEME}\"" >>"$FILENAME"
14+
fi
15+
16+
if [[ -n "${SE_SESSIONS_MAP_EXTERNAL_IMPLEMENTATION}" ]]; then
17+
echo "implementation = \"${SE_SESSIONS_MAP_EXTERNAL_IMPLEMENTATION}\"" >>"$FILENAME"
18+
fi
19+
20+
if [[ -n "${SE_SESSIONS_MAP_EXTERNAL_HOSTNAME}" ]]; then
21+
echo "hostname = \"${SE_SESSIONS_MAP_EXTERNAL_HOSTNAME}\"" >>"$FILENAME"
22+
fi
23+
24+
if [[ -n "${SE_SESSIONS_MAP_EXTERNAL_PORT}" ]]; then
25+
echo "port = \"${SE_SESSIONS_MAP_EXTERNAL_PORT}\"" >>"$FILENAME"
26+
fi
27+
28+
if [[ -n "${SE_SESSIONS_MAP_EXTERNAL_JDBC_URL}" ]]; then
29+
echo "jdbc-url = \"${SE_SESSIONS_MAP_EXTERNAL_JDBC_URL}\"" >>"$FILENAME"
30+
fi
31+
32+
if [[ -n "${SE_SESSIONS_MAP_EXTERNAL_JDBC_USER}" ]]; then
33+
echo "jdbc-user = \"${SE_SESSIONS_MAP_EXTERNAL_JDBC_USER}\"" >>"$FILENAME"
34+
fi
35+
36+
if [[ -n "${SE_SESSIONS_MAP_EXTERNAL_JDBC_PASSWORD}" ]]; then
37+
echo "jdbc-password = \"${SE_SESSIONS_MAP_EXTERNAL_JDBC_PASSWORD}\"" >>"$FILENAME"
38+
fi
39+
fi

Diff for: Sessions/init.sql

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE IF NOT EXISTS sessions_map(
2+
session_ids varchar(256),
3+
session_caps text,
4+
session_uri varchar(256),
5+
session_stereotype text,
6+
session_start varchar(256)
7+
);

Diff for: Sessions/selenium-grid-sessions.conf

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
priority=0
66
command=/opt/bin/start-selenium-grid-sessions.sh
77
autostart=true
8-
autorestart=false
8+
autorestart=%(ENV_SE_SUPERVISORD_AUTO_RESTART)s
99
startsecs=0
10-
startretries=0
10+
startretries=%(ENV_SE_SUPERVISORD_START_RETRIES)s
11+
stopsignal=TERM
1112

1213
;Logs (all Hub activity redirected to stdout so it can be seen through "docker logs"
1314
redirect_stderr=true

Diff for: Sessions/start-selenium-grid-sessions.sh

+23-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# set -e: exit asap if a command exits with a non-zero status
44
set -e
55

6-
echo "Starting Selenium Grid Sessions..."
7-
86
function append_se_opts() {
97
local option="${1}"
108
local value="${2:-""}"
@@ -98,12 +96,21 @@ if [ ! -z "$SE_REGISTRATION_SECRET" ]; then
9896
append_se_opts "--registration-secret" "${SE_REGISTRATION_SECRET}" "false"
9997
fi
10098

99+
if [ "$GENERATE_CONFIG" = true ]; then
100+
echo "Generating Selenium Config for Sessions"
101+
/opt/bin/generate_config
102+
fi
103+
104+
if [ ! -z "${CONFIG_FILE}" ]; then
105+
append_se_opts "--config" "${CONFIG_FILE}"
106+
fi
107+
101108
EXTRA_LIBS=""
102109

103110
if [ "$SE_ENABLE_TRACING" = "true" ]; then
104111
EXTERNAL_JARS=$(</external_jars/.classpath.txt)
105112
[ -n "$EXTRA_LIBS" ] && [ -n "${EXTERNAL_JARS}" ] && EXTRA_LIBS=${EXTRA_LIBS}:
106-
EXTRA_LIBS="--ext "${EXTRA_LIBS}${EXTERNAL_JARS}
113+
EXTRA_LIBS="${EXTRA_LIBS}${EXTERNAL_JARS}"
107114
echo "Tracing is enabled"
108115
echo "Classpath will be enriched with these external jars : " ${EXTRA_LIBS}
109116
if [ -n "$SE_OTEL_SERVICE_NAME" ]; then
@@ -128,6 +135,19 @@ else
128135
echo "Tracing is disabled"
129136
fi
130137

138+
if [ "${SE_SESSIONS_MAP_EXTERNAL_DATASTORE}" = "true" ]; then
139+
EXTERNAL_JARS=$(</external_jars/.classpath_session_map.txt)
140+
[ -n "$EXTRA_LIBS" ] && [ -n "${EXTERNAL_JARS}" ] && EXTRA_LIBS=${EXTRA_LIBS}:
141+
EXTRA_LIBS="${EXTRA_LIBS}${EXTERNAL_JARS}"
142+
fi
143+
144+
if [ -n "${EXTRA_LIBS}" ]; then
145+
EXTRA_LIBS="--ext ${EXTRA_LIBS}"
146+
fi
147+
148+
cat "$CONFIG_FILE"
149+
echo "Starting Selenium Grid Sessions..."
150+
131151
java ${JAVA_OPTS:-$SE_JAVA_OPTS} \
132152
-jar /opt/selenium/selenium-server.jar \
133153
${EXTRA_LIBS} sessions \

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

+14
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
1818

1919
| Repository | Name | Version |
2020
|------------|------|---------|
21+
| https://charts.bitnami.com/bitnami | postgresql | 16.2.3 |
22+
| https://charts.bitnami.com/bitnami | redis | 20.4.0 |
2123
| https://jaegertracing.github.io/helm-charts | jaeger | 3.3.3 |
2224
| https://kedacore.github.io/charts | keda | 2.16.0 |
2325
| https://kubernetes.github.io/ingress-nginx | ingress-nginx | 4.11.3 |
@@ -109,6 +111,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
109111
| ingress.tls | list | `[]` | TLS backend configuration for ingress resource |
110112
| busConfigMap.nameOverride | string | `nil` | Override the name of the bus configMap |
111113
| busConfigMap.annotations | object | `{}` | Custom annotations for configmap |
114+
| sessionMapConfigMap.nameOverride | string | `nil` | Override the name of the session map configMap |
115+
| sessionMapConfigMap.annotations | object | `{}` | Custom annotations for configmap |
112116
| distributorConfigMap.nameOverride | string | `nil` | Override the name of the distributor configMap |
113117
| distributorConfigMap.defaultMode | int | `493` | Default mode for ConfigMap is mounted as file |
114118
| distributorConfigMap.extraScriptsImportFrom | string | `"configs/distributor/**"` | Directory where the extra scripts are imported to ConfigMap by default (if given a relative path, it should be in chart's directory) |
@@ -244,6 +248,10 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
244248
| components.sessionMap.tolerations | list | `[]` | Tolerations for Session Map pods |
245249
| components.sessionMap.nodeSelector | object | `{}` | Node selector for Session Map pods |
246250
| components.sessionMap.priorityClassName | string | `""` | Priority class name for Session Map pods |
251+
| components.sessionMap.externalDatastore.enabled | bool | `false` | Enable external datastore for Session Map |
252+
| components.sessionMap.externalDatastore.backend | string | `"postgresql"` | Backend for external datastore (supported: postgresql, redis). Details for each backend are described below config key |
253+
| components.sessionMap.externalDatastore.postgresql | object | `{"implementation":"org.openqa.selenium.grid.sessionmap.jdbc.JdbcBackedSessionMap","jdbcPassword":"seluser","jdbcUrl":"jdbc:postgresql://{{ $.Release.Name }}-postgresql:5432/selenium_sessions","jdbcUser":"seluser"}` | Configure database backed Session Map (https://www.selenium.dev/documentation/grid/advanced_features/external_datastore/#database-backed-session-map) |
254+
| components.sessionMap.externalDatastore.redis | object | `{"hostname":"{{ $.Release.Name }}-redis-master","implementation":"org.openqa.selenium.grid.sessionmap.redis.RedisBackedSessionMap","port":"6379","scheme":"redis"}` | Configure Redis backed Session Map (https://www.selenium.dev/documentation/grid/advanced_features/external_datastore/#redis-backed-session-map) |
247255
| components.sessionQueue.imageRegistry | string | `nil` | Registry to pull the image (this overwrites global.seleniumGrid.imageRegistry parameter) |
248256
| components.sessionQueue.imageName | string | `"session-queue"` | Session Queue image name |
249257
| components.sessionQueue.imageTag | string | `nil` | Session Queue image tag (this overwrites global.seleniumGrid.imageTag parameter) |
@@ -590,4 +598,10 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
590598
| ingress-nginx | object | `{"controller":{"admissionWebhooks":{"enabled":false}}}` | Configuration for dependency chart ingress-nginx |
591599
| kube-prometheus-stack | object | `{"cleanPrometheusOperatorObjectNames":true,"prometheus":{"prometheusSpec":{"additionalConfig":{"additionalScrapeConfigs":{"key":"{{ template \"seleniumGrid.monitoring.scrape.key\" $ }}","name":"{{ template \"seleniumGrid.monitoring.exporter.fullname\" $ }}"}}}}}` | Configuration for dependency chart kube-prometheus-stack |
592600
| jaeger | object | `{"agent":{"enabled":false},"allInOne":{"enabled":true,"extraEnv":[{"name":"QUERY_BASE_PATH","value":"/jaeger"}]},"collector":{"enabled":false},"provisionDataStore":{"cassandra":false},"query":{"enabled":false},"storage":{"type":"badger"}}` | Configuration for dependency chart jaeger |
601+
| postgresql.enabled | bool | `false` | Enable to install PostgreSQL along with Grid |
602+
| postgresql.auth | object | `{"database":"selenium_sessions","password":"seluser","username":"seluser"}` | Authentication should be aligned with config in session map |
603+
| postgresql.primary.initdb.scripts | object | `{"init.sql":"CREATE TABLE IF NOT EXISTS sessions_map(\n session_ids varchar(256),\n session_caps text,\n session_uri varchar(256),\n session_stereotype text,\n session_start varchar(256)\n);\n"}` | Initdb scripts for PostgreSQL to create sessions_map table |
604+
| redis.enabled | bool | `false` | Enable to install Redis along with Grid |
605+
| redis.architecture | string | `"standalone"` | Setup architecture |
606+
| redis.auth.enabled | bool | `false` | Disable authentication due to implementation still not supporting it |
593607

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

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ dependencies:
2222
version: 66.3.0
2323
name: kube-prometheus-stack
2424
condition: monitoring.enabled, prometheus-stack.enabled
25+
- repository: https://charts.bitnami.com/bitnami
26+
version: 16.2.3
27+
name: postgresql
28+
condition: postgresql.enabled
29+
- repository: https://charts.bitnami.com/bitnami
30+
version: 20.4.0
31+
name: redis
32+
condition: redis.enabled
2533
maintainers:
2634
- name: SeleniumHQ
2735

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

+33
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes.
4040
* [TLS termination in the ingress controller, HTTP/2, and related troubleshooting](#tls-termination-in-the-ingress-controller-http2-and-related-troubleshooting)
4141
* [Node Registration](#node-registration)
4242
* [Configuration of tracing observability](#configuration-of-tracing-observability)
43+
* [Configuration of Session Map using External Datastore](#configuration-of-session-map-using-external-datastore)
4344
* [Configuration of Selenium Grid chart](#configuration-of-selenium-grid-chart)
4445
* [Configuration of KEDA](#configuration-of-keda)
4546
* [Configuration of Ingress NGINX Controller](#configuration-of-ingress-nginx-controller)
@@ -873,6 +874,38 @@ tracing:
873874
By default, the exporter is set to `otlp`. It is wide compatibility with many tracing backends.
874875
Read more: [vendors](https://opentelemetry.io/ecosystem/vendors/) native support OpenTelemetry and guidelines on [integration](https://opentelemetry.io/ecosystem/integrations/)
875876

877+
### Configuration of Session Map using External Datastore
878+
879+
Feature [documentation](https://www.selenium.dev/documentation/grid/advanced_features/external_datastore/). It requires the Grid deployed in distributed mode. The feature is disabled by default.
880+
881+
To enable it with Database backed Session Map, also install PostgreSQL service in the same namespace as Selenium Grid. You can set the following values:
882+
883+
```yaml
884+
isolateComponents: true
885+
components:
886+
sessionMap:
887+
externalDatastore:
888+
enabled: true
889+
backend: postgresql
890+
891+
postgresql:
892+
enabled: true
893+
```
894+
895+
To enable it with Redis backed Session Map, also install Redis service in the same namespace as Selenium Grid. You can set the following values:
896+
897+
```yaml
898+
isolateComponents: true
899+
components:
900+
sessionMap:
901+
externalDatastore:
902+
enabled: true
903+
backend: redis
904+
905+
redis:
906+
enabled: true
907+
```
908+
876909
### Configuration of Selenium Grid chart
877910

878911
Check out list [configuration](https://github.com/SeleniumHQ/docker-selenium/blob/trunk/charts/selenium-grid/CONFIGURATION.md) parameter of chart and their default values for more details.

Diff for: charts/selenium-grid/templates/_nameHelpers.tpl

+7
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ Event bus ConfigMap fullname
9191
{{- tpl (default (include "seleniumGrid.component.name" (list "selenium-event-bus-config" $)) .Values.busConfigMap.nameOverride) $ | trunc 63 | trimSuffix "-" -}}
9292
{{- end -}}
9393

94+
{{/*
95+
Session Map ConfigMap fullname
96+
*/}}
97+
{{- define "seleniumGrid.sessionMap.configmap.fullname" -}}
98+
{{- tpl (default (include "seleniumGrid.component.name" (list "selenium-session-map-config" $)) .Values.sessionMapConfigMap.nameOverride) $ | trunc 63 | trimSuffix "-" -}}
99+
{{- end -}}
100+
94101
{{/*
95102
Router fullname
96103
*/}}

0 commit comments

Comments
 (0)