svc-headless.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: {{ template "common.names.fullname" . }}-headless
  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.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.publishNotReadyAddresses }}
  24. ports:
  25. {{ if not .Values.service.disableBaseClientPort }}
  26. - name: tcp-client
  27. port: 2181
  28. targetPort: client
  29. {{ end }}
  30. {{ if .Values.tls.client.enabled }}
  31. - name: tcp-client-tls
  32. port: {{ .Values.service.tlsClientPort }}
  33. targetPort: client-tls
  34. {{ end }}
  35. - name: follower
  36. port: 2888
  37. targetPort: follower
  38. - name: tcp-election
  39. port: 3888
  40. targetPort: election
  41. selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
  42. app.kubernetes.io/component: zookeeper