Skip to content

Commit 91233c4

Browse files
authored
chart(breaking change): update config key to enable ingress (#2349)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 22b2f55 commit 91233c4

17 files changed

+111
-37
lines changed

.github/workflows/deploy.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
required: false
2424
type: boolean
2525
default: false
26+
skip-build-push-image:
27+
description: 'Skip the build & push images'
28+
required: false
29+
type: boolean
30+
default: false
2631
push:
2732
branches:
2833
- trunk
@@ -99,13 +104,6 @@ jobs:
99104
run: ./update_tag_in_docs_and_files.sh ${LATEST_TAG} ${NEXT_TAG}
100105
- name: Update chart CHANGELOG
101106
run: ./generate_chart_changelog.sh
102-
- name: Build images
103-
uses: nick-invision/retry@master
104-
with:
105-
timeout_minutes: 90
106-
max_attempts: 3
107-
retry_wait_seconds: 60
108-
command: PLATFORMS="${PLATFORMS}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
109107
- name: Build Helm chart
110108
uses: nick-invision/retry@master
111109
with:
@@ -116,6 +114,18 @@ jobs:
116114
SET_VERSION=false make chart_build
117115
echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV
118116
echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV
117+
- name: Render chart templates
118+
run: |
119+
make chart_render_template
120+
echo "PUBLISH_YAML_MANIFESTS=$(find ./tests/tests -name "k8s_*.yaml" | tr '\n' ',')" >> $GITHUB_ENV
121+
- name: Build images
122+
if: github.event.inputs.skip-build-push-image != 'true'
123+
uses: nick-invision/retry@master
124+
with:
125+
timeout_minutes: 90
126+
max_attempts: 3
127+
retry_wait_seconds: 60
128+
command: PLATFORMS="${PLATFORMS}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
119129
- name: Login Docker Hub
120130
run: |
121131
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
@@ -124,22 +134,26 @@ jobs:
124134
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
125135
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
126136
- name: Deploy new images
137+
if: github.event.inputs.skip-build-push-image != 'true'
127138
uses: nick-invision/retry@master
128139
with:
129140
timeout_minutes: 20
130141
max_attempts: 3
131142
retry_wait_seconds: 120
132143
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release
133144
- name: Tag images as latest
145+
if: github.event.inputs.skip-build-push-image != 'true'
134146
run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_latest
135147
- name: Deploy latest tag
148+
if: github.event.inputs.skip-build-push-image != 'true'
136149
uses: nick-invision/retry@master
137150
with:
138151
timeout_minutes: 20
139152
max_attempts: 3
140153
retry_wait_seconds: 120
141154
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_latest
142155
- name: Tag browser images
156+
if: github.event.inputs.skip-build-push-image != 'true'
143157
uses: nick-invision/retry@master
144158
with:
145159
timeout_minutes: 20
@@ -180,7 +194,7 @@ jobs:
180194
path: ./release_notes.md
181195
if-no-files-found: ignore
182196
- name: Create Release
183-
if: env.LATEST_TAG != env.NEXT_TAG && github.event.inputs.skip-commit != 'true'
197+
if: env.LATEST_TAG != env.NEXT_TAG
184198
id: create_release
185199
uses: softprops/action-gh-release@master
186200
with:
@@ -192,3 +206,4 @@ jobs:
192206
prerelease: ${{ env.PRERELEASE }}
193207
draft: false
194208
append_body: false
209+
files: ${{ env.PUBLISH_YAML_MANIFESTS }}

.github/workflows/docker-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ jobs:
6363
test-video: false
6464
build-all: false
6565
steps:
66+
- name: Free Disk Space (Ubuntu)
67+
uses: jlumbroso/free-disk-space@main
68+
with:
69+
tool-cache: false
70+
large-packages: false
6671
- name: Checkout code
6772
uses: actions/checkout@main
6873
- name: Set up containerd image store feature

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ jobs:
7878
TEST_EXISTING_KEDA: ${{ matrix.test-existing-keda }}
7979
TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }}
8080
steps:
81+
- name: Free Disk Space (Ubuntu)
82+
uses: jlumbroso/free-disk-space@main
83+
with:
84+
tool-cache: false
85+
large-packages: false
8186
- name: Checkout code
8287
uses: actions/checkout@main
8388
- name: Set up containerd image store feature

