kind: Service apiVersion: v1 metadata: name: {{ template "uname" . }}-headless labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app: "{{ template "uname" . }}" caas_app: "{{ template "appname" . }}" annotations: # Create endpoints also if the related pod isn't ready service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" spec: clusterIP: None # This is needed for statefulset hostnames like elasticsearch-0 to resolve selector: app: "{{ template "uname" . }}" ports: - name: logstashapi port: {{ .Values.httpPort }} --- {{- if eq .Values.nodePort "enabled" }} kind: Service apiVersion: v1 metadata: name: "ls-{{ template "environment" . }}-{{ template "appname" . }}{{ .Values.zone }}-svc" labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" app: "{{ template "uname" . }}" spec: type: NodePort selector: app: "{{ template "uname" . }}" ports: - name: logstashapi protocol: TCP port: {{ .Values.httpPort }} - name: lsapi protocol: TCP port: {{ .Values.httpPortApi }} targetPort: 8080 {{- end }}