{{- if .Values.ingress.enabled -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: {{- if .Values.ingress.redirection.enabled}} annotations: kubernetes.io/tls-acme: "true" nginx.ingress.kubernetes.io/permanent-redirect-code: "301" #kubernetes.io/ingress.class: "nginx" ingress.kubernetes.io/ssl-redirect: "true" ingress.kubernetes.io/secure-backends: "true" ingress.kubernetes.io/force-ssl-redirect: "true" {{- end }} name: {{ .Values.ingress.name }} spec: ingressClassName: nginx rules: - host: {{ .Values.ingress.host }} http: paths: - pathType: Prefix backend: service: name: {{ .Values.ingress.service.name }} port: number: {{ .Values.ingress.service.port.number }} path: / {{- if .Values.ingress.tls.enabled}} tls: - hosts: {{- range $.Values.ingress.tls.hosts }} - {{ . | quote }} {{- end }} secretName: {{ .Values.ingress.tls.secretName }} {{- end }} {{- end }}