Преглед изворни кода

dynamically set webui Port

Stavros kois пре 2 година
родитељ
комит
118b063c36

+ 5 - 4
test/wg-easy/1.0.0/templates/deployment.yaml

@@ -51,13 +51,14 @@ spec:
               containerPort: {{ .Values.wgUDPPort }}
               protocol: UDP
             - name: web
-              containerPort: 51821
+              containerPort: {{ .Values.webUIPort }}
           env:
             {{ $wgeasy := .Values.wgeasy }}
             {{ $envList := (default list .Values.environmentVariables) }}
             {{ $envList = mustAppend $envList (dict "name" "WG_HOST" "value" $wgeasy.host) }}
             {{ $envList = mustAppend $envList (dict "name" "PASSWORD" "value" $wgeasy.password) }}
             {{ $envList = mustAppend $envList (dict "name" "WG_PORT" "value" .Values.wgUDPPort) }}
+            {{ $envList = mustAppend $envList (dict "name" "PORT" "value" .Values.webUIPort) }}
             {{ $envList = mustAppend $envList (dict "name" "WG_PERSISTENT_KEEPALIVE" "value" $wgeasy.keep_alive) }}
             {{ $envList = mustAppend $envList (dict "name" "WG_MTU" "value" $wgeasy.client_mtu) }}
             {{ $envList = mustAppend $envList (dict "name" "WG_DEFAULT_ADDRESS" "value" $wgeasy.client_address_range) }}
@@ -71,19 +72,19 @@ spec:
           readinessProbe:
             httpGet:
               path: /
-              port: 51821
+              port: {{ .Values.webUIPort }}
             failureThreshold: 5
             periodSeconds: 15
           livenessProbe:
             httpGet:
               path: /
-              port: 51821
+              port: {{ .Values.webUIPort }}
             failureThreshold: 5
             periodSeconds: 15
           startupProbe:
             httpGet:
               path: /
-              port: 51821
+              port: {{ .Values.webUIPort }}
             initialDelaySeconds: 5
             failureThreshold: 40
             periodSeconds: 15

+ 1 - 1
test/wg-easy/1.0.0/templates/service.yaml

@@ -2,7 +2,7 @@
 {{ $selectors = mustAppend $selectors (dict "key" "app" "value" (include "common.names.name" .) ) }}
 {{ $selectors = mustAppend $selectors (dict "key" "release" "value" .Release.Name ) }}
 {{ $ports := list }}
-{{ $ports = mustAppend $ports (dict "name" "web" "port" .Values.webUIPort "nodePort" .Values.webUIPort "targetPort" 51821) }}
+{{ $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 ) }}