File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,16 @@ Controller image deployed is: "{{ .Values.image.repository }}:{{ tpl .Values.ima
55Your HAProxy app is of a "{{ .Values.kind }}" kind.
66
77Service ports mapped are:
8+ {{- $nodePorts := .Values.service.nodePorts }}
9+ {{- $servicePortType := .Values.service.type }}
810{{- if eq .Values.kind "Deployment" }}
911{{- range $key, $value := .Values.containerPorts }}
1012 - name: {{ $key }}
1113 containerPort: {{ $value }}
1214 protocol: TCP
15+ {{- if and (hasKey $nodePorts $key) (eq $servicePortType "NodePort") }}
16+ nodePort: {{ get $nodePorts $key }}
17+ {{- end }}
1318{{- end }}
1419{{- end }}
1520{{- if eq .Values.kind "DaemonSet" }}
@@ -22,6 +27,9 @@ Service ports mapped are:
2227 {{- if $useHostPort }}
2328 hostPort: {{ index $hostPorts $key | default $value }}
2429 {{- end }}
30+ {{- if and (hasKey $nodePorts $key) (eq $servicePortType "NodePort") }}
31+ nodePort: {{ get $nodePorts $key }}
32+ {{- end }}
2533{{- end }}
2634{{- end }}
2735
Original file line number Diff line number Diff line change @@ -50,13 +50,18 @@ spec:
5050 {{- toYaml . | nindent 2 }}
5151 {{- end }}
5252 {{- if or .Values.containerPorts .Values.service.additionalPorts }}
53+ {{- $nodePorts := .Values.service.nodePorts }}
54+ {{- $servicePortType := .Values.service.type }}
5355 ports :
5456 {{- with .Values.containerPorts }}
5557 {{- range $key, $port := . }}
5658 - name : {{ $key }}
5759 protocol : TCP
5860 port : {{ $port }}
5961 targetPort : {{ $key }}
62+ {{- if and (hasKey $nodePorts $key) (eq $servicePortType "NodePort") }}
63+ nodePort : {{ get $nodePorts $key }}
64+ {{- end }}
6065 {{- end }}
6166 {{- end }}
6267 {{- with .Values.service.additionalPorts }}
6570 protocol : TCP
6671 port : {{ $port }}
6772 targetPort : {{ $key }}
73+ {{- if and (hasKey $nodePorts $key) (eq $servicePortType "NodePort") }}
74+ nodePort : {{ get $nodePorts $key }}
75+ {{- end }}
6876 {{- end }}
6977 {{- end }}
7078 {{- end }}
Original file line number Diff line number Diff line change @@ -449,7 +449,7 @@ PodDisruptionBudget:
449449# # Service configuration
450450# # ref: https://kubernetes.io/docs/concepts/services-networking/service/
451451service :
452- type : ClusterIP # can be 'LoadBalancer'
452+ type : ClusterIP # can be 'ClusterIP', 'NodePort', ' LoadBalancer'
453453
454454 # # Service ClusterIP
455455 # # ref: https://kubernetes.io/docs/concepts/services-networking/service/
@@ -484,6 +484,12 @@ service:
484484 additionalPorts : {}
485485 # prometheus: 9101
486486
487+ # # NodePort custom port
488+ # # ref: https://kubernetes.io/docs/concepts/services-networking/service/#nodeport-custom-port
489+ nodePorts : {}
490+ # http: 32080
491+ # https: 32443
492+
487493serviceMonitor :
488494 # # Toggle the ServiceMonitor true if you have Prometheus Operator installed and configured
489495 enabled : false
You can’t perform that action at this time.
0 commit comments