.github/workflows/rerun-failed.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
type: boolean
1414
default: true
1515

16+
permissions: write-all
17+
1618
env:
1719
GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1820
RUN_ID: ${{ github.event.inputs.runId }}

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,42 +777,51 @@ test_video_integrity:
777777
chart_test_template:
778778
./tests/charts/bootstrap.sh
779779

780+
chart_render_template:
781+
RENDER_HELM_TEMPLATE_ONLY=true make chart_test_autoscaling_disabled chart_test_autoscaling_deployment_https chart_test_autoscaling_deployment chart_test_autoscaling_job_https chart_test_autoscaling_job_hostname chart_test_autoscaling_job
782+
780783
chart_test_autoscaling_disabled:
781784
PLATFORMS=$(PLATFORMS) TEST_CHROMIUM=true RELEASE_NAME=selenium SELENIUM_GRID_AUTOSCALING=false TEST_DELAY_AFTER_TEST=0 CHART_ENABLE_TRACING=true \
782785
SECURE_INGRESS_ONLY_GENERATE=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=443 \
783786
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
787+
TEMPLATE_OUTPUT_FILENAME="k8s_nodeChromium_enableTracing_secureIngress_generateCerts_ingressPublicIP_subPath.yaml" \
784788
./tests/charts/make/chart_test.sh NoAutoscaling
785789

786790
chart_test_autoscaling_deployment_https:
787791
PLATFORMS=$(PLATFORMS) CHART_FULL_DISTRIBUTED_MODE=true CHART_ENABLE_BASIC_AUTH=true \
788792
SECURE_INGRESS_ONLY_DEFAULT=true INGRESS_DISABLE_USE_HTTP2=true SELENIUM_GRID_PROTOCOL=https CHART_ENABLE_INGRESS_HOSTNAME=true SELENIUM_GRID_PORT=443 \
789793
SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=1 \
790794
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
795+
TEMPLATE_OUTPUT_FILENAME="k8s_fullDistributed_basicAuth_secureIngress_defaultCerts_ingressHostName_disableHttp2_autoScaling_scaledObject_subPath.yaml" \
791796
./tests/charts/make/chart_test.sh DeploymentAutoscaling
792797

793798
chart_test_autoscaling_deployment:
794799
PLATFORMS=$(PLATFORMS) RELEASE_NAME=selenium CHART_ENABLE_TRACING=true \
795800
SECURE_CONNECTION_SERVER=true SECURE_USE_EXTERNAL_CERT=true SERVICE_TYPE_NODEPORT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=31444 \
796801
SELENIUM_GRID_AUTOSCALING_MIN_REPLICA=1 \
797802
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
803+
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_enableTracing_secureServer_externalCerts_nodePort_autoScaling_scaledObject_subPath.yaml" \
798804
./tests/charts/make/chart_test.sh DeploymentAutoscaling
799805

800806
chart_test_autoscaling_job_https:
801807
PLATFORMS=$(PLATFORMS) RELEASE_NAME=selenium CHART_ENABLE_BASIC_AUTH=true \
802808
SECURE_CONNECTION_SERVER=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_PORT=443 SUB_PATH=/ \
803809
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
810+
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_basicAuth_secureServer_autoScaling_scaledJob.yaml" \
804811
./tests/charts/make/chart_test.sh JobAutoscaling
805812

806813
chart_test_autoscaling_job_hostname:
807814
PLATFORMS=$(PLATFORMS) CHART_ENABLE_TRACING=true CHART_ENABLE_BASIC_AUTH=true \
808815
SECURE_INGRESS_ONLY_DEFAULT=true SECURE_USE_EXTERNAL_CERT=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=$$(hostname -i) SELENIUM_GRID_PORT=443 \
809816
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
817+
TEMPLATE_OUTPUT_FILENAME="k8s_enableTracing_basicAuth_secureIngress_externalCerts_ingressPublicIP_autoScaling_scaledJob_subPath.yaml" \
810818
./tests/charts/make/chart_test.sh JobAutoscaling
811819

