|
| 1 | +{{- if and .Values.ingress.enabled .Values.ingress.update.enabled }} |
| 2 | +{{- $fullName := include "nebraska.fullname" . }} |
| 3 | +{{- $svcPort := .Values.service.port }} |
| 4 | +{{- $kubeGitVersion := .Capabilities.KubeVersion.GitVersion }} |
| 5 | +{{- if semverCompare ">=1.19-0" $kubeGitVersion }} |
| 6 | +apiVersion: networking.k8s.io/v1 |
| 7 | +{{- else if semverCompare ">=1.14-0" $kubeGitVersion }} |
| 8 | +apiVersion: networking.k8s.io/v1beta1 |
| 9 | +{{- else }} |
| 10 | +apiVersion: extensions/v1beta1 |
| 11 | +{{- end }} |
| 12 | +kind: Ingress |
| 13 | +metadata: |
| 14 | + name: {{ $fullName | trunc 56 | trimSuffix "-" }}-update |
| 15 | + labels: |
| 16 | + {{- include "nebraska.labels" . | nindent 4 }} |
| 17 | + {{- with .Values.ingress.update.annotations }} |
| 18 | + annotations: |
| 19 | + {{- toYaml . | nindent 4 }} |
| 20 | + {{- end }} |
| 21 | +spec: |
| 22 | + {{- if .Values.ingress.tls }} |
| 23 | + tls: |
| 24 | + {{- range .Values.ingress.tls }} |
| 25 | + - hosts: |
| 26 | + {{- range .hosts }} |
| 27 | + - {{ . | quote }} |
| 28 | + {{- end }} |
| 29 | + secretName: {{ .secretName }} |
| 30 | + {{- end }} |
| 31 | + {{- end }} |
| 32 | + rules: |
| 33 | + {{- range .Values.ingress.hosts }} |
| 34 | + - host: {{ . | quote }} |
| 35 | + http: |
| 36 | + paths: |
| 37 | + - path: /v1/update |
| 38 | + backend: |
| 39 | + {{- if semverCompare ">=1.19-0" $kubeGitVersion }} |
| 40 | + service: |
| 41 | + name: {{ $fullName }} |
| 42 | + port: |
| 43 | + number: {{ $svcPort }} |
| 44 | + pathType: ImplementationSpecific |
| 45 | + {{- else }} |
| 46 | + serviceName: {{ $fullName }} |
| 47 | + servicePort: {{ $svcPort }} |
| 48 | + {{- end }} |
| 49 | + {{- if $.Values.config.hostFlatcarPackages.enabled }} |
| 50 | + {{- if regexFind ( printf "://%s(:[0-9]+)?/" . ) ( default "" $.Values.config.hostFlatcarPackages.nebraskaURL ) }} |
| 51 | + - path: {{ regexReplaceAll "^[^/]+://[^/]+" $.Values.config.hostFlatcarPackages.nebraskaURL "" | trimAll "/" }}/flatcar |
| 52 | + {{- else }} |
| 53 | + - path: /flatcar |
| 54 | + {{- end }} |
| 55 | + backend: |
| 56 | + {{- if semverCompare ">=1.19-0" $kubeGitVersion }} |
| 57 | + service: |
| 58 | + name: {{ $fullName }} |
| 59 | + port: |
| 60 | + number: {{ $svcPort }} |
| 61 | + pathType: ImplementationSpecific |
| 62 | + {{- else }} |
| 63 | + serviceName: {{ $fullName }} |
| 64 | + servicePort: {{ $svcPort }} |
| 65 | + {{- end }} |
| 66 | + {{- end }} |
| 67 | + {{- end }} |
| 68 | + {{- end }} |
0 commit comments