Commit fe4c816b authored by Dominik Hebeler's avatar Dominik Hebeler

added redirects for additional hosts

parent 1081d72d
......@@ -146,6 +146,7 @@ development:
- development
kubernetes: active
variables:
HELM_UPGRADE_VALUES_FILE: .gitlab/development-values.yaml
HELM_UPGRADE_EXTRA_ARGS: --set service.externalPort=80 --set service.internalPort=80 --set service.commonName= --set ingress.annotations.certmanager\.k8s\.io/cluster-issuer=letsencrypt-prod
ROLLOUT_RESOURCE_TYPE: deployment
environment:
......
service:
externalPort: 80
internalPort: 80
commonName: ""
redirectHosts:
- www.metager3.de
ingress:
annotations:
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
\ No newline at end of file
{{- if .Values.service.redirectHosts }}
{{- if .Values.service.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "fullname" . }}-redirects
labels:
app: {{ template "appname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version| replace "+" "_" }}"
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
ingress.kubernetes.io/configuration-snippet: "return 301 $scheme://{{ template "hostname" .Values.service.url }}$request_uri;"
spec:
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
{{- range $host := .Values.service.redirectHosts }}
- {{ $host }}
{{- end -}}
secretName: {{ .Values.ingress.tls.secretName | default (printf "%s-redirects-tls" (include "fullname" .)) }}
{{- end }}
rules:
{{- range $host := .Values.service.additionalHosts }}
- host: {{ $host }}
http:
paths:
- path: /
backend:
serviceName: {{ template "fullname" . }}
servicePort: {{ .Values.service.externalPort }}
{{- end -}}
{{- end }}
{{- end }}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment