apiVersion: v1
kind: Service
metadata:
  name: {{ template "redis-ha.fullname" . }}
  labels:
{{ include "labels.standard" . | indent 4 }}
  annotations:
  {{- if .Values.serviceAnnotations }}
{{ toYaml .Values.serviceAnnotations | indent 4 }}
  {{- end }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
  - name: server
    port: {{ .Values.redis.port }}
    protocol: TCP
    targetPort: redis
  - name: sentinel
    port: {{ .Values.sentinel.port }}
    protocol: TCP
    targetPort: sentinel
  selector:
    release: {{ .Release.Name }}
    app: {{ template "redis-ha.name" . }}
