daemonset.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. kind: DaemonSet
  2. apiVersion: apps/v1
  3. metadata:
  4. name: {{ include "openvpn.fullname" . }}-router
  5. labels:
  6. {{- include "openvpn.router.labels" . | nindent 4 }}
  7. spec:
  8. selector:
  9. matchLabels:
  10. {{- include "openvpn.router.selectorLabels" . | nindent 6 }}
  11. template:
  12. metadata:
  13. labels:
  14. {{- include "openvpn.router.selectorLabels" . | nindent 8 }}
  15. spec:
  16. serviceAccountName: {{ .Release.Name }}-router
  17. {{- if .Values.registry_secret_data }}
  18. imagePullSecrets:
  19. - name: {{ include "openvpn.fullname" . }}-registry-secret
  20. {{- end }}
  21. hostNetwork: true
  22. priorityClassName: system-cluster-critical
  23. containers:
  24. - name: {{ .Chart.Name }}-router
  25. image: "{{ .Values.router.image }}:{{ .Values.router.tag }}"
  26. imagePullPolicy: IfNotPresent
  27. command: ["/bin/sh"]
  28. args: ["-c","/opt/route-check"]
  29. lifecycle:
  30. preStop:
  31. exec:
  32. command: ["/bin/sh","-c","/opt/route-delete"]
  33. securityContext:
  34. capabilities:
  35. add:
  36. - NET_ADMIN
  37. resources:
  38. {{- toYaml .Values.router.resources | nindent 12 }}
  39. volumeMounts:
  40. - name: routecheck
  41. mountPath: /opt
  42. volumes:
  43. - name: routecheck
  44. configMap:
  45. name: {{ include "openvpn.fullname" . }}-routecheck
  46. defaultMode: 0755