mirror of
https://github.com/truenas/charts.git
synced 2026-11-06 08:31:14 +00:00
render clusterip service when hostnetwork, so other apps can still connect to it internally
This commit is contained in:
1 file changed
+12
-5
@@ -2,11 +2,18 @@
|
||||
{{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }}
|
||||
{{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }}
|
||||
{{ $ports := list }}
|
||||
{{- if not .Values.hostNetwork }}
|
||||
{{ $ports = mustAppend $ports (dict "name" "web" "port" .Values.webUIPort "nodePort" .Values.webUIPort "targetPort" .Values.webUIPort) }}
|
||||
{{ $ports = mustAppend $ports (dict "name" "udp" "port" .Values.wgUDPPort "nodePort" .Values.wgUDPPort "targetPort" .Values.wgUDPPort "protocol" "UDP") }}
|
||||
{{ $params := . }}
|
||||
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
|
||||
{{ $_1 := set .Values "extraSelectorLabels" $selectors }}
|
||||
{{- if not .Values.hostNetwork }}
|
||||
{{ include "common.classes.service" $params }}
|
||||
{{- else }}
|
||||
{{ $ports = mustAppend $ports (dict "name" "web" "port" .Values.webUIPort "targetPort" .Values.webUIPort) }}
|
||||
{{ $ports = mustAppend $ports (dict "name" "udp" "port" .Values.wgUDPPort "targetPort" .Values.wgUDPPort "protocol" "UDP") }}
|
||||
{{- end }}
|
||||
{{ $params := . }}
|
||||
{{- if not .Values.hostNetwork }}
|
||||
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
|
||||
{{- else }}
|
||||
{{ $_ := set $params "commonService" (dict "type" "ClusterIP" "ports" $ports ) }}
|
||||
{{- end }}
|
||||
{{ $_1 := set .Values "extraSelectorLabels" $selectors }}
|
||||
{{ include "common.classes.service" $params }}
|
||||
Reference in new issue
Block a user