svc-headless.yaml 1.2 KB

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