|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "wg-easy.fullname" . }} |
| 5 | + labels: |
| 6 | + {{- include "wg-easy.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | + {{- if not .Values.autoscaling.enabled }} |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | + {{- end }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "wg-easy.selectorLabels" . | nindent 6 }} |
| 14 | + template: |
| 15 | + metadata: |
| 16 | + annotations: |
| 17 | + checksum/config: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} |
| 18 | + {{- with .Values.podAnnotations }} |
| 19 | + {{- toYaml . | nindent 8 }} |
| 20 | + {{- end }} |
| 21 | + labels: |
| 22 | + {{- include "wg-easy.labels" . | nindent 8 }} |
| 23 | + {{- with .Values.podLabels }} |
| 24 | + {{- toYaml . | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + spec: |
| 27 | + {{- with .Values.imagePullSecrets }} |
| 28 | + imagePullSecrets: |
| 29 | + {{- toYaml . | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + serviceAccountName: {{ include "wg-easy.serviceAccountName" . }} |
| 32 | + {{- with .Values.podSecurityContext }} |
| 33 | + securityContext: |
| 34 | + {{- toYaml . | nindent 8 }} |
| 35 | + {{- end }} |
| 36 | + containers: |
| 37 | + - name: {{ .Chart.Name }} |
| 38 | + {{- with .Values.securityContext }} |
| 39 | + securityContext: |
| 40 | + {{- toYaml . | nindent 12 }} |
| 41 | + {{- end }} |
| 42 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 43 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 44 | + ports: |
| 45 | + - name: http |
| 46 | + containerPort: {{ .Values.service.web.port }} |
| 47 | + protocol: TCP |
| 48 | + - name: wireguard |
| 49 | + containerPort: {{ .Values.service.wireguard.port }} |
| 50 | + protocol: UDP |
| 51 | + {{- with .Values.livenessProbe }} |
| 52 | + livenessProbe: |
| 53 | + {{- toYaml . | nindent 12 }} |
| 54 | + {{- end }} |
| 55 | + {{- with .Values.readinessProbe }} |
| 56 | + readinessProbe: |
| 57 | + {{- toYaml . | nindent 12 }} |
| 58 | + {{- end }} |
| 59 | + {{- with .Values.resources }} |
| 60 | + resources: |
| 61 | + {{- toYaml . | nindent 12 }} |
| 62 | + {{- end }} |
| 63 | + volumeMounts: |
| 64 | + - name: tun |
| 65 | + mountPath: /dev/net/tun |
| 66 | + - name: config |
| 67 | + mountPath: /etc/wireguard |
| 68 | + {{- with .Values.volumeMounts }} |
| 69 | + {{- toYaml . | nindent 12 }} |
| 70 | + {{- end }} |
| 71 | + envFrom: |
| 72 | + - secretRef: |
| 73 | + name: {{ include "wg-easy.fullname" . }} |
| 74 | + volumes: |
| 75 | + - name: tun |
| 76 | + hostPath: |
| 77 | + type: 'CharDevice' |
| 78 | + path: /dev/net/tun |
| 79 | + - name: config |
| 80 | + persistentVolumeClaim: |
| 81 | + claimName: {{ include "wg-easy.fullname" . }} |
| 82 | + {{- with .Values.volumes }} |
| 83 | + {{- toYaml . | nindent 8 }} |
| 84 | + {{- end }} |
| 85 | + {{- with .Values.nodeSelector }} |
| 86 | + nodeSelector: |
| 87 | + {{- toYaml . | nindent 8 }} |
| 88 | + {{- end }} |
| 89 | + {{- with .Values.affinity }} |
| 90 | + affinity: |
| 91 | + {{- toYaml . | nindent 8 }} |
| 92 | + {{- end }} |
| 93 | + {{- with .Values.tolerations }} |
| 94 | + tolerations: |
| 95 | + {{- toYaml . | nindent 8 }} |
| 96 | + {{- end }} |
0 commit comments