deployment.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: openvpn
  5. spec:
  6. strategy:
  7. type: Recreate
  8. selector:
  9. matchLabels:
  10. app.kubernetes.io/name: openvpn
  11. app.kubernetes.io/part-of: openvpn
  12. template:
  13. metadata:
  14. labels:
  15. app.kubernetes.io/name: openvpn
  16. app.kubernetes.io/part-of: openvpn
  17. spec:
  18. hostNetwork: true
  19. containers:
  20. - image: busybox
  21. name: openvpn
  22. command:
  23. - /gnu/store/38agwkxz139fh9z0y7g3vqwyli1ldrl7-openvpn-2.6.7/sbin/openvpn
  24. args:
  25. - --config
  26. - /etc/openvpn/openvpn.conf
  27. resources:
  28. limits:
  29. cpu: 8000m
  30. memory: 1024Mi
  31. requests:
  32. cpu: 1000m
  33. memory: 512Mi
  34. securityContext:
  35. allowPrivilegeEscalation: false
  36. capabilities:
  37. add:
  38. # Used for iptables
  39. - NET_ADMIN
  40. # drop:
  41. # - ALL
  42. volumeMounts:
  43. - mountPath: /dev/net/tun
  44. name: dev-net-tun
  45. - mountPath: /etc/openvpn
  46. name: etc-openvpn
  47. - mountPath: /gnu/store
  48. name: gnu-store
  49. volumes:
  50. - name: dev-net-tun
  51. hostPath:
  52. path: /dev/net/tun
  53. type: CharDevice
  54. - name: etc-openvpn
  55. hostPath:
  56. path: /etc/openvpn
  57. type: Directory
  58. - name: gnu-store
  59. hostPath:
  60. path: /gnu/store
  61. type: Directory