|
1 |
| -{{- if .Values.ingress.enabled -}} |
2 |
| -{{- $fullName := include "jupyter.fullname" . -}} |
3 |
| -{{- $ingressPath := .Values.ingress.path -}} |
4 |
| -apiVersion: extensions/v1beta1 |
| 1 | + |
| 2 | +{{- if .Values.ingress.enabled }} |
| 3 | +apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} |
5 | 4 | kind: Ingress
|
6 | 5 | metadata:
|
7 |
| - name: {{ $fullName }} |
8 |
| - labels: |
9 |
| - app.kubernetes.io/name: {{ include "jupyter.name" . }} |
10 |
| - {{- include "jupyter.labels" . | nindent 4 }} |
11 |
| - {{- if .Values.ingress.labels }} |
12 |
| - {{ toYaml .Values.ingress.labels | indent 4 }} |
13 |
| - {{- end }} |
14 |
| -{{- with .Values.ingress.annotations }} |
| 6 | + name: {{ include "common.names.fullname" . }} |
| 7 | + namespace: {{ .Release.Namespace | quote }} |
| 8 | + labels: {{- include "common.labels.standard" . | nindent 4 }} |
| 9 | + {{- if .Values.commonLabels }} |
| 10 | + {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 11 | + {{- end }} |
| 12 | + {{- if or .Values.ingress.annotations .Values.commonAnnotations .Values.ingress.certManager }} |
15 | 13 | annotations:
|
16 |
| -{{ toYaml . | indent 4 }} |
17 |
| -{{- end }} |
| 14 | + {{- if .Values.ingress.certManager }} |
| 15 | + kubernetes.io/tls-acme: "true" |
| 16 | + {{- end }} |
| 17 | + {{- if .Values.ingress.annotations }} |
| 18 | + {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.annotations "context" $) | nindent 4 }} |
| 19 | + {{- end }} |
| 20 | + {{- if .Values.commonAnnotations }} |
| 21 | + {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} |
| 22 | + {{- end }} |
| 23 | + {{- end }} |
18 | 24 | spec:
|
19 |
| -{{- if .Values.ingress.tls }} |
20 |
| - tls: |
21 |
| - {{- range .Values.ingress.tls }} |
22 |
| - - hosts: |
23 |
| - {{- range .hosts }} |
24 |
| - - {{ . }} |
25 |
| - {{- end }} |
26 |
| - secretName: {{ .secretName }} |
| 25 | + {{- if .Values.ingress.ingressClassName }} |
| 26 | + ingressClassName: {{ .Values.ingress.ingressClassName | quote }} |
27 | 27 | {{- end }}
|
28 |
| -{{- end }} |
29 | 28 | rules:
|
30 |
| - {{- range .Values.ingress.hosts }} |
31 |
| - - host: {{ . }} |
| 29 | + {{- if .Values.ingress.hostname }} |
| 30 | + - host: {{ .Values.ingress.hostname }} |
32 | 31 | http:
|
33 | 32 | paths:
|
34 |
| - - path: {{ $ingressPath }} |
35 |
| - backend: |
36 |
| - serviceName: {{ $fullName }} |
37 |
| - servicePort: web |
| 33 | + {{- if .Values.ingress.extraPaths }} |
| 34 | + {{- toYaml .Values.ingress.extraPaths | nindent 10 }} |
| 35 | + {{- end }} |
| 36 | + - path: {{ .Values.ingress.path }} |
| 37 | + {{- if eq "true" (include "common.ingress.supportsPathType" .) }} |
| 38 | + pathType: {{ .Values.ingress.pathType }} |
| 39 | + {{- end }} |
| 40 | + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" "http" "context" $) | nindent 14 }} |
| 41 | + {{- end }} |
| 42 | + {{- range .Values.ingress.extraHosts }} |
| 43 | + - host: {{ .name | quote }} |
| 44 | + http: |
| 45 | + paths: |
| 46 | + - path: {{ default "/" .path }} |
| 47 | + {{- if eq "true" (include "common.ingress.supportsPathType" $) }} |
| 48 | + pathType: {{ default "ImplementationSpecific" .pathType }} |
| 49 | + {{- end }} |
| 50 | + backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "http" "context" $) | nindent 14 }} |
| 51 | + {{- end }} |
| 52 | + {{- if or (and .Values.ingress.tls (or .Values.ingress.certManager .Values.ingress.selfSigned)) .Values.ingress.extraTls }} |
| 53 | + tls: |
| 54 | + {{- if and .Values.ingress.tls (or .Values.ingress.certManager .Values.ingress.selfSigned) }} |
| 55 | + - hosts: |
| 56 | + - {{ .Values.ingress.hostname | quote }} |
| 57 | + secretName: {{ printf "%s-tls" .Values.ingress.hostname }} |
| 58 | + {{- end }} |
| 59 | + {{- if .Values.ingress.extraTls }} |
| 60 | + {{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }} |
| 61 | + {{- end }} |
38 | 62 | {{- end }}
|
39 | 63 | {{- end }}
|
0 commit comments