Skip to content

Commit

Permalink
Merge pull request #6 from near-daos/feature/shorthand-dns
Browse files Browse the repository at this point in the history
Added shorthand dns for mainnet
  • Loading branch information
okalenyk authored Jan 21, 2022
2 parents de5f6db + 8ffb348 commit 185fde3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions deployment/app-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
10 changes: 7 additions & 3 deletions deployment/app-chart/templates/ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit 185fde3

Please sign in to comment.