headless-svc.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: {{ printf "%s-headless" (include "common.names.fullname" .) }}
  5. namespace: {{ .Release.Namespace | quote }}
  6. labels: {{- include "common.labels.standard" . | nindent 4 }}
  7. {{- if .Values.commonLabels }}
  8. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  9. {{- end }}
  10. annotations:
  11. {{- if .Values.sentinel.service.headless.annotations }}
  12. {{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.service.headless.annotations "context" $) | nindent 4 }}
  13. {{- end }}
  14. {{- if .Values.commonAnnotations }}
  15. {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  16. {{- end }}
  17. {{- include "redis.externalDNS.annotations" . | nindent 4 }}
  18. spec:
  19. type: ClusterIP
  20. clusterIP: None
  21. {{- if .Values.sentinel.enabled }}
  22. publishNotReadyAddresses: true
  23. {{- end }}
  24. ports:
  25. - name: tcp-redis
  26. port: {{ if .Values.sentinel.enabled }}{{ .Values.sentinel.service.ports.redis }}{{ else }}{{ .Values.master.service.ports.redis }}{{ end }}
  27. targetPort: redis
  28. {{- if .Values.sentinel.enabled }}
  29. - name: tcp-sentinel
  30. port: {{ .Values.sentinel.service.ports.sentinel }}
  31. targetPort: redis-sentinel
  32. {{- end }}
  33. selector: {{- include "common.labels.matchLabels" . | nindent 4 }}