You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

svc.yaml 1.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: {{ template "mysql.fullname" . }}
  5. namespace: {{ .Release.Namespace }}
  6. labels:
  7. app: {{ template "mysql.fullname" . }}
  8. chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
  9. release: "{{ .Release.Name }}"
  10. heritage: "{{ .Release.Service }}"
  11. annotations:
  12. {{- if .Values.service.annotations }}
  13. {{ toYaml .Values.service.annotations | indent 4 }}
  14. {{- end }}
  15. {{- if and (.Values.metrics.enabled) (.Values.metrics.annotations) }}
  16. {{ toYaml .Values.metrics.annotations | indent 4 }}
  17. {{- end }}
  18. spec:
  19. type: {{ .Values.service.type }}
  20. {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }}
  21. loadBalancerIP: {{ .Values.service.loadBalancerIP }}
  22. {{- end }}
  23. ports:
  24. - name: mysql
  25. port: {{ .Values.service.port }}
  26. targetPort: mysql
  27. {{- if .Values.service.nodePort }}
  28. nodePort: {{ .Values.service.nodePort }}
  29. {{- end }}
  30. {{- if .Values.mysqlx.port.enabled }}
  31. - name: mysqlx
  32. port: 33060
  33. targetPort: mysqlx
  34. protocol: TCP
  35. {{- end }}
  36. {{- if .Values.metrics.enabled }}
  37. - name: metrics
  38. port: 9104
  39. targetPort: metrics
  40. {{- end }}
  41. selector:
  42. app: {{ template "mysql.fullname" . }}