2
0

svc.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: {{ template "common.names.fullname" . }}
  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.annotations }}
  14. {{- include "common.tplvalues.render" ( dict "value" .Values.service.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: {{ .Values.service.type }}
  22. {{- if and (.Values.service.loadBalancerIP) (eq .Values.service.type "LoadBalancer") }}
  23. loadBalancerIP: {{ .Values.service.loadBalancerIP }}
  24. {{- end }}
  25. ports:
  26. {{ if not .Values.service.tls.disable_base_client_port }}
  27. - name: tcp-client
  28. port: 2181
  29. targetPort: client
  30. {{ end }}
  31. {{ if .Values.service.tls.client_enable }}
  32. - name: tcp-client-tls
  33. port: {{ .Values.service.tls.client_port }}
  34. targetPort: client-tls
  35. {{ end }}
  36. - name: follower
  37. port: 2888
  38. targetPort: follower
  39. - name: tcp-election
  40. port: 3888
  41. targetPort: election
  42. selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
  43. app.kubernetes.io/component: zookeeper