cloud/Gargantua/helm/templates/ingress.yaml
2024-10-14 09:51:55 +03:00

109 lines
3.1 KiB
YAML

{{- if or .Values.ingress.enabled -}}
{{/* The 'values' customized ingress */}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "gargantua.fullname" . }}
labels:
{{- include "gargantua.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
backend:
service:
name: {{ include "gargantua.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- else if and (eq .Values.profile "siatelRo") .Values.siatelRo.ingress.enabled -}}
{{/* The siatelRo standard ingress */}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "gargantua.fullname" . }}
labels:
{{- include "gargantua.labels" . | nindent 4 }}
annotations:
cert-manager.io/ClusterIssuer: {{ .Values.siatelRo.ingress.clusterIssuer }}
kubernetes.io/ingress.class: nginx
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: nginx
tls:
- hosts:
- "{{ .Release.Name }}.{{ .Values.siatelRo.cloud }}"
secretName: "{{ .Release.Name }}-ingress-tls"
rules:
- host: "{{ .Release.Name }}.{{ .Values.siatelRo.cloud }}"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: {{ include "gargantua.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- else if and (eq .Values.profile "siatelCom") .Values.siatelCom.ingress.enabled -}}
{{/* The siatelCom standard ingress */}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "gargantua.fullname" . }}
labels:
{{- include "gargantua.labels" . | nindent 4 }}
annotations:
cert-manager.io/ClusterIssuer: {{ .Values.siatelCom.ingress.clusterIssuer }}
kubernetes.io/ingress.class: nginx
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: nginx
tls:
- hosts:
- "{{ .Release.Name }}.{{ .Values.siatelCom.cloud }}"
secretName: "{{ .Release.Name }}-ingress-tls"
rules:
- host: "{{ .Release.Name }}.{{ .Values.siatelCom.cloud }}"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: {{ include "gargantua.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}