daemonset.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. annotations:
  16. checksum/config: {{ include (print $.Template.BasePath "/cm-router.yaml") . | sha256sum }}
  17. spec:
  18. serviceAccountName: {{ .Release.Name }}-router
  19. {{- if .Values.registry_secret_data }}
  20. imagePullSecrets:
  21. - name: {{ include "openvpn.fullname" . }}-registry-secret
  22. {{- end }}
  23. hostNetwork: true
  24. priorityClassName: system-cluster-critical
  25. containers:
  26. - name: {{ .Chart.Name }}-router
  27. image: "{{ .Values.router.image }}:{{ .Values.router.tag }}"
  28. imagePullPolicy: IfNotPresent
  29. command: ["/bin/sh"]
  30. args: ["-c","/opt/route-add"]
  31. lifecycle:
  32. preStop:
  33. exec:
  34. command: ["/bin/sh","-c","/opt/route-delete"]
  35. securityContext:
  36. capabilities:
  37. add:
  38. - NET_ADMIN
  39. resources:
  40. {{- toYaml .Values.router.resources | nindent 12 }}
  41. volumeMounts:
  42. - name: routecheck
  43. mountPath: /opt
  44. volumes:
  45. - name: routecheck
  46. configMap:
  47. name: {{ include "openvpn.fullname" . }}-routecheck
  48. defaultMode: 0755