deployment.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "openvpn.fullname" . }}
  5. labels:
  6. {{- include "openvpn.labels" . | nindent 4 }}
  7. spec:
  8. replicas: 1
  9. selector:
  10. matchLabels:
  11. {{- include "openvpn.selectorLabels" . | nindent 6 }}
  12. template:
  13. metadata:
  14. {{- with .Values.openvpn.podAnnotations }}
  15. annotations:
  16. {{- toYaml . | nindent 8 }}
  17. {{- end }}
  18. labels:
  19. {{- include "openvpn.selectorLabels" . | nindent 8 }}
  20. spec:
  21. {{- if .Values.registry_secret_data }}
  22. imagePullSecrets:
  23. - name: {{ include "openvpn.fullname" . }}-registry-secret
  24. {{- end }}
  25. hostNetwork: true
  26. containers:
  27. - name: {{ .Chart.Name }}
  28. command: ["sleep"]
  29. args: ["infinity"]
  30. securityContext:
  31. capabilities:
  32. add:
  33. - NET_ADMIN
  34. image: "{{ .Values.openvpn.image }}:{{ .Values.openvpn.tag | default "latest" }}"
  35. imagePullPolicy: {{ .Values.openvpn.pullPolicy }}
  36. env:
  37. - name: TZ
  38. value: Europe/Moscow
  39. resources:
  40. {{- toYaml .Values.openvpn.resources | nindent 12 }}
  41. volumeMounts:
  42. - name: keys
  43. mountPath: /etc/openvpn/keys/
  44. - name: ccd
  45. mountPath: /etc/openvpn/ccd/
  46. - name: configuration
  47. mountPath: /etc/openvpn/configuration/
  48. {{- if .Values.openvpn.scripts }}
  49. - name: scripts
  50. mountPath: /scripts/
  51. {{- end }}
  52. volumes:
  53. - name: keys
  54. secret:
  55. secretName: {{ include "openvpn.fullname" . }}-keys
  56. - name: ccd
  57. configMap:
  58. name: {{ include "openvpn.fullname" . }}-ccd
  59. - name: configuration
  60. configMap:
  61. name: {{ include "openvpn.fullname" . }}-configuration
  62. {{- if .Values.openvpn.scripts }}
  63. - name: scripts
  64. configMap:
  65. name: {{ include "openvpn.fullname" . }}-scripts
  66. defaultMode: 0755
  67. {{- end }}