More CI improvements

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2022-07-29 21:10:46 +02:00
parent d83abae451
commit bcded223a6
No known key found for this signature in database
GPG key ID: BC5E2BD907F9A8EC
41 changed files with 359 additions and 120 deletions

View file

@ -12,6 +12,10 @@ It will include / inject the required templates based on the given values.
{{- include "common.addon.wireguard" . }}
{{- end -}}
{{- if eq "gluetun" .Values.addons.vpn.type -}}
{{- include "common.addon.gluetun" . }}
{{- end -}}
{{/* Include the configmap if not empty */}}
{{- $configmap := include "common.addon.vpn.configmap" . -}}
{{- if $configmap -}}

View file

@ -0,0 +1,11 @@
{{/*
Template to render gluetun addon. It will add the container to the list of additionalContainers.
*/}}
*/}}
{{- define "common.addon.gluetun" -}}
{{/* Append the gluetun container to the additionalContainers */}}
{{- $container := fromYaml (include "common.addon.gluetun.container" .) -}}
{{- if $container -}}
{{- $_ := set .Values.additionalContainers "addon-gluetun" $container -}}
{{- end -}}
{{- end -}}

View file

@ -0,0 +1,57 @@
{{/*
The gluetun sidecar container to be inserted.
*/}}
{{- define "common.addon.gluetun.container" -}}
name: gluetun
image: "{{ .Values.addons.vpn.gluetun.image.repository }}:{{ .Values.addons.vpn.gluetun.image.tag }}"
imagePullPolicy: {{ .Values.addons.vpn.gluetun.pullPolicy }}
{{- with .Values.addons.vpn.securityContext }}
securityContext:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.env }}
env:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.envFrom }}
envFrom:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.args }}
args:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }}
volumeMounts:
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret }}
- name: vpnconfig
mountPath: /gluetun/config.conf
subPath: vpnConfigfile
{{- end }}
{{- if .Values.addons.vpn.scripts.up }}
- name: vpnscript
mountPath: /gluetun/scripts/up.sh
subPath: up.sh
{{- end }}
{{- if .Values.addons.vpn.scripts.down }}
- name: vpnscript
mountPath: /gluetun/scripts/down.sh
subPath: down.sh
{{- end }}
{{- if .Values.persistence.shared.enabled }}
- mountPath: {{ .Values.persistence.shared.mountPath }}
name: shared
{{- end }}
{{- with .Values.addons.vpn.additionalVolumeMounts }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- with .Values.addons.vpn.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 2 }}
{{- end -}}
{{- with .Values.addons.vpn.resources }}
resources:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end -}}

View file

@ -11,14 +11,15 @@ securityContext:
{{- end }}
{{- with .Values.addons.vpn.env }}
env:
{{- range $k, $v := . }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.envFrom }}
envFrom:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.args }}
args:
{{- range .Values.addons.vpn.args }}
- {{ . | quote }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- if or .Values.addons.vpn.openvpn.auth .Values.addons.vpn.openvpn.authSecret }}
envFrom:

View file

@ -11,14 +11,15 @@ securityContext:
{{- end }}
{{- with .Values.addons.vpn.env }}
env:
{{- range $k, $v := . }}
- name: {{ $k }}
value: {{ $v | quote }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.envFrom }}
envFrom:
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- with .Values.addons.vpn.args }}
args:
{{- range .Values.addons.vpn.args }}
- {{ . | quote }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- if or .Values.addons.vpn.configFile .Values.addons.vpn.configFileSecret .Values.addons.vpn.scripts.up .Values.addons.vpn.scripts.down .Values.addons.vpn.additionalVolumeMounts .Values.persistence.shared.enabled }}
volumeMounts: