Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit e6ac29f

Browse files
committed
test(chart): CI tests run against different Kubernetes version
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 74fdf72 commit e6ac29f

File tree

3 files changed

+40
-29
lines changed

3 files changed

+40
-29
lines changed

.github/workflows/helm-chart-test.yml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ on:
1515
description: 'Test parameter for different request timeout'
1616
required: false
1717
default: '370'
18-
cluster:
19-
description: 'Cluster type to test (kind, minikube)'
20-
required: false
2118
schedule:
2219
- cron: '0 0 * * *'
2320

@@ -26,18 +23,31 @@ permissions:
2623

2724
jobs:
2825
build-and-test:
29-
name: Build & test
26+
name: Test K8s
3027
runs-on: ubuntu-latest
3128
strategy:
3229
fail-fast: false
3330
matrix:
34-
test-strategy:
35-
- job
36-
- job_https
37-
- deployment
38-
- deployment_https
31+
include:
32+
- k8s-version: 'v1.25.16'
33+
test-strategy: job
34+
cluster: 'kind'
35+
- k8s-version: 'v1.26.14'
36+
test-strategy: deployment
37+
cluster: 'kind'
38+
- k8s-version: 'v1.27.11'
39+
test-strategy: job_https
40+
cluster: 'kind'
41+
- k8s-version: 'v1.28.7'
42+
test-strategy: job
43+
cluster: 'minikube'
44+
- k8s-version: 'v1.29.2'
45+
test-strategy: deployment_https
46+
cluster: 'minikube'
3947
env:
40-
CLUSTER: ${{ github.event.inputs.cluster || 'minikube' }}
48+
CLUSTER: ${{ matrix.cluster }}
49+
KUBERNETES_VERSION: ${{ matrix.k8s-version }}
50+
ARTIFACT_NAME: ${{ matrix.k8s-version }}-${{ matrix.test-strategy }}
4151
steps:
4252
- uses: actions/checkout@main
4353
- name: Output Docker info
@@ -74,16 +84,16 @@ jobs:
7484
BUILD_DATE=${BUILD_DATE} make chart_build
7585
echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV
7686
echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV
77-
- name: Test chart template
78-
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test_template
87+
- name: Build Docker images
88+
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
7989
- name: Setup Kubernetes cluster
8090
uses: nick-invision/retry@master
8191
with:
8292
timeout_minutes: 10
8393
max_attempts: 3
84-
command: CLUSTER=${CLUSTER} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
85-
- name: Build Docker images
86-
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
94+
command: CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
95+
- name: Test chart template
96+
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test_template
8797
- name: Test set custom CA certificate
8898
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make test_custom_ca_cert
8999
- name: Set test parameters
@@ -92,7 +102,7 @@ jobs:
92102
echo "AUTOSCALING_POLL_INTERVAL=${AUTOSCALING_POLL_INTERVAL}" >> $GITHUB_ENV
93103
env:
94104
AUTOSCALING_POLL_INTERVAL: ${{ github.event.inputs.request-timeout || '370' }}
95-
- name: Test Selenium Grid on Kubernetes (Autoscaling ${{ matrix.test-strategy }})
105+
- name: Test Selenium Grid on Kubernetes ${{ matrix.k8s-version }} with Autoscaling ${{ matrix.test-strategy }}
96106
uses: nick-invision/retry@master
97107
with:
98108
timeout_minutes: 30
@@ -106,12 +116,12 @@ jobs:
106116
if: always()
107117
uses: actions/upload-artifact@main
108118
with:
109-
name: ${{ matrix.test-strategy }}_${{ env.CHART_FILE_NAME }}
119+
name: ${{ env.ARTIFACT_NAME }}_${{ env.CHART_FILE_NAME }}
110120
path: ${{ env.CHART_PACKAGE_PATH }}
111121
- name: Upload chart test artifacts
112122
if: always()
113123
uses: actions/upload-artifact@main
114124
with:
115-
name: ${{ matrix.test-strategy }}-artifacts
125+
name: ${{ env.ARTIFACT_NAME }}-artifacts
116126
path: ./tests/tests/
117127
if-no-files-found: ignore

charts/selenium-grid/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ This chart enables the creation of a Selenium Grid Server in Kubernetes.
2929
* [Configuration of Secure Communication (HTTPS)](#configuration-of-secure-communication-https)
3030
* [Secure Communication](#secure-communication)
3131
* [Node Registration](#node-registration)
32+
* [Configuration of tracing observability](#configuration-of-tracing-observability)
3233
* [Configuration of Selenium Grid chart](#configuration-of-selenium-grid-chart)
3334
* [Configuration of KEDA](#configuration-of-keda)
3435
* [Configuration of Ingress NGINX Controller](#configuration-of-ingress-nginx-controller)
36+
* [Configuration of Jaeger](#configuration-of-jaeger)
3537
* [Configuration for Selenium-Hub](#configuration-for-selenium-hub)
3638
* [Configuration for isolated components](#configuration-for-isolated-components)
3739
<!-- TOC -->
@@ -204,7 +206,7 @@ helm uninstall selenium-grid
204206

205207
By default, ingress is enabled without annotations set. If NGINX ingress controller is used, you need to set few annotations to override the default timeout values to avoid 504 errors (see [#1808](https://github.com/SeleniumHQ/docker-selenium/issues/1808)). Since in Selenium Grid the default of `SE_NODE_SESSION_TIMEOUT` and `SE_SESSION_REQUEST_TIMEOUT` is `300` seconds.
206208

207-
In order to make user experience better, there are few annotations will be set by default if NGINX ingress controller is used. Mostly relates to timeouts and buffer sizes.
209+
To make the user experience better, there are few annotations will be set by default if NGINX ingress controller is used. Mostly relates to timeouts and buffer sizes.
208210

209211
If you are not using NGINX ingress controller, you can disable these default annotations by setting `ingress.nginx` to `nil` (aka null) via Helm CLI `--set ingress.nginx=null`) or via an override-values.yaml as below:
210212

@@ -248,7 +250,7 @@ nginx.ingress.kubernetes.io/client-body-buffer-size
248250
nginx.ingress.kubernetes.io/proxy-buffers-number
249251
```
250252

251-
You can generate a dummy self-signed certificate specify for your `hostname`, assign it to spec `ingress.tls` and NGINX ingress controller default certificate (if it is enabled inline). For example:
253+
You can generate a test double self-signed certificate specify for your `hostname`, assign it to spec `ingress.tls` and NGINX ingress controller default certificate (if it is enabled inline). For example:
252254

253255
```yaml
254256
tls:
@@ -338,7 +340,7 @@ chromeNode:
338340
targetPort: 7900
339341
# NodePort will be assigned randomly if not set
340342
edgeNode:
341-
ports: # You also can give object following manifest of container ports
343+
ports: # You also can give objects following manifest of container ports
342344
- containerPort: 5900
343345
name: vnc
344346
protocol: TCP
@@ -366,7 +368,7 @@ Other settings of probe support to override under `.startupProbe` `.readinessPro
366368
successThreshold
367369
```
368370

369-
You can easily configure the probes (as Kubernetes [supports](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)) to override the default settings. For example:
371+
You can configure the probes (as Kubernetes [supports](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)) to override the default settings. For example:
370372

371373
```yaml
372374
edgeNode:
@@ -429,7 +431,7 @@ Files in `.extraScripts` will be mounted to the container with the same name wit
429431

430432
#### Video recorder
431433

432-
The video recorder is a sidecar that is deployed with the browser nodes. It is responsible for recording the video of the browser session. The video recorder is disabled by default. To enable it, you need to set the following values:
434+
The video recorder is a sidecar deployed with the browser nodes. It is responsible for recording the video of the browser session. The video recorder is disabled by default. To enable it, you need to set the following values:
433435

434436
```yaml
435437
videoRecorder:
@@ -445,7 +447,6 @@ from selenium import webdriver
445447
options = ChromeOptions()
446448
options.set_capability('se:recordVideo', False)
447449
driver = webdriver.Remote(options=options, command_executor="http://localhost:4444")
448-
)
449450
```
450451

451452
In Node will perform query GraphQL in Hub based on Node SessionId and extract the value of `se:recordVideo` in capabilities before deciding to start video recording process or not. You can customize by reading on section [Configuration extra scripts mount to container](#configuration-extra-scripts-mount-to-container).
@@ -509,9 +510,9 @@ videoRecorder:
509510
RCLONE_CONFIG_MYS3_ENDPOINT: "https://storage.googleapis.com"
510511
```
511512

512-
Those 2 ways are equivalent. You can choose one of them or combine them together. When both config file and ENV vars are set, value in `upload.conf` will take precedence.
513+
Those two ways are equivalent. You can choose one of them or combine them. When both config file and ENV vars are set, value in `upload.conf` will take precedence.
513514

514-
Beside the configuration, the script for entry point of uploader container also needed. You can override the script via `--set-file uploaderConfigMap.extraScripts.upload\.sh=/path/to/your_script.sh` or set via YAML values. For example:
515+
Besides the configuration, the script for entry point of uploader container also needed. You can override the script via `--set-file uploaderConfigMap.extraScripts.upload\.sh=/path/to/your_script.sh` or set via YAML values. For example:
515516

516517
```yaml
517518
uploaderConfigMap:
@@ -555,7 +556,7 @@ Selenium Grid supports secure communication between components. Refer to the [in
555556

556557
In the chart, there is directory [certs](./certs) contains the default certificate, private key (as PKCS8 format), and Java Keystore (JKS) to teach Java about secure connection (since we are using a non-standard CA) for your trial, local testing purpose. You can generate your own self-signed certificate put them in that default directory by using script [cert.sh](./certs/cert.sh) with adjust needed information. The certificate, private key, truststore are mounted to the components via `Secret`.
557558

558-
There are multiple ways to configure your certificate, private key, truststore to the components. You can choose one of them or combine them together.
559+
There are multiple ways to configure your certificate, private key, truststore to the components. You can choose one of them or combine them.
559560

560561
- Use the default directory [certs](./certs). Rename your own files to be same as the default files and replace them. Give `--set tls.enabled=true` to enable secure communication.
561562

@@ -608,7 +609,7 @@ ingress-nginx:
608609

609610
#### Node Registration
610611

611-
In order to enable secure in the node registration to make sure that the node is one you control and not a rouge node, you can enable and provide a registration secret string to Distributor, Router and
612+
To enable secure in the node registration to make sure that the node is one you control and not a rouge node, you can enable and provide a registration secret string to Distributor, Router and
612613
Node servers in config `tls.registrationSecret`. For example:
613614

614615
```yaml

tests/charts/make/chart_cluster_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fi
5050

5151
if [ "${CLUSTER}" = "kind" ]; then
5252
echo "Start Kind cluster"
53-
kind create cluster --wait ${WAIT_TIMEOUT} --name ${CLUSTER_NAME} --config tests/charts/config/kind-cluster.yaml
53+
kind create cluster --image kindest/node:${KUBERNETES_VERSION} --wait ${WAIT_TIMEOUT} --name ${CLUSTER_NAME} --config tests/charts/config/kind-cluster.yaml
5454
elif [ "${CLUSTER}" = "minikube" ]; then
5555
echo "Start Minikube cluster"
5656
sudo chmod 777 /tmp

0 commit comments

Comments
 (0)