svc-headless.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: {{ printf "%s-%s" (include "common.names.fullname" .) (default "headless" .Values.service.headless.servicenameOverride) | trunc 63 | trimSuffix "-" }}
  5. namespace: {{ template "zookeeper.namespace" . }}
  6. labels: {{- include "common.labels.standard" . | nindent 4 }}
  7. app.kubernetes.io/component: zookeeper
  8. {{- if .Values.commonLabels }}
  9. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. {{- if or .Values.commonAnnotations .Values.service.headless.annotations }}
  12. annotations:
  13. {{- if .Values.service.headless.annotations }}
  14. {{- include "common.tplvalues.render" ( dict "value" .Values.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: {{ .Values.service.headless.publishNotReadyAddresses }}
  24. ports:
  25. {{- if not .Values.service.disableBaseClientPort }}
  26. - name: tcp-client
  27. port: {{ .Values.service.ports.client }}
  28. targetPort: client
  29. {{- end }}
  30. {{- if .Values.tls.client.enabled }}
  31. - name: tcp-client-tls
  32. port: {{ .Values.service.ports.tls }}
  33. targetPort: client-tls
  34. {{- end }}
  35. - name: tcp-follower
  36. port: {{ .Values.service.ports.follower }}
  37. targetPort: follower
  38. - name: tcp-election
  39. port: {{ .Values.service.ports.election }}
  40. targetPort: election
  41. selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
  42. app.kubernetes.io/component: zookeeper