improv: improve dns and vpn values.yaml syntaxis (#970)

* improv: improve dns and vpn values.yaml syntaxis

* hmm

* fix tests

* no message
This commit is contained in:
Kjeld Schouten-Lebbing
2021-09-12 17:39:01 +02:00
committed by GitHub
parent 389e5d5803
commit b660bbf457
8 changed files with 82 additions and 28 deletions
@@ -3,7 +3,7 @@ Template to render VPN addon
It will include / inject the required templates based on the given values.
*/}}
{{- define "common.addon.vpn" -}}
{{- if .Values.addons.vpn.enabled -}}
{{- if ne "disabled" .Values.addons.vpn.type -}}
{{- if eq "openvpn" .Values.addons.vpn.type -}}
{{- include "common.addon.openvpn" . }}
{{- end -}}
@@ -5,12 +5,24 @@ The OpenVPN sidecar container to be inserted.
name: openvpn
image: "{{ .Values.openvpnImage.repository }}:{{ .Values.openvpnImage.tag }}"
imagePullPolicy: {{ .Values.openvpnImage.pullPolicy }}
{{- with .Values.addons.vpn.securityContext }}
securityContext:
capabilities:
add:
- NET_ADMIN
- SYS_MODULE
{{- with .Values.addons.vpn.securityContext }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.env }}
env:
{{- range $envList := .Values.addons.vpn.envList }}
{{- if and $envList.name $envList.value }}
- name: {{ $envList.name }}
value: {{ $envList.value | quote }}
{{- else }}
{{- fail "Please specify name/value for VPN environment variable" }}
{{- end }}
{{- end}}
{{- with .Values.addons.vpn.env }}
{{- range $k, $v := . }}
- name: {{ $k }}
value: {{ $v | quote }}
@@ -5,16 +5,46 @@ The Wireguard sidecar container to be inserted.
name: wireguard
image: "{{ .Values.wireguardImage.repository }}:{{ .Values.wireguardImage.tag }}"
imagePullPolicy: {{ .Values.wireguardImage.pullPolicy }}
{{- with .Values.addons.vpn.securityContext }}
securityContext:
runAsUser: 568
runAsGroup: 568
fsGroup: 568
capabilities:
add:
- NET_ADMIN
- SYS_MODULE
{{- with .Values.addons.vpn.securityContext }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.env }}
env:
{{- range $envList := .Values.addons.vpn.envList }}
{{- if and $envList.name $envList.value }}
- name: {{ $envList.name }}
value: {{ $envList.value | quote }}
{{- else }}
{{- fail "Please specify name/value for VPN environment variable" }}
{{- end }}
{{- end}}
{{- with .Values.addons.vpn.env }}
{{- range $k, $v := . }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- end }}
- name: SEPARATOR
value: ";"
{{- if .Values.addons.vpn.wireguard.KILLSWITCH }}
- name: KILLSWITCH
value: "true"
{{- if .Values.addons.vpn.wireguard.KILLSWITCH_EXCLUDEDNETWORKS_IPV4 }}
- name: KILLSWITCH_EXCLUDEDNETWORKS_IPV4
value: {{ .Values.addons.vpn.wireguard.KILLSWITCH_EXCLUDEDNETWORKS_IPV4 | quote }}
{{- end }}
{{- if .Values.addons.vpn.wireguard.KILLSWITCH_EXCLUDEDNETWORKS_IPV6 }}
- name: KILLSWITCH_EXCLUDEDNETWORKS_IPV4
value: {{ .Values.addons.vpn.wireguard.KILLSWITCH_EXCLUDEDNETWORKS_IPV6 | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }}
volumeMounts: