{{- if .Values.ingress.enabled -}} {{- $fullName := include "caduser.fullname" . -}} {{- $svcPort := .Values.service.port -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} labels: {{- include "caduser.labels" . | nindent 4 }} annotations: kubernetes.io/ingress.class: {{ .Values.ingress.class }} {{- if .Values.ingress.tls.enabled }} cert-manager.io/cluster-issuer: letsencrypt-production {{- end }} {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if .Values.ingress.tls.enabled }} tls: - hosts: - {{ .Values.caduser.hostname }} secretName: {{ $fullName }}-tls {{- end }} rules: - host: {{ .Values.caduser.hostname }} http: paths: - path: / pathType: Prefix backend: service: name: {{ $fullName }} port: number: {{ $svcPort }} {{- end }}