ea88416c6ac7e27c50e770073eecd45f5f90d553
[it/dep.git] / ric-aux / helm / mc-stack / charts / kibana / templates / ingress.yaml
1 ################################################################################
2 #   Copyright (c) 2019 AT&T Intellectual Property.                             #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
10 #   Unless required by applicable law or agreed to in writing, software        #
11 #   distributed under the License is distributed on an "AS IS" BASIS,          #
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13 #   See the License for the specific language governing permissions and        #
14 #   limitations under the License.                                             #
15 ################################################################################
16
17 {{- if .Values.ingress.enabled -}}
18 {{- $fullName := include "fullname" . -}}
19 {{- $servicePort := .Values.service.port -}}
20 {{- $ingressPath := .Values.ingress.path -}}
21 apiVersion: networking.k8s.io/v1beta1
22 kind: Ingress
23 metadata:
24   name: {{ $fullName }}
25   labels:
26     app: {{ .Chart.Name }}
27     release: {{ .Release.Name }}
28     heritage: {{ .Release.Service }}
29 {{- with .Values.ingress.annotations }}
30   annotations:
31 {{ toYaml . | indent 4 }}
32 {{- end }}
33 spec:
34 {{- if .Values.ingress.tls }}
35   tls:
36 {{ toYaml .Values.ingress.tls | indent 4 }}
37 {{- end }}
38   rules:
39   {{- range .Values.ingress.hosts }}
40     - host: {{ . }}
41       http:
42         paths:
43           - path: {{ $ingressPath }}
44             backend:
45               serviceName: {{ $fullName }}
46               servicePort: {{ $servicePort }}
47   {{- end }}
48 {{- end }}