diff --git a/chart/templates/service.yaml b/chart/templates/service.yaml index c5758b8b..43466074 100644 --- a/chart/templates/service.yaml +++ b/chart/templates/service.yaml @@ -14,7 +14,9 @@ spec: targetPort: http protocol: TCP name: http - nodePort: {{ .Values.service.nodePort }} +{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} + nodePort: {{.Values.service.nodePort}} +{{ end }} selector: app.kubernetes.io/name: {{ include "chart.name" . }} app.kubernetes.io/instance: {{ .Release.Name }}