svc-headless.yaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: {{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
  5. namespace: {{ .Release.Namespace | quote }}
  6. labels: {{- include "common.labels.standard" . | nindent 4 }}
  7. app.kubernetes.io/component: kafka
  8. {{- if .Values.service.headless.labels }}
  9. {{- include "common.tplvalues.render" ( dict "value" .Values.service.headless.labels "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. {{- if .Values.commonLabels }}
  12. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  13. {{- end }}
  14. {{- if or .Values.service.headless.annotations .Values.commonAnnotations }}
  15. annotations:
  16. {{- if .Values.service.headless.annotations }}
  17. {{- include "common.tplvalues.render" (dict "value" .Values.service.headless.annotations "context" $) | nindent 4 }}
  18. {{- end }}
  19. {{- if .Values.commonAnnotations }}
  20. {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
  21. {{- end }}
  22. {{- end }}
  23. spec:
  24. type: ClusterIP
  25. clusterIP: None
  26. publishNotReadyAddresses: {{ .Values.service.headless.publishNotReadyAddresses }}
  27. ports:
  28. - name: tcp-client
  29. port: {{ .Values.service.ports.client }}
  30. protocol: TCP
  31. targetPort: kafka-client
  32. - name: tcp-internal
  33. port: {{ .Values.service.ports.internal }}
  34. protocol: TCP
  35. targetPort: kafka-internal
  36. selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
  37. app.kubernetes.io/component: kafka