blob: 811ce86ffc369c58ffbfd39ac3e376c645bfdf44 [file] [log] [blame]
Joey Armstrong623b29d2024-02-10 21:12:11 -05001# Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors
David K. Bainbridge637751d2021-03-25 22:18:08 +00002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14{{- if .Values.etcd.ingress.enabled -}}
15---
16apiVersion: networking.k8s.io/v1
17kind: Ingress
18metadata:
19 name: "{{ .Release.Name }}-etcd"
20 namespace: {{ .Release.Namespace }}
21 {{- with .Values.etcd.labels }}
22 labels:
23 {{- toYaml . | nindent 4 }}
24 {{- end }}
25 {{- with .Values.etcd.ingress.annotations }}
26 annotations:
27 {{- toYaml . | nindent 4 }}
28 {{- end }}
29spec:
30 {{- if .Values.etcd.ingress.tls }}
31 tls:
32 {{- range .Values.etcd.ingress.tls }}
33 - hosts:
34 {{- range .hosts }}
35 - {{ . | quote }}
36 {{- end }}
37 secretName: {{ .secretName }}
38 {{- end }}
39 {{- end }}
40 rules:
41 {{- range .Values.etcd.ingress.hosts }}
42 {{- if $.Values.etcd.ingress.enableVirtualHosts }}
43 - host: '{{ $.Release.Name }}.local'
44 http:
45 {{- else }}
46 {{- if .host }}
47 - host: {{ .host | quote }}
48 http:
49 {{- else }}
50 - http:
51 {{- end }}
52 {{- end }}
53 paths:
54 {{- range .paths }}
55 - path: {{ . }}
56 pathType: Prefix
57 backend:
58 service:
59 name: "{{ $.Release.Name }}-etcd"
60 port:
61 number: 2379
62 {{- end }}
63 {{- end }}
64{{- end }}