diff --git a/charts/databunker-demo/templates/service.yaml b/charts/databunker-demo/templates/service.yaml index 9a90467..51be288 100644 --- a/charts/databunker-demo/templates/service.yaml +++ b/charts/databunker-demo/templates/service.yaml @@ -11,8 +11,8 @@ spec: targetPort: http protocol: TCP name: http -{{- if contains "NodePort" .Values.service.type }} - nodePort: 30300 -{{- end }} + {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePort)) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} selector: {{- include "databunker-demo.selectorLabels" . | nindent 4 }} diff --git a/charts/databunker-demo/values.yaml b/charts/databunker-demo/values.yaml index 500aaaa..e794d1a 100644 --- a/charts/databunker-demo/values.yaml +++ b/charts/databunker-demo/values.yaml @@ -39,6 +39,7 @@ securityContext: {} service: type: ClusterIP port: 3000 + nodePort: 30300 ingress: enabled: false