-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
K8s: Multiple nodes browser in Helm configs (#2475)
Signed-off-by: Viet Nguyen Duc <[email protected]>
- Loading branch information
Showing
23 changed files
with
436 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
crossBrowsers: | ||
chromeNode: | ||
# Keep the first iteration with latest version of Chrome | ||
- nameOverride: | ||
- nameOverride: '{{ $.Release.Name }}-node-chrome-130' | ||
imageTag: '130.0' | ||
hpa: | ||
browserVersion: '130.0' | ||
- nameOverride: '{{ $.Release.Name }}-node-chrome-129' | ||
imageTag: '129.0' | ||
hpa: | ||
browserVersion: '129.0' | ||
- nameOverride: '{{ $.Release.Name }}-node-chrome-128' | ||
imageTag: '128.0' | ||
hpa: | ||
browserVersion: '128.0' | ||
firefoxNode: | ||
# Keep the first iteration with latest version of Firefox | ||
- nameOverride: | ||
- nameOverride: '{{ $.Release.Name }}-node-firefox-130' | ||
imageTag: '130.0' | ||
hpa: | ||
browserVersion: '130.0' | ||
- nameOverride: '{{ $.Release.Name }}-node-firefox-129' | ||
imageTag: '129.0' | ||
hpa: | ||
browserVersion: '129.0' | ||
- nameOverride: '{{ $.Release.Name }}-node-firefox-128' | ||
imageTag: '128.0' | ||
hpa: | ||
browserVersion: '128.0' | ||
edgeNode: | ||
# Keep the first iteration with latest version of Edge | ||
- nameOverride: | ||
- nameOverride: '{{ $.Release.Name }}-node-edge-130' | ||
imageTag: '130.0' | ||
hpa: | ||
browserVersion: '130.0' | ||
- nameOverride: '{{ $.Release.Name }}-node-edge-129' | ||
imageTag: '129.0' | ||
hpa: | ||
browserVersion: '129.0' | ||
- nameOverride: '{{ $.Release.Name }}-node-edge-128' | ||
imageTag: '128.0' | ||
hpa: | ||
browserVersion: '128.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 23 additions & 19 deletions
42
charts/selenium-grid/templates/chrome-node-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
{{- if and .Values.chromeNode.enabled ((eq (include "seleniumGrid.useKEDA" .) "true") | ternary (eq .Values.autoscaling.scalingType "deployment") .Values.chromeNode.deploymentEnabled) }} | ||
{{- range $i, $newNode := .Values.crossBrowsers.chromeNode }} | ||
{{- $nodeConfig := merge $newNode $.Values.chromeNode -}} | ||
{{- if and $nodeConfig.enabled ((eq (include "seleniumGrid.useKEDA" $) "true") | ternary (eq $.Values.autoscaling.scalingType "deployment") $nodeConfig.deploymentEnabled) }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
namespace: {{ $.Release.Namespace }} | ||
labels: | ||
app: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
{{- include "seleniumGrid.commonLabels" . | nindent 4 }} | ||
{{- with .Values.chromeNode.labels }} | ||
app: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
{{- include "seleniumGrid.commonLabels" $ | nindent 4 }} | ||
{{- with $nodeConfig.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.customLabels }} | ||
{{- with $.Values.customLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
strategy: | ||
{{- template "seleniumGrid.updateStrategy" (list $.Values.chromeNode $.Values.global.seleniumGrid) }} | ||
{{- template "seleniumGrid.updateStrategy" (list $nodeConfig $.Values.global.seleniumGrid) }} | ||
{{- if not (eq (include "seleniumGrid.useKEDA" $) "true") }} | ||
replicas: {{ .Values.chromeNode.replicas }} | ||
replicas: {{ $nodeConfig.replicas }} | ||
{{- else }} | ||
replicas: {{ default $.Values.autoscaling.scaledOptions.minReplicaCount ($.Values.chromeNode.scaledOptions).minReplicaCount }} | ||
replicas: {{ default $.Values.autoscaling.scaledOptions.minReplicaCount ($nodeConfig.scaledOptions).minReplicaCount }} | ||
{{- end }} | ||
revisionHistoryLimit: {{ .Values.global.seleniumGrid.revisionHistoryLimit }} | ||
revisionHistoryLimit: {{ $.Values.global.seleniumGrid.revisionHistoryLimit }} | ||
selector: | ||
matchLabels: | ||
app: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- $podScope := deepCopy . -}} | ||
{{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" .) -}} | ||
{{- $_ = set $podScope "node" .Values.chromeNode -}} | ||
{{- $_ = set $podScope "recorder" (mergeOverwrite .Values.videoRecorder .Values.chromeNode.videoRecorder) -}} | ||
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder ($podScope.recorder.uploader.name | toString)) -}} | ||
app: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
app.kubernetes.io/instance: {{ $.Release.Name }} | ||
{{- $podScope := deepCopy $ -}} | ||
{{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" (list $nodeConfig $)) -}} | ||
{{- $_ = set $podScope "node" $nodeConfig -}} | ||
{{- $_ = set $podScope "recorder" (mergeOverwrite $.Values.videoRecorder $nodeConfig.videoRecorder) -}} | ||
{{- $_ = set $podScope "uploader" (get $.Values.videoRecorder ($podScope.recorder.uploader.name | toString)) -}} | ||
{{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
{{- if and .Values.chromeNode.enabled (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "deployment") }} | ||
{{- range $i, $newNode := .Values.crossBrowsers.chromeNode }} | ||
{{- $nodeConfig := merge $newNode $.Values.chromeNode -}} | ||
{{- if and $nodeConfig.enabled (eq (include "seleniumGrid.useKEDA" $) "true") (eq $.Values.autoscaling.scalingType "deployment") }} | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
namespace: {{ $.Release.Namespace }} | ||
annotations: | ||
{{- with .Values.autoscaling.annotations }} | ||
{{- with $.Values.autoscaling.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
deploymentName: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
{{- include "seleniumGrid.commonLabels" . | nindent 4 }} | ||
{{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} | ||
{{- with .Values.chromeNode.labels }} | ||
deploymentName: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
{{- include "seleniumGrid.commonLabels" $ | nindent 4 }} | ||
{{- include "seleniumGrid.autoscalingLabels" $ | nindent 4 }} | ||
{{- with $nodeConfig.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.customLabels }} | ||
{{- with $.Values.customLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- $podScope := deepCopy . -}} | ||
{{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" .) -}} | ||
{{- $_ = set $podScope "node" .Values.chromeNode -}} | ||
{{- $podScope := deepCopy $ -}} | ||
{{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" (list $nodeConfig $)) -}} | ||
{{- $_ = set $podScope "node" $nodeConfig -}} | ||
{{- include "seleniumGrid.autoscalingTemplate" $podScope | nindent 2 }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
34 changes: 19 additions & 15 deletions
34
charts/selenium-grid/templates/chrome-node-scaledjobs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
{{- if and .Values.chromeNode.enabled (include "seleniumGrid.useKEDA" .) (eq .Values.autoscaling.scalingType "job") }} | ||
{{- range $i, $newNode := .Values.crossBrowsers.chromeNode }} | ||
{{- $nodeConfig := merge $newNode $.Values.chromeNode -}} | ||
{{- if and $nodeConfig.enabled (include "seleniumGrid.useKEDA" $) (eq $.Values.autoscaling.scalingType "job") }} | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledJob | ||
metadata: | ||
name: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
name: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
namespace: {{ $.Release.Namespace }} | ||
annotations: | ||
{{- with .Values.autoscaling.annotations }} | ||
{{- with $.Values.autoscaling.annotations }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
labels: | ||
app: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" . }} | ||
{{- include "seleniumGrid.commonLabels" . | nindent 4 }} | ||
{{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }} | ||
{{- with .Values.chromeNode.labels }} | ||
app: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" (list $nodeConfig $) }} | ||
{{- include "seleniumGrid.commonLabels" $ | nindent 4 }} | ||
{{- include "seleniumGrid.autoscalingLabels" $ | nindent 4 }} | ||
{{- with $nodeConfig.labels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.customLabels }} | ||
{{- with $.Values.customLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- $podScope := deepCopy . -}} | ||
{{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" .) -}} | ||
{{- $_ = set $podScope "node" .Values.chromeNode -}} | ||
{{- $_ = set $podScope "recorder" (mergeOverwrite .Values.videoRecorder .Values.chromeNode.videoRecorder) -}} | ||
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder ($podScope.recorder.uploader.name | toString)) -}} | ||
{{- $podScope := deepCopy $ -}} | ||
{{- $_ := set $podScope "name" (include "seleniumGrid.chromeNode.fullname" (list $nodeConfig $)) -}} | ||
{{- $_ = set $podScope "node" $nodeConfig -}} | ||
{{- $_ = set $podScope "recorder" (mergeOverwrite $.Values.videoRecorder $nodeConfig.videoRecorder) -}} | ||
{{- $_ = set $podScope "uploader" (get $.Values.videoRecorder ($podScope.recorder.uploader.name | toString)) -}} | ||
{{- $_ = set $podScope "podTemplate" (include "seleniumGrid.podTemplate" $podScope | fromYaml) }} | ||
{{- include "seleniumGrid.autoscalingTemplate" $podScope | nindent 2 }} | ||
--- | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.