You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wg-access-server/deploy/helm/wg-access-server/templates/deployment.yaml

102 lines
3.0 KiB
YAML

{{- $fullName := include "wg-access-server.fullname" . -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "wg-access-server.fullname" . }}
labels:
{{- include "wg-access-server.labels" . | nindent 4 }}
spec:
replicas: 1
strategy:
type: "{{ .Values.strategy.type }}"
selector:
matchLabels:
{{- include "wg-access-server.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "wg-access-server.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
capabilities:
add: ['NET_ADMIN']
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8000
protocol: TCP
- name: wireguard
containerPort: 51820
protocol: UDP
env:
{{- if .Values.wireguard.config.privateKey }}
- name: WIREGUARD_PRIVATE_KEY
valueFrom:
secretKeyRef:
name: "{{ $fullName }}"
key: privateKey
{{- end }}
{{- if .Values.web.config.adminUsername }}
- name: ADMIN_USERNAME
valueFrom:
secretKeyRef:
name: "{{ $fullName }}"
key: adminUsername
{{- end}}
{{- if .Values.web.config.adminPassword }}
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ $fullName }}"
key: adminPassword
{{- end}}
volumeMounts:
- name: tun
mountPath: /dev/net/tun
- name: data
mountPath: /data
- name: config
mountPath: /config.yaml
subPath: config.yaml
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: tun
hostPath:
type: 'CharDevice'
path: /dev/net/tun
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: "{{ $fullName }}"
{{- end }}
{{- if not .Values.persistence.enabled }}
emptyDir: {}
{{- end }}
- name: config
configMap:
name: "{{ $fullName }}"
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}