svc-headless.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. {{- /*
  2. Copyright Broadcom, Inc. All Rights Reserved.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. apiVersion: v1
  6. kind: Service
  7. metadata:
  8. name: {{ printf "%s-%s" (include "common.names.fullname" .) (default "headless" .Values.service.headless.servicenameOverride) | trunc 63 | trimSuffix "-" }}
  9. namespace: {{ template "zookeeper.namespace" . }}
  10. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  11. app.kubernetes.io/component: zookeeper
  12. {{- if or .Values.commonAnnotations .Values.service.headless.annotations }}
  13. {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.service.headless.annotations .Values.commonAnnotations ) "context" . ) }}
  14. annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
  15. {{- end }}
  16. spec:
  17. type: ClusterIP
  18. clusterIP: None
  19. publishNotReadyAddresses: {{ .Values.service.headless.publishNotReadyAddresses }}
  20. ports:
  21. {{- if not .Values.service.disableBaseClientPort }}
  22. - name: tcp-client
  23. port: {{ .Values.service.ports.client }}
  24. targetPort: client
  25. {{- end }}
  26. {{- if .Values.tls.client.enabled }}
  27. - name: tcp-client-tls
  28. port: {{ .Values.service.ports.tls }}
  29. targetPort: client-tls
  30. {{- end }}
  31. - name: tcp-follower
  32. port: {{ .Values.service.ports.follower }}
  33. targetPort: follower
  34. - name: tcp-election
  35. port: {{ .Values.service.ports.election }}
  36. targetPort: election
  37. {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
  38. selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
  39. app.kubernetes.io/component: zookeeper