Extend K8S and RIC installation instructions
[it/dep.git] / ric-aux / 80-Auxiliary-Functions / helm / mc-stack / charts / elasticsearch / templates / service.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 ---
18 kind: Service
19 apiVersion: v1
20 metadata:
21   name: {{ template "uname" . }}
22   labels:
23     heritage: {{ .Release.Service | quote }}
24     release: {{ .Release.Name | quote }}
25     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
26     app: "{{ template "uname" . }}"
27   annotations:
28 {{ toYaml .Values.service.annotations | indent 4 }}
29 spec:
30   type: {{ .Values.service.type }}
31   selector:
32     heritage: {{ .Release.Service | quote }}
33     release: {{ .Release.Name | quote }}
34     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
35     app: "{{ template "uname" . }}"
36   ports:
37   - name: http
38     protocol: TCP
39     port: {{ .Values.httpPort }}
40 {{- if .Values.service.nodePort }}
41     nodePort: {{ .Values.service.nodePort }}
42 {{- end }}
43   - name: transport
44     protocol: TCP
45     port: {{ .Values.transportPort }}
46 ---
47 kind: Service
48 apiVersion: v1
49 metadata:
50   name: {{ template "uname" . }}-headless
51   labels:
52     heritage: {{ .Release.Service | quote }}
53     release: {{ .Release.Name | quote }}
54     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
55     app: "{{ template "uname" . }}"
56   annotations:
57     service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
58 spec:
59   clusterIP: None # This is needed for statefulset hostnames like elasticsearch-0 to resolve
60   # Create endpoints also if the related pod isn't ready
61   publishNotReadyAddresses: true
62   selector:
63     app: "{{ template "uname" . }}"
64   ports:
65   - name: http
66     port: {{ .Values.httpPort }}
67   - name: transport
68     port: {{ .Values.transportPort }}