-
Notifications
You must be signed in to change notification settings - Fork 215
/
nginx-ingress-devops.yaml
69 lines (68 loc) · 1.91 KB
/
nginx-ingress-devops.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright (c) 2023 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "ditto.fullname" . -}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-devops
labels:
app.kubernetes.io/name: {{ include "ditto.name" . }}-nginx
{{ include "ditto.labels" . | indent 4 }}
annotations:
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.ingress.devops.annotations }}
{{- with .Values.ingress.devops.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
{{- with .Values.ingress.api.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
defaultBackend:
service:
name: {{ $fullName }}-{{ .Values.ingress.defaultBackendSuffix }}
port:
name: http
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
{{- range .Values.ingress.devops.paths }}
- path: {{ .path }}
{{- if .pathType }}
pathType: {{ .pathType }}
{{- else }}
pathType: Prefix
{{- end }}
backend:
service:
name: {{ $fullName }}-{{ .backendSuffix }}
port:
name: http
{{- end }}
{{- end }}