|
@@ -0,0 +1,66 @@
|
|
|
+{{ include "common.storage.hostPathValidate" .Values }}
|
|
|
+apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
|
|
|
+kind: Deployment
|
|
|
+metadata:
|
|
|
+ name: {{ template "common.names.fullname" . }}
|
|
|
+ labels:
|
|
|
+ app: {{ template "common.names.name" . }}
|
|
|
+ chart: {{ template "common.names.chart" . }}
|
|
|
+ release: {{ .Release.Name }}
|
|
|
+ heritage: {{ .Release.Service }}
|
|
|
+ annotations:
|
|
|
+ rollme: {{ randAlphaNum 5 | quote }}
|
|
|
+spec:
|
|
|
+ replicas: {{ (default 1 .Values.replicas) }}
|
|
|
+ strategy:
|
|
|
+ type: "Recreate"
|
|
|
+ selector:
|
|
|
+ matchLabels:
|
|
|
+ app: {{ template "common.names.name" . }}
|
|
|
+ release: {{ .Release.Name }}
|
|
|
+ template:
|
|
|
+ metadata:
|
|
|
+ name: {{ template "common.names.fullname" . }}
|
|
|
+ labels:
|
|
|
+ {{- include "common.labels.selectorLabels" . | nindent 8 }}
|
|
|
+ annotations: {{ include "common.annotations" . | nindent 8 }}
|
|
|
+ spec:
|
|
|
+ hostNetwork: {{ .Values.hostNetwork }}
|
|
|
+ hostname: {{ .Release.Name }}
|
|
|
+ containers:
|
|
|
+ - name: {{ .Chart.Name }}
|
|
|
+ {{ include "common.resources.limitation" . | nindent 10 }}
|
|
|
+ {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
|
|
|
+ volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
|
|
|
+ {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
|
|
|
+ - name: extrappvolume-{{ $index }}
|
|
|
+ mountPath: {{ $hostPathConfiguration.mountPath }}
|
|
|
+ {{ end }}
|
|
|
+ ports:
|
|
|
+ - name: udp
|
|
|
+ containerPort: 51820
|
|
|
+ protocol: UDP
|
|
|
+ - name: web
|
|
|
+ containerPort: 51821
|
|
|
+ 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" "WG_PERSISTENT_KEEPALIVE" "value" $wgeasy.keep_alive) }}
|
|
|
+ {{ $envList = mustAppend $envList (dict "name" "WG_DEFAULT_ADDRESS" "value" $wgeasy.client_address_range) }}
|
|
|
+ {{ $envList = mustAppend $envList (dict "name" "WG_DEFAULT_DNS" "value" $wgeasy.client_dns_server) }}
|
|
|
+ {{ if $wgeasy.allowed_ips }}
|
|
|
+ {{ $envList = mustAppend $envList (dict "name" "WG_ALLOWED_IPS" "value" (join "," $wgeasy.allowed_ips)) }}
|
|
|
+ {{ else }}
|
|
|
+ {{ $envList = mustAppend $envList (dict "name" "WG_ALLOWED_IPS" "value" ("0.0.0.0/0,::/0")) }}
|
|
|
+ {{ end }}
|
|
|
+ {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
|
|
|
+{{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
|
|
|
+ volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
|
|
|
+ {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
|
|
|
+ - name: extrappvolume-{{ $index }}
|
|
|
+ hostPath:
|
|
|
+ path: {{ $hostPathConfiguration.hostPath }}
|
|
|
+ {{ end }}
|