dynamically set webui Port

This commit is contained in:
Stavros kois
2022-11-15 23:39:28 +02:00
parent e28a9d3742
commit 118b063c36
2 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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 ) }}