From 5d0e3402e3fe84d6628ba866edfb6eaecfa9b337 Mon Sep 17 00:00:00 2001 From: michaeljguarino Date: Wed, 15 Nov 2023 14:39:17 -0500 Subject: [PATCH] Support external ingress configuration (#505) --- plural/helm/console/Chart.yaml | 4 +-- plural/helm/console/templates/_helpers.tpl | 4 +++ plural/helm/console/templates/ingress.yaml | 30 ++++++++++++++++++++++ plural/helm/console/values.yaml | 11 ++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/plural/helm/console/Chart.yaml b/plural/helm/console/Chart.yaml index 4a6aef71f4..ed63b46b4c 100644 --- a/plural/helm/console/Chart.yaml +++ b/plural/helm/console/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 name: console description: A chart for plural console -appVersion: 0.6.5 -version: 0.7.90 +appVersion: 0.6.6 +version: 0.7.91 dependencies: - name: test-base version: 0.1.10 diff --git a/plural/helm/console/templates/_helpers.tpl b/plural/helm/console/templates/_helpers.tpl index ab17d1b8b3..c1d11276c4 100644 --- a/plural/helm/console/templates/_helpers.tpl +++ b/plural/helm/console/templates/_helpers.tpl @@ -59,6 +59,10 @@ spec: {{ .Values.secrets.config | toYaml | nindent 2 }} {{- define "console.env" -}} - name: HOST value: {{ .Values.ingress.console_dns }} +{{- if .Values.externalIngress.hostname }} +- name: EXT_HOST + value: {{ .Values.externalIngress.hostname | quote }} +{{- end }} - name: DEPLOYED_AT value: {{ now | unixEpoch | quote }} - name: NAMESPACE diff --git a/plural/helm/console/templates/ingress.yaml b/plural/helm/console/templates/ingress.yaml index 4f3b223b0e..909f0b8aac 100644 --- a/plural/helm/console/templates/ingress.yaml +++ b/plural/helm/console/templates/ingress.yaml @@ -25,3 +25,33 @@ spec: name: console port: name: http +{{ if .Values.externalIngress.hostname }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: console-external + labels: +{{ include "console.labels" . | indent 4 }} + {{- with .Values.externalIngress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: {{ .Values.externalIngress.ingressClass }} + tls: + - hosts: + - {{ .Values.externalIngress.hostname | quote }} + secretName: console-external-tls + rules: + - host: {{ .Values.externalIngress.hostname | quote }} + http: + paths: + - path: /ext + pathType: Prefix + backend: + service: + name: console + port: + name: http +{{ end }} \ No newline at end of file diff --git a/plural/helm/console/values.yaml b/plural/helm/console/values.yaml index 2be29db39e..e0dc38d042 100644 --- a/plural/helm/console/values.yaml +++ b/plural/helm/console/values.yaml @@ -97,6 +97,17 @@ ingress: nginx.ingress.kubernetes.io/proxy-send-timeout: '3600' nginx.ingress.kubernetes.io/session-cookie-path: /socket +externalIngress: + ingressClass: nginx + annotations: + kubernetes.io/tls-acme: "true" + cert-manager.io/cluster-issuer: letsencrypt-prod + nginx.ingress.kubernetes.io/affinity: cookie + nginx.ingress.kubernetes.io/force-ssl-redirect: 'true' + nginx.ingress.kubernetes.io/proxy-read-timeout: '3600' + nginx.ingress.kubernetes.io/proxy-send-timeout: '3600' + nginx.ingress.kubernetes.io/session-cookie-path: /ext/socket + postgres: resources: {} replicas: 1