812820
chart_test_autoscaling_job:
813821
PLATFORMS=$(PLATFORMS) TEST_CHROMIUM=true RELEASE_NAME=selenium CHART_ENABLE_TRACING=true CHART_FULL_DISTRIBUTED_MODE=true \
814822
SECURE_INGRESS_ONLY_CONFIG_INLINE=true SECURE_USE_EXTERNAL_CERT=true CHART_ENABLE_INGRESS_HOSTNAME=true SELENIUM_GRID_PROTOCOL=https SELENIUM_GRID_HOST=selenium-grid.prod SUB_PATH=/ SELENIUM_GRID_PORT=443 \
815823
VERSION=$(TAG_VERSION) VIDEO_TAG=$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) NAMESPACE=$(NAMESPACE) BINDING_VERSION=$(BINDING_VERSION) \
824+
TEMPLATE_OUTPUT_FILENAME="k8s_prefixSelenium_nodeChromium_enableTracing_fullDistributed_secureIngress_externalCerts_ingressHostName_ingressTLSInline_autoScaling_scaledJob_.yaml" \
816825
./tests/charts/make/chart_test.sh JobAutoscaling
817826

818827
chart_test_language_bindings:

charts/selenium-grid/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ dependencies:
99
- repository: https://kedacore.github.io/charts
1010
version: 2.15.0
1111
name: keda
12-
condition: autoscaling.enabled
12+
condition: autoscaling.enabled, keda.enabled
1313
- repository: https://kubernetes.github.io/ingress-nginx
1414
version: 4.11.1
1515
name: ingress-nginx
16-
condition: ingress-nginx.enabled
16+
condition: ingress.enabled, ingress-nginx.enabled
1717
- repository: https://jaegertracing.github.io/helm-charts
1818
version: 3.1.2
1919
name: jaeger
20-
condition: tracing.enabled
20+
condition: tracing.enabled, jaeger.enabled
2121
- repository: https://prometheus-community.github.io/helm-charts
2222
version: 61.8.0
2323
name: kube-prometheus-stack
24-
condition: monitoring.enabled
2524
alias: prometheus-stack
25+
condition: monitoring.enabled, prometheus-stack.enabled
2626
maintainers:
2727
- name: SeleniumHQ
2828

charts/selenium-grid/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ Below is an example of Grid UI accessible via NodePort with secure connection, a
719719

720720
```bash
721721
helm upgrade -i $RELEASENAME -n $NAMESPACE docker-selenium/selenium-grid \
722-
--set ingress.enabled=false \
722+
--set ingress.enableWithExistingController=false \
723723
--set isolateComponents=true \
724724
--set components.router.serviceType=NodePort \
725725
--set tls.enabled=true \
@@ -776,8 +776,7 @@ helm upgrade -i $RELEASENAME -n $NAMESPACE docker-selenium/selenium-grid \
776776
--set ingress.enabled=true \
777777
--set ingress.hostname="selenium-grid.prod.domain.com" \
778778
--set tls.ingress.enabled=true \
779-
--set tls.nameOverride=my-external-tls-secret \
780-
--set ingress-nginx.enabled=true
779+
--set tls.nameOverride=my-external-tls-secret
781780
```
782781

783782
Grid UI can be accessed via HTTPS address `https://selenium-grid.prod.domain.com`.
@@ -805,7 +804,6 @@ helm upgrade -i $RELEASENAME -n $NAMESPACE docker-selenium/selenium-grid \
805804
--set global.K8S_PUBLIC_IP=$(hostname -i) \
806805
--set tls.ingress.enabled=true \
807806
--set tls.nameOverride=my-external-tls-secret \
808-
--set ingress-nginx.enabled=true \
809807
--set ingress-nginx.controller.extraArgs.default-ssl-certificate=$NAMESPACE/my-external-tls-secret
810808
```
811809

@@ -877,6 +875,9 @@ tracing:
877875
exporterEndpoint: 'http://jaeger.domain.com:4317'
878876
```
879877

