|
1 | 1 | {{- if .Values.ingress.enabled -}} |
2 | 2 | {{- $serviceName := include "docker-auth.fullname" . -}} |
3 | 3 | {{- $servicePort := .Values.service.port -}} |
4 | | -{{- $path := .Values.ingress.path -}} |
5 | | -{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}} |
6 | 4 | apiVersion: networking.k8s.io/v1 |
7 | | -{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" -}} |
8 | | -apiVersion: networking.k8s.io/v1beta1 |
9 | | -{{- else -}} |
10 | | -apiVersion: extensions/v1beta1 |
11 | | -{{- end }} |
12 | 5 | kind: Ingress |
13 | 6 | metadata: |
14 | | - name: {{ template "docker-auth.fullname" . }} |
| 7 | + name: {{ include "docker-auth.fullname" . }} |
| 8 | + namespace: {{ .Release.Namespace }} |
15 | 9 | labels: |
16 | | - app: {{ template "docker-auth.name" . }} |
17 | | - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
18 | | - release: {{ .Release.Name }} |
19 | | - heritage: {{ .Release.Service }} |
20 | | -{{- if .Values.ingress.labels }} |
21 | | -{{ toYaml .Values.ingress.labels | indent 4 }} |
22 | | -{{- end }} |
| 10 | + app.kubernetes.io/name: {{ include "docker-auth.name" . }} |
| 11 | + helm.sh/chart: {{ include "docker-auth.chart" . }} |
| 12 | + app.kubernetes.io/instance: {{ .Release.Name }} |
| 13 | + app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 14 | + {{- with .Values.ingress.labels }} |
| 15 | + {{- toYaml . | nindent 4 }} |
| 16 | + {{- end }} |
| 17 | + {{- with .Values.ingress.annotations }} |
23 | 18 | annotations: |
24 | | - {{- range $key, $value := .Values.ingress.annotations }} |
25 | | - {{ $key }}: {{ $value | quote }} |
26 | | - {{- end }} |
| 19 | + {{- toYaml . | nindent 4 }} |
| 20 | + {{- end }} |
27 | 21 | spec: |
| 22 | + {{- if .Values.ingress.className }} |
| 23 | + ingressClassName: {{ .Values.ingress.className }} |
| 24 | + {{- end }} |
| 25 | + {{- if .Values.ingress.tls }} |
| 26 | + tls: |
| 27 | + {{- range .Values.ingress.tls }} |
| 28 | + - hosts: |
| 29 | + {{- range .hosts }} |
| 30 | + - {{ . | quote }} |
| 31 | + {{- end }} |
| 32 | + secretName: {{ .secretName }} |
| 33 | + {{- end }} |
| 34 | + {{- end }} |
28 | 35 | rules: |
29 | | - {{- range $host := .Values.ingress.hosts }} |
30 | | - - host: {{ $host }} |
| 36 | + {{- range .Values.ingress.hosts }} |
| 37 | + - host: {{ .host | quote }} |
31 | 38 | http: |
32 | 39 | paths: |
33 | | - - path: {{ $path }} |
34 | | - {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} |
35 | | - pathType: Prefix |
36 | | - {{- end }} |
| 40 | + {{- range .paths }} |
| 41 | + - path: {{ .path }} |
| 42 | + pathType: {{ .pathType | default "Prefix" }} |
37 | 43 | backend: |
38 | | - {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} |
39 | 44 | service: |
40 | 45 | name: {{ $serviceName }} |
41 | 46 | port: |
42 | 47 | number: {{ $servicePort }} |
43 | | - {{- else }} |
44 | | - serviceName: {{ $serviceName }} |
45 | | - servicePort: {{ $servicePort }} |
46 | | - {{- end }} |
47 | | - {{- end -}} |
48 | | - {{- if .Values.ingress.tls }} |
49 | | - tls: |
50 | | -{{ toYaml .Values.ingress.tls | indent 4 }} |
51 | | - {{- end -}} |
52 | | -{{- end -}} |
| 48 | + {{- end }} |
| 49 | + {{- end }} |
| 50 | +{{- end }} |
0 commit comments