From 55751ae2019cb6a3d454ed88704d74d95467376f Mon Sep 17 00:00:00 2001 From: Gerald Barker Date: Sat, 7 Apr 2018 15:24:08 +0100 Subject: [PATCH] [stable][selenium] Add the option of adding nodeSelectors (#3791) * [stable][selenium] Add the option of adding nodeSelectors either globally or per component * [stable][selenium] Change precendence of global NodeSelector values --- stable/selenium/Chart.yaml | 2 +- stable/selenium/README.md | 6 ++++ .../selenium/templates/chrome-deployment.yaml | 8 ++++- .../templates/chromeDebug-deployment.yaml | 10 +++++-- .../templates/firefox-deployment.yaml | 6 ++++ .../templates/firefoxDebug-deployment.yaml | 6 ++++ stable/selenium/templates/hub-deployment.yaml | 6 ++++ stable/selenium/values.yaml | 29 +++++++++++++++++++ 8 files changed, 69 insertions(+), 4 deletions(-) diff --git a/stable/selenium/Chart.yaml b/stable/selenium/Chart.yaml index 2594a940cc..03555a85d5 100644 --- a/stable/selenium/Chart.yaml +++ b/stable/selenium/Chart.yaml @@ -1,5 +1,5 @@ name: selenium -version: 0.2.9 +version: 0.3.0 appVersion: 3.11.0 description: Chart for selenium grid keywords: diff --git a/stable/selenium/README.md b/stable/selenium/README.md index e794c6957c..e1747906eb 100644 --- a/stable/selenium/README.md +++ b/stable/selenium/README.md @@ -42,6 +42,7 @@ The following table lists the configurable parameters of the Selenium chart and | Parameter | Description | Default | | --------- | ----------- | ------- | +| `global.nodeselector` | Node label to be useed globally for scheduling of all images | `nil` | | `hub.image` | The selenium hub image | `selenium/hub` | | `hub.tag` | The selenium hub image tag | `3.11.0` | | `hub.pullPolicy` | The pull policy for the hub image | `IfNotPresent` | @@ -60,6 +61,7 @@ The following table lists the configurable parameters of the Selenium chart and | `hub.gridUnregisterIfStillDownAfer` | | `nil` | | `hub.seOpts` | Command line arguments to pass to hub | `nil` | | `hub.timeZone` | The time zone for the container | `nil` | +| `hub.nodeselector` | Node label to use for scheduling of the hub if set this takes precendence over the global value | `nil` | | `chrome.enabled` | Schedule a chrome node pod | `false` | | `chrome.image` | The selenium node chrome image | `selenium/node-chrome` | | `chrome.tag` | The selenium node chrome tag | `3.11.0` | @@ -80,6 +82,7 @@ The following table lists the configurable parameters of the Selenium chart and | `chrome.nodePort` | The port to listen on | `nil` | | `chrome.seOpts` | Command line arguments to pass to node | `nil` | | `chrome.timeZone` | The time zone for the container | `nil` | +| `chrome.nodeselector` | Node label to use for scheduling of chrome images if set this takes precendence over the global value | `nil` | | `chromeDebug.enabled` | Schedule a selenium node chrome debug pod | `false` | | `chromeDebug.image` | The selenium node chrome debug image | `selenium/node-chrome-debug` | | `chromeDebug.tag` | The selenium node chrome debug tag | `3.11.0` | @@ -100,6 +103,7 @@ The following table lists the configurable parameters of the Selenium chart and | `chromeDebug.nodePort` | The port to listen on | `nil` | | `chromeDebug.seOpts` | Command line arguments to pass to node | `nil` | | `chromeDebug.timeZone` | The time zone for the container | `nil` | +| `chromeDebug.nodeselector` | Node label to use for scheduling of chromeDebug images if set this takes precendence over the global value | `nil` | | `firefox.enabled` | Schedule a selenium node firefox pod | `false` | | `firefox.image` | The selenium node firefox image | `selenium/node-firefox` | | `firefox.tag` | The selenium node firefox tag | `3.11.0` | @@ -118,6 +122,7 @@ The following table lists the configurable parameters of the Selenium chart and | `firefox.nodePort` | The port to listen on | `nil` | | `firefox.seOpts` | Command line arguments to pass to node | `nil` | | `firefox.timeZone` | The time zone for the container | `nil` | +| `firefox.nodeselector` | Node label to use for scheduling of firefox images if set this takes precendence over the global value | `nil` | | `firefoxDebug.enabled` | Schedule a selenium node firefox debug pod | `false` | | `firefoxDebug.image` | The selenium node firefox debug image | `selenium/node-firefox-debug` | | `firefoxDebug.tag` | The selenium node firefox debug tag | `3.11.0` | @@ -136,6 +141,7 @@ The following table lists the configurable parameters of the Selenium chart and | `firefoxDebug.nodePort` | The port to listen on | `nil` | | `firefoxDebug.seOpts` | Command line arguments to pass to node | `nil` | | `firefoxDebug.timeZone` | The time zone for the container | `nil` | +| `firefoxDebug.nodeselector` | Node label to use for scheduling of firefoxDebug images if set this takes precendence over the global value | `nil` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/stable/selenium/templates/chrome-deployment.yaml b/stable/selenium/templates/chrome-deployment.yaml index 59fdcd0428..384c001183 100644 --- a/stable/selenium/templates/chrome-deployment.yaml +++ b/stable/selenium/templates/chrome-deployment.yaml @@ -84,5 +84,11 @@ spec: volumes: {{ if .Values.chrome.volumes -}} {{ toYaml .Values.chrome.volumes | indent 8 }} +{{- end }} + nodeSelector: +{{- if .Values.chrome.nodeSelector }} +{{ toYaml .Values.chrome.nodeSelector | indent 8 }} +{{- else if .Values.global.nodeSelector }} +{{ toYaml .Values.global.nodeSelector | indent 8 }} {{- end -}} -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/stable/selenium/templates/chromeDebug-deployment.yaml b/stable/selenium/templates/chromeDebug-deployment.yaml index 3c37ce51aa..6378c97235 100644 --- a/stable/selenium/templates/chromeDebug-deployment.yaml +++ b/stable/selenium/templates/chromeDebug-deployment.yaml @@ -86,5 +86,11 @@ spec: volumes: {{ if .Values.chromeDebug.volumes -}} {{ toYaml .Values.chromeDebug.volumes | indent 8 }} -{{- end -}} -{{- end -}} +{{- end }} + nodeSelector: +{{- if .Values.chromeDebug.nodeSelector }} +{{ toYaml .Values.chromeDebug.nodeSelector | indent 8 }} +{{- else if .Values.global.nodeSelector }} +{{ toYaml .Values.global.nodeSelector | indent 8 }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/stable/selenium/templates/firefox-deployment.yaml b/stable/selenium/templates/firefox-deployment.yaml index eaa2d40d32..f9e02f139b 100644 --- a/stable/selenium/templates/firefox-deployment.yaml +++ b/stable/selenium/templates/firefox-deployment.yaml @@ -77,4 +77,10 @@ spec: {{- end }} resources: {{ toYaml .Values.firefox.resources | indent 12 }} + nodeSelector: +{{- if .Values.firefox.nodeSelector }} +{{ toYaml .Values.firefox.nodeSelector | indent 8 }} +{{- else if .Values.global.nodeSelector }} +{{ toYaml .Values.global.nodeSelector | indent 8 }} +{{- end }} {{- end -}} diff --git a/stable/selenium/templates/firefoxDebug-deployment.yaml b/stable/selenium/templates/firefoxDebug-deployment.yaml index 20e2de41bf..851bf130ca 100644 --- a/stable/selenium/templates/firefoxDebug-deployment.yaml +++ b/stable/selenium/templates/firefoxDebug-deployment.yaml @@ -79,4 +79,10 @@ spec: {{- end }} resources: {{ toYaml .Values.firefoxDebug.resources | indent 12 }} + nodeSelector: +{{- if .Values.firefoxDebug.nodeSelector }} +{{ toYaml .Values.firefoxDebug.nodeSelector | indent 8 }} +{{- else if .Values.global.nodeSelector }} +{{ toYaml .Values.global.nodeSelector | indent 8 }} +{{- end }} {{- end -}} diff --git a/stable/selenium/templates/hub-deployment.yaml b/stable/selenium/templates/hub-deployment.yaml index 175b725e5a..b5366fd793 100644 --- a/stable/selenium/templates/hub-deployment.yaml +++ b/stable/selenium/templates/hub-deployment.yaml @@ -81,3 +81,9 @@ spec: {{- end }} resources: {{ toYaml .Values.hub.resources | indent 12 }} + nodeSelector: +{{- if .Values.hub.nodeSelector }} +{{ toYaml .Values.hub.nodeSelector | indent 8 }} +{{- else if .Values.global.nodeSelector }} +{{ toYaml .Values.global.nodeSelector | indent 8 }} +{{- end }} diff --git a/stable/selenium/values.yaml b/stable/selenium/values.yaml index e44bebc98b..c4ea4dd61c 100644 --- a/stable/selenium/values.yaml +++ b/stable/selenium/values.yaml @@ -1,3 +1,10 @@ +global: + ## NodeSelector to be used in every deployment + ## hub, chrome, firefox, chromeDebug and firefoxDebug + ## can also be spceifed at chart level see below + nodeSelector: + # label: value + hub: ## The repository and image ## ref: https://hub.docker.com/r/selenium/hub/ @@ -72,6 +79,11 @@ hub: # gridUnregisterIfStillDownAfer: 30000 # timeZone: UTC + ## NodeSelector to be used for the hub + nodeSelector: + # label: value + + chrome: ## Enable the creation of a node-chrome pod enabled: false @@ -143,6 +155,11 @@ chrome: # nodePort: 5555 # timeZone: UTC + ## NodeSelector to be used for chrome + nodeSelector: + # label: value + + chromeDebug: ## Enable the creation of a node-chrome-debug pod enabled: false @@ -214,6 +231,10 @@ chromeDebug: # nodePort: 5555 # timeZone: UTC + ## NodeSelector to be used for chromeDebug + nodeSelector: + # label: value + firefox: ## Enable the creation of a node-firefox pod enabled: false @@ -272,6 +293,10 @@ firefox: # nodePort: 5555 # timeZone: UTC + ## NodeSelector to be used for firefox + nodeSelector: + # label: value + firefoxDebug: ## Enable the creation of a node-firefox-debug pod enabled: false @@ -329,3 +354,7 @@ firefoxDebug: # nodeRegisterCycle: 5000 # nodePort: 5555 # timeZone: UTC + + ## NodeSelector to be used for firefoxDebug + nodeSelector: + # label: value