Skip to content

Commit

Permalink
Bug: Error setting name in helm release #2006 #2007 (#2009)
Browse files Browse the repository at this point in the history
* Bug: Error setting name in helm release #2006

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Add workflow to test chart

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Update workflow to test chart

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Update workflow to test helm chart

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Update workflow to test chart

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Update ConfigMap for video recorder #2007

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Test indidividual node to reduce unstable Insufficient cpu

Signed-off-by: Viet Nguyen Duc <[email protected]>

* Fix lint in test values yaml

Signed-off-by: Viet Nguyen Duc <[email protected]>

---------

Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 authored Nov 14, 2023
1 parent 35a044a commit eec5ecc
Show file tree
Hide file tree
Showing 32 changed files with 112 additions and 77 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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/[email protected]

- 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 }}
run: ct install --all --config tests/chart-test.yaml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@ ENV/

# End of https://www.gitignore.io/api/python
.DS_Store

/charts/*/charts
/charts/*/**.lock
1 change: 1 addition & 0 deletions charts/selenium-grid/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
.idea/
*.tmproj
.vscode/
ci/
2 changes: 1 addition & 1 deletion charts/selenium-grid/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions charts/selenium-grid/ci/overrideNameChrome-values.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions charts/selenium-grid/ci/overrideNameEdge-values.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions charts/selenium-grid/ci/overrideNameFirefox-values.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/templates/chrome-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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" .) -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/chrome-node-scaledjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/chrome-node-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions charts/selenium-grid/templates/distributor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/distributor-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/templates/edge-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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" .) -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/edge-node-scaledjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/edge-node-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions charts/selenium-grid/templates/event-bus-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/event-bus-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/templates/firefox-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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" .) -}}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/firefox-node-scaledjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/firefox-node-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions charts/selenium-grid/templates/hub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/hub-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 ) }}
Expand Down
Loading

0 comments on commit eec5ecc

Please sign in to comment.