apiVersion: v1 kind: Service metadata: name: {{ include "elasticsearch.master.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: master annotations: {{ include "common.tplvalues.render" ( dict "value" .Values.master.service.annotations "context" $) | nindent 4 }} spec: type: {{ .Values.master.service.type | quote }} {{- if and (eq .Values.master.service.type "LoadBalancer") (not (empty .Values.master.service.loadBalancerIP)) }} loadBalancerIP: {{ .Values.master.service.loadBalancerIP }} {{- end }} publishNotReadyAddresses: true ports: - name: http port: 9200 targetPort: http - name: tcp-transport port: {{ .Values.master.service.port }} targetPort: transport {{- if and (or (eq .Values.master.service.type "NodePort") (eq .Values.master.service.type "LoadBalancer")) (not (empty .Values.master.service.nodePort)) }} nodePort: {{ .Values.master.service.nodePort }} {{- else if eq .Values.master.service.type "ClusterIP" }} nodePort: null {{- end }} selector: {{- include "common.labels.matchLabels" . | nindent 4 }} app.kubernetes.io/component: master