From eec5ecc6b6894eb38b6cfb06d9c8a484e4c52552 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Tue, 14 Nov 2023 19:56:43 +0700 Subject: [PATCH] Bug: Error setting name in helm release #2006 #2007 (#2009) * Bug: Error setting name in helm release #2006 Signed-off-by: Viet Nguyen Duc * Add workflow to test chart Signed-off-by: Viet Nguyen Duc * Update workflow to test chart Signed-off-by: Viet Nguyen Duc * Update workflow to test helm chart Signed-off-by: Viet Nguyen Duc * Update workflow to test chart Signed-off-by: Viet Nguyen Duc * Update ConfigMap for video recorder #2007 Signed-off-by: Viet Nguyen Duc * Test indidividual node to reduce unstable Insufficient cpu Signed-off-by: Viet Nguyen Duc * Fix lint in test values yaml Signed-off-by: Viet Nguyen Duc --------- Signed-off-by: Viet Nguyen Duc --- .github/workflows/helm-chart-test.yml | 28 ++++++++----------- .gitignore | 3 +- charts/selenium-grid/.helmignore | 1 + charts/selenium-grid/Chart.yaml | 2 +- .../ci/overrideNameChrome-values.yaml | 9 ++++++ .../ci/overrideNameEdge-values.yaml | 9 ++++++ .../ci/overrideNameFirefox-values.yaml | 9 ++++++ charts/selenium-grid/templates/NOTES.txt | 2 +- .../templates/chrome-node-deployment.yaml | 6 ++-- .../templates/chrome-node-scaledjobs.yaml | 4 +-- .../templates/chrome-node-service.yaml | 4 +-- .../templates/distributor-deployment.yaml | 8 +++--- .../templates/distributor-service.yaml | 4 +-- .../templates/edge-node-deployment.yaml | 6 ++-- .../templates/edge-node-scaledjob.yaml | 4 +-- .../templates/edge-node-service.yaml | 4 +-- .../templates/event-bus-deployment.yaml | 8 +++--- .../templates/event-bus-service.yaml | 4 +-- .../templates/firefox-node-deployment.yaml | 6 ++-- .../templates/firefox-node-scaledjob.yaml | 4 +-- .../templates/firefox-node-service.yaml | 4 +-- .../templates/hub-deployment.yaml | 8 +++--- .../selenium-grid/templates/hub-service.yaml | 4 +-- .../templates/router-deployment.yaml | 8 +++--- .../templates/router-service.yaml | 4 +-- .../templates/session-map-deployment.yaml | 8 +++--- .../templates/session-map-service.yaml | 4 +-- .../templates/session-queuer-deployment.yaml | 8 +++--- .../templates/session-queuer-service.yaml | 4 +-- charts/selenium-grid/templates/video-cm.yaml | 2 +- charts/selenium-grid/values.yaml | 2 ++ tests/chart-test.yaml | 8 ++++++ 32 files changed, 112 insertions(+), 77 deletions(-) create mode 100644 charts/selenium-grid/ci/overrideNameChrome-values.yaml create mode 100644 charts/selenium-grid/ci/overrideNameEdge-values.yaml create mode 100644 charts/selenium-grid/ci/overrideNameFirefox-values.yaml create mode 100644 tests/chart-test.yaml diff --git a/.github/workflows/helm-chart-test.yml b/.github/workflows/helm-chart-test.yml index 6bcf1eae4..cf8f8c439 100644 --- a/.github/workflows/helm-chart-test.yml +++ b/.github/workflows/helm-chart-test.yml @@ -1,6 +1,13 @@ name: Lint and Test Helm Charts -on: pull_request +on: + push: + paths: + - 'charts/selenium-grid/**' + pull_request: + paths: + - 'charts/selenium-grid/**' + workflow_dispatch: jobs: lint-test: @@ -28,27 +35,16 @@ jobs: - name: Run chart-testing (list-changed) id: list-changed run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + changed=$(ct list-changed --config tests/chart-test.yaml) if [[ -n "$changed" ]]; then - echo "changed=true" >> "$GITHUB_OUTPUT" + echo "{changed}={true}" >> $GITHUB_OUTPUT fi - name: Run chart-testing (lint) - if: steps.list-changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} + run: ct lint --config tests/chart-test.yaml - name: Create kind cluster - if: steps.list-changed.outputs.changed == 'true' uses: helm/kind-action@v1.8.0 - - name: Build Helm Charts - if: steps.list-changed.outputs.changed == 'true' - run: | - helm repo add kedacore https://kedacore.github.io/charts - helm repo update - cd charts - helm dependency build selenium-grid - - name: Run chart-testing (install) - if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} \ No newline at end of file + run: ct install --all --config tests/chart-test.yaml diff --git a/.gitignore b/.gitignore index 7377b135b..fc44914b7 100644 --- a/.gitignore +++ b/.gitignore @@ -147,4 +147,5 @@ ENV/ # End of https://www.gitignore.io/api/python .DS_Store - +/charts/*/charts +/charts/*/**.lock diff --git a/charts/selenium-grid/.helmignore b/charts/selenium-grid/.helmignore index 0e8a0eb36..5bdaa3eb0 100644 --- a/charts/selenium-grid/.helmignore +++ b/charts/selenium-grid/.helmignore @@ -21,3 +21,4 @@ .idea/ *.tmproj .vscode/ +ci/ diff --git a/charts/selenium-grid/Chart.yaml b/charts/selenium-grid/Chart.yaml index 8dfd4513d..a5786c654 100644 --- a/charts/selenium-grid/Chart.yaml +++ b/charts/selenium-grid/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: selenium-grid description: A Helm chart for creating a Selenium Grid Server in Kubernetes type: application -version: 0.25.0 +version: 0.25.1 appVersion: 4.15.0-20231110 icon: https://github.com/SeleniumHQ/docker-selenium/raw/trunk/logo.png dependencies: diff --git a/charts/selenium-grid/ci/overrideNameChrome-values.yaml b/charts/selenium-grid/ci/overrideNameChrome-values.yaml new file mode 100644 index 000000000..6fe143648 --- /dev/null +++ b/charts/selenium-grid/ci/overrideNameChrome-values.yaml @@ -0,0 +1,9 @@ +# These desired is used to test the overrideName of the component +hub: + nameOverride: my-hub-name +chromeNode: + nameOverride: my-chrome-name +edgeNode: + enabled: false +firefoxNode: + enabled: false diff --git a/charts/selenium-grid/ci/overrideNameEdge-values.yaml b/charts/selenium-grid/ci/overrideNameEdge-values.yaml new file mode 100644 index 000000000..11f20066e --- /dev/null +++ b/charts/selenium-grid/ci/overrideNameEdge-values.yaml @@ -0,0 +1,9 @@ +# These desired is used to test the overrideName of the component +hub: + nameOverride: my-hub-name +chromeNode: + enabled: false +edgeNode: + nameOverride: my-edge-name +firefoxNode: + enabled: false diff --git a/charts/selenium-grid/ci/overrideNameFirefox-values.yaml b/charts/selenium-grid/ci/overrideNameFirefox-values.yaml new file mode 100644 index 000000000..dcf4670ed --- /dev/null +++ b/charts/selenium-grid/ci/overrideNameFirefox-values.yaml @@ -0,0 +1,9 @@ +# These desired is used to test the overrideName of the component +hub: + nameOverride: my-hub-name +chromeNode: + enabled: false +edgeNode: + enabled: false +firefoxNode: + nameOverride: my-firefox-name diff --git a/charts/selenium-grid/templates/NOTES.txt b/charts/selenium-grid/templates/NOTES.txt index 80920a44f..ce79f74b5 100644 --- a/charts/selenium-grid/templates/NOTES.txt +++ b/charts/selenium-grid/templates/NOTES.txt @@ -1,7 +1,7 @@ Selenium Grid Server deployed successfully. {{- $svcName := ternary (include "seleniumGrid.router.fullname" . ) (include "seleniumGrid.hub.fullname" . ) .Values.isolateComponents }} -{{- $appName := ternary "selenium-router" "selenium-hub" .Values.isolateComponents }} +{{- $appName := ternary (include "seleniumGrid.router.fullname" . ) (include "seleniumGrid.hub.fullname" . ) .Values.isolateComponents }} {{- $serviceType := ternary .Values.components.router.serviceType .Values.hub.serviceType .Values.isolateComponents }} {{- $port := ternary .Values.components.router.port .Values.hub.port .Values.isolateComponents }} {{- $localUrl := ternary "http://localhost:PORT" "http://localhost:PORT/wd/hub" .Values.isolateComponents }} diff --git a/charts/selenium-grid/templates/chrome-node-deployment.yaml b/charts/selenium-grid/templates/chrome-node-deployment.yaml index 2ea8c010c..e3bf3f1d2 100644 --- a/charts/selenium-grid/templates/chrome-node-deployment.yaml +++ b/charts/selenium-grid/templates/chrome-node-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.chromeNode.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-chrome-node - app.kubernetes.io/name: selenium-chrome-node + app: {{ template "seleniumGrid.chromeNode.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.chromeNode.labels }} {{- toYaml . | nindent 4 }} @@ -20,7 +20,7 @@ spec: {{end}} selector: matchLabels: - app: selenium-chrome-node + app: {{ template "seleniumGrid.chromeNode.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" .) -}} diff --git a/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml b/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml index 22a9fcef2..0b0d34443 100644 --- a/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml +++ b/charts/selenium-grid/templates/chrome-node-scaledjobs.yaml @@ -9,8 +9,8 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} labels: - app: selenium-chrome-node - app.kubernetes.io/name: selenium-chrome-node + app: {{ template "seleniumGrid.chromeNode.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.chromeNode.labels }} {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/chrome-node-service.yaml b/charts/selenium-grid/templates/chrome-node-service.yaml index 754f941ab..efe8f1873 100644 --- a/charts/selenium-grid/templates/chrome-node-service.yaml +++ b/charts/selenium-grid/templates/chrome-node-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.chromeNode.fullname" . }} namespace: {{ .Release.Namespace }} labels: - name: selenium-chrome-node + name: {{ template "seleniumGrid.chromeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.chromeNode.service.annotations }} annotations: @@ -14,7 +14,7 @@ metadata: spec: type: {{ .Values.chromeNode.service.type }} selector: - app: selenium-chrome-node + app: {{ template "seleniumGrid.chromeNode.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- if and (eq .Values.chromeNode.service.type "LoadBalancer") (.Values.chromeNode.service.loadBalancerIP) }} loadBalancerIP: {{ .Values.chromeNode.service.loadBalancerIP }} diff --git a/charts/selenium-grid/templates/distributor-deployment.yaml b/charts/selenium-grid/templates/distributor-deployment.yaml index bf35d43ed..fe5efd767 100644 --- a/charts/selenium-grid/templates/distributor-deployment.yaml +++ b/charts/selenium-grid/templates/distributor-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.distributor.fullname" . }} namespace: {{ .Release.Namespace }} labels: &distributor_labels - app: selenium-distributor - app.kubernetes.io/name: selenium-distributor + app: {{ template "seleniumGrid.distributor.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.distributor.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ spec: replicas: 1 selector: matchLabels: - app: selenium-distributor + app: {{ template "seleniumGrid.distributor.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: @@ -27,7 +27,7 @@ spec: serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }} serviceAccount: {{ template "seleniumGrid.serviceAccount.fullname" . }} containers: - - name: selenium-distributor + - name: {{ template "seleniumGrid.distributor.fullname" . }} {{- $imageTag := default .Values.global.seleniumGrid.imageTag .Values.components.distributor.imageTag }} image: {{ printf "%s:%s" .Values.components.distributor.imageName $imageTag }} imagePullPolicy: {{ .Values.components.distributor.imagePullPolicy }} diff --git a/charts/selenium-grid/templates/distributor-service.yaml b/charts/selenium-grid/templates/distributor-service.yaml index 067be8952..295407fac 100644 --- a/charts/selenium-grid/templates/distributor-service.yaml +++ b/charts/selenium-grid/templates/distributor-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.distributor.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-distributor + app: {{ template "seleniumGrid.distributor.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ metadata: {{- end }} spec: selector: - app: selenium-distributor + app: {{ template "seleniumGrid.distributor.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} type: {{ .Values.components.distributor.serviceType }} ports: diff --git a/charts/selenium-grid/templates/edge-node-deployment.yaml b/charts/selenium-grid/templates/edge-node-deployment.yaml index 33fc360aa..9802239e8 100644 --- a/charts/selenium-grid/templates/edge-node-deployment.yaml +++ b/charts/selenium-grid/templates/edge-node-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.edgeNode.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-edge-node - app.kubernetes.io/name: selenium-edge-node + app: {{ template "seleniumGrid.edgeNode.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.edgeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.edgeNode.labels }} {{- toYaml . | nindent 4 }} @@ -20,7 +20,7 @@ spec: {{end}} selector: matchLabels: - app: selenium-edge-node + app: {{ template "seleniumGrid.edgeNode.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.edgeNode.fullname" .) -}} diff --git a/charts/selenium-grid/templates/edge-node-scaledjob.yaml b/charts/selenium-grid/templates/edge-node-scaledjob.yaml index a9f235c31..132792c79 100644 --- a/charts/selenium-grid/templates/edge-node-scaledjob.yaml +++ b/charts/selenium-grid/templates/edge-node-scaledjob.yaml @@ -9,8 +9,8 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} labels: - app: selenium-edge-node - app.kubernetes.io/name: selenium-edge-node + app: {{ template "seleniumGrid.edgeNode.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.edgeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.edgeNode.labels }} {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/edge-node-service.yaml b/charts/selenium-grid/templates/edge-node-service.yaml index ca253835a..d54dd70a3 100644 --- a/charts/selenium-grid/templates/edge-node-service.yaml +++ b/charts/selenium-grid/templates/edge-node-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.edgeNode.fullname" . }} namespace: {{ .Release.Namespace }} labels: - name: selenium-edge-node + name: {{ template "seleniumGrid.edgeNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.edgeNode.service.annotations }} annotations: @@ -14,7 +14,7 @@ metadata: spec: type: {{ .Values.edgeNode.service.type }} selector: - app: selenium-edge-node + app: {{ template "seleniumGrid.edgeNode.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- if and (eq .Values.edgeNode.service.type "LoadBalancer") (.Values.edgeNode.service.loadBalancerIP) }} loadBalancerIP: {{ .Values.edgeNode.service.loadBalancerIP }} diff --git a/charts/selenium-grid/templates/event-bus-deployment.yaml b/charts/selenium-grid/templates/event-bus-deployment.yaml index 498921e8c..a315cd820 100644 --- a/charts/selenium-grid/templates/event-bus-deployment.yaml +++ b/charts/selenium-grid/templates/event-bus-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.eventBus.fullname" . }} namespace: {{ .Release.Namespace }} labels: &event_bus_labels - app: selenium-event-bus - app.kubernetes.io/name: selenium-event-bus + app: {{ template "seleniumGrid.eventBus.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.eventBus.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ spec: replicas: 1 selector: matchLabels: - app: selenium-event-bus + app: {{ template "seleniumGrid.eventBus.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: @@ -27,7 +27,7 @@ spec: serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }} serviceAccount: {{ template "seleniumGrid.serviceAccount.fullname" . }} containers: - - name: selenium-event-bus + - name: {{ template "seleniumGrid.eventBus.fullname" . }} {{- $imageTag := default .Values.global.seleniumGrid.imageTag .Values.components.eventBus.imageTag }} image: {{ printf "%s:%s" .Values.components.eventBus.imageName $imageTag }} imagePullPolicy: {{ .Values.components.eventBus.imagePullPolicy }} diff --git a/charts/selenium-grid/templates/event-bus-service.yaml b/charts/selenium-grid/templates/event-bus-service.yaml index 38ff6cd1e..c3a30bcc0 100644 --- a/charts/selenium-grid/templates/event-bus-service.yaml +++ b/charts/selenium-grid/templates/event-bus-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.eventBus.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-event-bus + app: {{ template "seleniumGrid.eventBus.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ metadata: {{- end }} spec: selector: - app: selenium-event-bus + app: {{ template "seleniumGrid.eventBus.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} type: {{ .Values.components.eventBus.serviceType }} ports: diff --git a/charts/selenium-grid/templates/firefox-node-deployment.yaml b/charts/selenium-grid/templates/firefox-node-deployment.yaml index f5dc6d962..5a1e96b55 100644 --- a/charts/selenium-grid/templates/firefox-node-deployment.yaml +++ b/charts/selenium-grid/templates/firefox-node-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.firefoxNode.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-firefox-node - app.kubernetes.io/name: selenium-firefox-node + app: {{ template "seleniumGrid.firefoxNode.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.firefoxNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.firefoxNode.labels }} {{- toYaml . | nindent 4 }} @@ -20,7 +20,7 @@ spec: {{end}} selector: matchLabels: - app: selenium-firefox-node + app: {{ template "seleniumGrid.firefoxNode.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- $podScope := deepCopy . -}} {{- $_ := set $podScope "name" (include "seleniumGrid.firefoxNode.fullname" .) -}} diff --git a/charts/selenium-grid/templates/firefox-node-scaledjob.yaml b/charts/selenium-grid/templates/firefox-node-scaledjob.yaml index 9105bc358..e7992c1fc 100644 --- a/charts/selenium-grid/templates/firefox-node-scaledjob.yaml +++ b/charts/selenium-grid/templates/firefox-node-scaledjob.yaml @@ -9,8 +9,8 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} labels: - app: selenium-firefox-node - app.kubernetes.io/name: selenium-firefox-node + app: {{ template "seleniumGrid.firefoxNode.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.firefoxNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.firefoxNode.labels }} {{- toYaml . | nindent 4 }} diff --git a/charts/selenium-grid/templates/firefox-node-service.yaml b/charts/selenium-grid/templates/firefox-node-service.yaml index d8cb4c844..43ba40380 100644 --- a/charts/selenium-grid/templates/firefox-node-service.yaml +++ b/charts/selenium-grid/templates/firefox-node-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.firefoxNode.fullname" . }} namespace: {{ .Release.Namespace }} labels: - name: selenium-firefox-node + name: {{ template "seleniumGrid.firefoxNode.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.firefoxNode.service.annotations }} annotations: @@ -14,7 +14,7 @@ metadata: spec: type: {{ .Values.firefoxNode.service.type }} selector: - app: selenium-firefox-node + app: {{ template "seleniumGrid.firefoxNode.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- if and (eq .Values.firefoxNode.service.type "LoadBalancer") (.Values.firefoxNode.service.loadBalancerIP) }} loadBalancerIP: {{ .Values.firefoxNode.service.loadBalancerIP }} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index 6f9488d12..a5ea71ab5 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.hub.fullname" . }} namespace: {{ .Release.Namespace }} labels: &hub_labels - app: selenium-hub - app.kubernetes.io/name: selenium-hub + app: {{ template "seleniumGrid.hub.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.hub.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.hub.labels }} {{- toYaml . | nindent 4 }} @@ -18,7 +18,7 @@ spec: replicas: 1 selector: matchLabels: - app: selenium-hub + app: {{ template "seleniumGrid.hub.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: @@ -30,7 +30,7 @@ spec: serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }} serviceAccount: {{ template "seleniumGrid.serviceAccount.fullname" . }} containers: - - name: selenium-hub + - name: {{ template "seleniumGrid.hub.fullname" . }} {{- $imageTag := default .Values.global.seleniumGrid.imageTag .Values.hub.imageTag }} image: {{ printf "%s:%s" .Values.hub.imageName $imageTag }} imagePullPolicy: {{ .Values.hub.imagePullPolicy }} diff --git a/charts/selenium-grid/templates/hub-service.yaml b/charts/selenium-grid/templates/hub-service.yaml index 417e9849f..aa4daa34c 100644 --- a/charts/selenium-grid/templates/hub-service.yaml +++ b/charts/selenium-grid/templates/hub-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.hub.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-hub + app: {{ template "seleniumGrid.hub.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ metadata: {{- end }} spec: selector: - app: selenium-hub + app: {{ template "seleniumGrid.hub.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} type: {{ .Values.hub.serviceType }} {{- if and (eq .Values.hub.serviceType "LoadBalancer") ( .Values.hub.loadBalancerIP ) }} diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index 037bcbf39..05ae9a7b9 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.router.fullname" . }} namespace: {{ .Release.Namespace }} labels: &router_labels - app: selenium-router - app.kubernetes.io/name: selenium-router + app: {{ template "seleniumGrid.router.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.router.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ spec: replicas: 1 selector: matchLabels: - app: selenium-router + app: {{ template "seleniumGrid.router.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: @@ -27,7 +27,7 @@ spec: serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }} serviceAccount: {{ template "seleniumGrid.serviceAccount.fullname" . }} containers: - - name: selenium-router + - name: {{ template "seleniumGrid.router.fullname" . }} {{- $imageTag := default .Values.global.seleniumGrid.imageTag .Values.components.router.imageTag }} image: {{ printf "%s:%s" .Values.components.router.imageName $imageTag }} imagePullPolicy: {{ .Values.components.router.imagePullPolicy }} diff --git a/charts/selenium-grid/templates/router-service.yaml b/charts/selenium-grid/templates/router-service.yaml index d586c31fe..9eaff7955 100644 --- a/charts/selenium-grid/templates/router-service.yaml +++ b/charts/selenium-grid/templates/router-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.router.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-router + app: {{ template "seleniumGrid.router.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ metadata: {{- end }} spec: selector: - app: selenium-router + app: {{ template "seleniumGrid.router.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} type: {{ .Values.components.router.serviceType }} {{- if and (eq .Values.components.router.serviceType "LoadBalancer") (.Values.components.router.loadBalancerIP) }} diff --git a/charts/selenium-grid/templates/session-map-deployment.yaml b/charts/selenium-grid/templates/session-map-deployment.yaml index 437c664e2..496089eaf 100644 --- a/charts/selenium-grid/templates/session-map-deployment.yaml +++ b/charts/selenium-grid/templates/session-map-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.sessionMap.fullname" . }} namespace: {{ .Release.Namespace }} labels: &session_map_labels - app: selenium-session-map - app.kubernetes.io/name: selenium-session-map + app: {{ template "seleniumGrid.sessionMap.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.sessionMap.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ spec: replicas: 1 selector: matchLabels: - app: selenium-session-map + app: {{ template "seleniumGrid.sessionMap.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: @@ -27,7 +27,7 @@ spec: serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }} serviceAccount: {{ template "seleniumGrid.serviceAccount.fullname" . }} containers: - - name: selenium-session-map + - name: {{ template "seleniumGrid.sessionMap.fullname" . }} {{- $imageTag := default .Values.global.seleniumGrid.imageTag .Values.components.sessionMap.imageTag }} image: {{ printf "%s:%s" .Values.components.sessionMap.imageName $imageTag }} imagePullPolicy: {{ .Values.components.sessionMap.imagePullPolicy }} diff --git a/charts/selenium-grid/templates/session-map-service.yaml b/charts/selenium-grid/templates/session-map-service.yaml index 6df2d9bbf..13dd963b6 100644 --- a/charts/selenium-grid/templates/session-map-service.yaml +++ b/charts/selenium-grid/templates/session-map-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.sessionMap.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-session-map + app: {{ template "seleniumGrid.sessionMap.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ metadata: {{- end }} spec: selector: - app: selenium-session-map + app: {{ template "seleniumGrid.sessionMap.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} type: {{ .Values.components.sessionMap.serviceType }} ports: diff --git a/charts/selenium-grid/templates/session-queuer-deployment.yaml b/charts/selenium-grid/templates/session-queuer-deployment.yaml index 0f26f06e5..28c17b49c 100644 --- a/charts/selenium-grid/templates/session-queuer-deployment.yaml +++ b/charts/selenium-grid/templates/session-queuer-deployment.yaml @@ -5,8 +5,8 @@ metadata: name: {{ template "seleniumGrid.sessionQueue.fullname" . }} namespace: {{ .Release.Namespace }} labels: &session_queue_labels - app: selenium-session-queue - app.kubernetes.io/name: selenium-session-queue + app: {{ template "seleniumGrid.sessionQueue.fullname" . }} + app.kubernetes.io/name: {{ template "seleniumGrid.sessionQueue.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ spec: replicas: 1 selector: matchLabels: - app: selenium-session-queue + app: {{ template "seleniumGrid.sessionQueue.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} template: metadata: @@ -27,7 +27,7 @@ spec: serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }} serviceAccount: {{ template "seleniumGrid.serviceAccount.fullname" . }} containers: - - name: selenium-session-queue + - name: {{ template "seleniumGrid.sessionQueue.fullname" . }} {{- $imageTag := default .Values.global.seleniumGrid.imageTag .Values.components.sessionQueue.imageTag }} image: {{ printf "%s:%s" .Values.components.sessionQueue.imageName $imageTag }} imagePullPolicy: {{ .Values.components.sessionQueue.imagePullPolicy }} diff --git a/charts/selenium-grid/templates/session-queuer-service.yaml b/charts/selenium-grid/templates/session-queuer-service.yaml index be3739ad0..54e535f7b 100644 --- a/charts/selenium-grid/templates/session-queuer-service.yaml +++ b/charts/selenium-grid/templates/session-queuer-service.yaml @@ -5,7 +5,7 @@ metadata: name: {{ template "seleniumGrid.sessionQueue.fullname" . }} namespace: {{ .Release.Namespace }} labels: - app: selenium-session-queue + app: {{ template "seleniumGrid.sessionQueue.fullname" . }} {{- include "seleniumGrid.commonLabels" . | nindent 4 }} {{- with .Values.customLabels }} {{- toYaml . | nindent 4 }} @@ -15,7 +15,7 @@ metadata: {{- end }} spec: selector: - app: selenium-session-queue + app: {{ template "seleniumGrid.sessionQueue.fullname" . }} app.kubernetes.io/instance: {{ .Release.Name }} type: {{ .Values.components.sessionQueue.serviceType }} ports: diff --git a/charts/selenium-grid/templates/video-cm.yaml b/charts/selenium-grid/templates/video-cm.yaml index e3ea227d5..1b49e026e 100644 --- a/charts/selenium-grid/templates/video-cm.yaml +++ b/charts/selenium-grid/templates/video-cm.yaml @@ -81,7 +81,7 @@ data: then upload_destination=${UPLOAD_DESTINATION_PREFIX}${video_file_name} echo "Uploading video to $upload_destination" - echo $video_file $upload_destination > /videos/uploadpipe & + echo $video_file $upload_destination > /videos/uploadpipe fi recording_started="false" elif [[ $recording_started = "true" ]] diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 15e361958..d92724ddc 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -870,8 +870,10 @@ videoRecorder: do if [ "$FILE" = "exit" ] then + echo "$FILE" break else + echo "Uploading $FILE to $DESTINATION" aws s3 cp --no-progress $FILE $DESTINATION fi done diff --git a/tests/chart-test.yaml b/tests/chart-test.yaml new file mode 100644 index 000000000..e54edd7a3 --- /dev/null +++ b/tests/chart-test.yaml @@ -0,0 +1,8 @@ +target-branch: trunk +chart-dirs: + - charts +chart-repos: + - kedacore=https://kedacore.github.io/charts +upgrade: false +helm-extra-args: --timeout 600s +check-version-increment: false