{{- if eq .Values.global.deploymentMode "development" }}
apiVersion: v1
kind: Service
metadata:
  name: redash-admin-redis-headless
  namespace: {{ .Release.Namespace }}
  labels:
    app: redis-admin
    chart: {{ template "redis.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
spec:
  type: ClusterIP
  clusterIP: None
  ports:
    - name: redis
      port: {{ .Values.redisPort }}
      targetPort: redis
  {{- if .Values.sentinel.enabled }}
    - name: redis-sentinel
      port: {{ .Values.sentinel.port }}
      targetPort: redis-sentinel
  {{- end }}
  selector:
    app: redis-admin
    release: {{ .Release.Name }}
{{- end }}