878+
By default, the exporter is set to `otlp`. It is wide compatibility with many tracing backends.
879+
Read more: [vendors](https://opentelemetry.io/ecosystem/vendors/) native support OpenTelemetry and guidelines on [integration](https://opentelemetry.io/ecosystem/integrations/)
880+
880881
### Configuration of Selenium Grid chart
881882
This table contains the configuration parameters of the chart and their default values:
882883

@@ -893,7 +894,8 @@ This table contains the configuration parameters of the chart and their default
893894
| `busConfigMap.annotations` | `{}` | Custom annotations for configmap |
894895
| `nodeConfigMap.nameOverride` | `` | Name of the configmap that contains common environment variables for browser nodes |
895896
| `nodeConfigMap.annotations` | `{}` | Custom annotations for configmap |
896-
| `ingress.enabled` | `true` | Enable or disable ingress resource |
897+
| `ingress.enabled` | `false` | Enable ingress. Implies installing Ingress NGINX Controller |
898+
| `ingress.enableWithExistingController` | `true` | Enable ingress without automatically installing Ingress NGINX Controller |
897899
| `ingress.className` | `""` | Name of ingress class to select which controller will implement ingress resource |
898900
| `ingress.annotations` | `{}` | Custom annotations for ingress resource |
899901
| `ingress.nginx.proxyTimeout` | `3600` | Value is used to set for NGINX ingress annotations related to proxy timeout |

charts/selenium-grid/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Selenium Grid Server deployed successfully.
66
{{- $port := ternary .Values.components.router.port .Values.hub.port .Values.isolateComponents }}
77
{{- $localUrl := ternary "http://localhost:PORT" "http://localhost:PORT/wd/hub" .Values.isolateComponents }}
88

9-
{{- if .Values.ingress.enabled }}
9+
{{- if eq (include "seleniumGrid.ingress.enabled" $) "true" }}
1010
{{- if .Values.ingress.hostname }}
1111
1. Ingress is enabled, and it exposes the Grid Hub or Grid Router with the hostname you supplied.
1212
To access Selenium from outside of Kubernetes, simply open {{ include "seleniumGrid.url" .}}.

charts/selenium-grid/templates/_helpers.tpl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,20 @@ Is autoscaling using KEDA enabled
160160
{{- or .Values.autoscaling.enabled .Values.autoscaling.enableWithExistingKEDA | ternary "true" "" -}}
161161
{{- end -}}
162162

163+
{{/*
164+
Is ingress enabled
165+
*/}}
166+
{{- define "seleniumGrid.ingress.enabled" -}}
167+
{{- or .Values.ingress.enabled .Values.ingress.enableWithExistingController | ternary "true" "" -}}
168+
{{- end -}}
169+
170+
{{/*
171+
Is ingress enabled
172+
*/}}
173+
{{- define "seleniumGrid.monitoring.enabled" -}}
174+
{{- or .Values.monitoring.enabled .Values.monitoring.enabledWithExistingAgent | ternary "true" "" -}}
175+
{{- end -}}
176+
163177
{{/*
164178
Is tracing enabled
165179
*/}}
@@ -595,7 +609,7 @@ Graphql Url of the hub or the router
595609

596610
{{- define "seleniumGrid.url.host" -}}
597611
{{- $host := printf "%s.%s" (include ($.Values.isolateComponents | ternary "seleniumGrid.router.fullname" "seleniumGrid.hub.fullname") $ ) (.Release.Namespace) -}}
598-
{{- if .Values.ingress.enabled -}}
612+
{{- if eq (include "seleniumGrid.ingress.enabled" $) "true" -}}
599613
{{- if and (not .Values.ingress.hostname) .Values.global.K8S_PUBLIC_IP -}}
600614
{{- $host = .Values.global.K8S_PUBLIC_IP -}}
601615
{{- else if and .Values.ingress.hostname (ne (tpl .Values.ingress.hostname $) "selenium-grid.local") -}}
@@ -614,7 +628,7 @@ Graphql Url of the hub or the router
614628

615629
{{- define "seleniumGrid.url.port" -}}
616630
{{- $port := ":4444" -}}
617-
{{- if .Values.ingress.enabled -}}
631+
{{- if eq (include "seleniumGrid.ingress.enabled" $) "true" -}}
618632
{{- if or (ne (.Values.ingress.ports.http | toString) "80") (ne (.Values.ingress.ports.https | toString) "443") -}}
619633
{{- $port = printf ":%s" (ternary (.Values.ingress.ports.http | toString) (.Values.ingress.ports.https | toString) (eq (include "seleniumGrid.url.schema" .) "http")) -}}
620634
{{- else if and .Values.ingress.hostname (eq (tpl .Values.ingress.hostname $) "selenium-grid.local") }}

charts/selenium-grid/templates/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.ingress.enabled }}
1+
{{- if eq (include "seleniumGrid.ingress.enabled" $) "true" }}
22
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
33
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
44
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}

0 commit comments

Comments
 (0)