svc-headless.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. {{- if eq .Values.architecture "replication" }}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: {{ include "mysql.secondary.fullname" . }}-headless
  6. namespace: {{ include "common.names.namespace" . | quote }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. app.kubernetes.io/component: secondary
  9. {{- if .Values.commonLabels }}
  10. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  11. {{- end }}
  12. {{- if or .Values.secondary.service.headless.annotations .Values.commonAnnotations }}
  13. annotations:
  14. {{- if .Values.secondary.service.headless.annotations }}
  15. {{- include "common.tplvalues.render" (dict "value" .Values.secondary.service.headless.annotations "context" $) | nindent 4 }}
  16. {{- end }}
  17. {{- if .Values.commonAnnotations }}
  18. {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  19. {{- end }}
  20. {{- end }}
  21. spec:
  22. type: ClusterIP
  23. clusterIP: None
  24. publishNotReadyAddresses: true
  25. ports:
  26. - name: mysql
  27. port: {{ .Values.secondary.service.ports.mysql }}
  28. targetPort: mysql
  29. selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
  30. app.kubernetes.io/component: secondary
  31. {{- end }}