From 6305849dc2fd2628333374e265a0da7badc817c2 Mon Sep 17 00:00:00 2001 From: Arnaud Deprez Date: Sun, 7 Oct 2018 19:19:16 +0200 Subject: [PATCH] add optional ingress for selenium chart (#8243) Signed-off-by: Arnaud Deprez --- stable/selenium/Chart.yaml | 2 +- stable/selenium/README.md | 5 ++++ stable/selenium/templates/ingress.yaml | 38 ++++++++++++++++++++++++++ stable/selenium/values.yaml | 12 ++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 stable/selenium/templates/ingress.yaml diff --git a/stable/selenium/Chart.yaml b/stable/selenium/Chart.yaml index 2bcc26cc6a..5c2b692fcd 100644 --- a/stable/selenium/Chart.yaml +++ b/stable/selenium/Chart.yaml @@ -1,5 +1,5 @@ name: selenium -version: 0.10.0 +version: 0.11.0 appVersion: 3.14.0 description: Chart for selenium grid keywords: diff --git a/stable/selenium/README.md b/stable/selenium/README.md index 32d3ea81c8..699512cb7c 100644 --- a/stable/selenium/README.md +++ b/stable/selenium/README.md @@ -64,6 +64,11 @@ The following table lists the configurable parameters of the Selenium chart and | `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 precedence over the global value | `nil` | +| `hub.ingress.enabled` | Configure an ingress for the selenium hub | `false` | +| `hub.ingress.annotations` | Annotations for the ingress for the selenium hub | `nil` | +| `hub.ingress.path` | The path for this ingress from which to route the traffic to the selenium hub | `/` | +| `hub.ingress.hosts` | The list hosts for which this ingress should resolve the selenium hub | `[selenium-hub.local]` | +| `hub.ingress.tls` | The tls secret to configure ssl for this ingress | `[]` | | `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.14.0` | diff --git a/stable/selenium/templates/ingress.yaml b/stable/selenium/templates/ingress.yaml new file mode 100644 index 0000000000..cd3949c331 --- /dev/null +++ b/stable/selenium/templates/ingress.yaml @@ -0,0 +1,38 @@ +{{- if .Values.hub.ingress.enabled -}} +{{- $fullName := include "selenium.hub.fullname" . -}} +{{- $ingressPath := .Values.hub.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ template "selenium.hub.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +{{- with .Values.hub.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.hub.ingress.tls }} + tls: + {{- range .Values.hub.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.hub.ingress.hosts }} + - host: {{ . | quote }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: hub + {{- end }} +{{- end }} \ No newline at end of file diff --git a/stable/selenium/values.yaml b/stable/selenium/values.yaml index 7d8901e4c7..721b8180ba 100644 --- a/stable/selenium/values.yaml +++ b/stable/selenium/values.yaml @@ -90,6 +90,18 @@ hub: ## NodeSelector to be used for the hub nodeSelector: # label: value + ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - selenium-hub.local + tls: [] + # - secretName: selenium-hub-tls + # hosts: + # - selenium-hub.local chrome: