apiVersion: v1 kind: Service metadata: name: {{ include "node-red.fullname" . }} labels: app.kubernetes.io/name: {{ include "node-red.name" . }} helm.sh/chart: {{ include "node-red.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} spec: {{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }} type: ClusterIP {{- else if eq .Values.service.type "LoadBalancer" }} type: {{ .Values.service.type }} {{- if .Values.service.loadBalancerIP }} loadBalancerIP: {{ .Values.service.loadBalancerIP }} {{- end }} {{- if .Values.service.loadBalancerSourceRanges }} loadBalancerSourceRanges: {{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }} {{- end -}} {{- else }} type: {{ .Values.service.type }} {{- end }} {{- if .Values.service.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} {{- end }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http {{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} nodePort: {{.Values.service.nodePort}} {{ end }} selector: app.kubernetes.io/name: {{ include "node-red.name" . }} app.kubernetes.io/instance: {{ .Release.Name }}