{{- if .Values.ingress.enabled }} {{- $fullName := include "wordpress.fullname" . -}} {{- $labels := include "wordpress.labels" . -}} {{- $svcPort := .Values.service.port -}} {{- with .Values.ingress }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} labels: {{- $labels | nindent 4 }} {{- with .labels }} {{- toYaml . | nindent 4 }} {{- end }} annotations: {{- if .maxBodySize }} nginx.ingress.kubernetes.io/proxy-body-size: {{ .maxBodySize }} {{- end }} {{- with .annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if .className }} ingressClassName: {{ .className }} {{- end }} {{- if .tls }} tls: {{- range .tls }} - hosts: {{- range .hosts }} - {{ . | quote }} {{- end }} secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- range .hosts }} - host: {{ .host | quote }} http: paths: {{- range .paths }} - path: {{ .path }} pathType: {{ .pathType }} backend: service: name: {{ $fullName }} port: number: {{ $svcPort }} {{- end }} {{- end }} {{- end }} {{- end }}