_service_ports.tpl 550 B

12345678910111213141516171819
  1. {{/*
  2. Render all the ports and additionalPorts for a Service object.
  3. */}}
  4. {{- define "common.classes.service.ports" -}}
  5. {{- $values := .values -}}
  6. {{- $ports := $values.ports -}}
  7. {{- if $ports -}}
  8. ports:
  9. {{- range $_ := $ports }}
  10. - port: {{ .port }}
  11. targetPort: {{ .targetPort | default "http" }}
  12. protocol: {{ .protocol | default "TCP" }}
  13. name: {{ .name | default "http" }}
  14. {{- if (and (eq $.svcType "NodePort") (not (empty .nodePort))) }}
  15. nodePort: {{ .nodePort }}
  16. {{ end }}
  17. {{- end -}}
  18. {{- end -}}
  19. {{- end }}