mirror of
https://github.com/truenas/charts.git
synced 2026-11-26 15:26:05 +00:00
20 lines
550 B
Smarty
20 lines
550 B
Smarty
{{/*
|
|
Render all the ports and additionalPorts for a Service object.
|
|
*/}}
|
|
{{- define "common.classes.service.ports" -}}
|
|
{{- $values := .values -}}
|
|
{{- $ports := $values.ports -}}
|
|
{{- if $ports -}}
|
|
ports:
|
|
{{- range $_ := $ports }}
|
|
- port: {{ .port }}
|
|
targetPort: {{ .targetPort | default "http" }}
|
|
protocol: {{ .protocol | default "TCP" }}
|
|
name: {{ .name | default "http" }}
|
|
{{- if (and (eq $.svcType "NodePort") (not (empty .nodePort))) }}
|
|
nodePort: {{ .nodePort }}
|
|
{{ end }}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end }}
|