From 8ffb348fe78341ea3be008f3ebb6a599eb152097 Mon Sep 17 00:00:00 2001 From: vladimir-ilyashenko Date: Fri, 21 Jan 2022 16:15:21 +0200 Subject: [PATCH] Added shorthand dns for mainnet --- deployment/app-chart/templates/_helpers.tpl | 11 +++++++++++ deployment/app-chart/templates/ingress.yml | 10 +++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/deployment/app-chart/templates/_helpers.tpl b/deployment/app-chart/templates/_helpers.tpl index 6d7e72c..d897f3e 100644 --- a/deployment/app-chart/templates/_helpers.tpl +++ b/deployment/app-chart/templates/_helpers.tpl @@ -66,3 +66,14 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +We want short dns name for mainnet +*/}} +{{- define "dao-stats-ui.hosts" -}} +{{- if hasPrefix "mainnet-" .Values.ingress.host -}} + {{ toJson (list (trimPrefix "mainnet-" .Values.ingress.host) .Values.ingress.host) }} +{{- else -}} + {{ toJson (list .Values.ingress.host) }} +{{- end -}} +{{- end -}} diff --git a/deployment/app-chart/templates/ingress.yml b/deployment/app-chart/templates/ingress.yml index 2c67ebd..8458d62 100644 --- a/deployment/app-chart/templates/ingress.yml +++ b/deployment/app-chart/templates/ingress.yml @@ -10,16 +10,20 @@ spec: ingressClassName: nginx tls: - hosts: - - {{ .Values.ingress.host }} +{{- range include "dao-stats-ui.hosts" . | fromJsonArray }} + - {{ . }} +{{- end}} secretName: {{ include "dao-stats-ui.fullname" . }}-tls-secret rules: - - host: {{ .Values.ingress.host }} +{{- range include "dao-stats-ui.hosts" . | fromJsonArray }} + - host: {{ . }} http: paths: - path: / backend: service: - name: {{ include "dao-stats-ui.fullname" . }} + name: {{ include "dao-stats-ui.fullname" $ }} port: number: 80 pathType: ImplementationSpecific +{{- end}}