netclient-template.yaml.backup 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. apiVersion: apps/v1
  2. kind: DaemonSet
  3. metadata:
  4. name: netclient
  5. labels:
  6. app: netclient
  7. spec:
  8. selector:
  9. matchLabels:
  10. app: netclient
  11. template:
  12. metadata:
  13. labels:
  14. app: netclient
  15. spec:
  16. hostNetwork: true
  17. containers:
  18. - name: netclient
  19. image: gravitl/netclient:v0.5.8
  20. command: ['bash', '-c', "/root/netclient join -t $ACCESS_TOKEN --daemon off --name $(echo $NODE_NAME| sed -e s/.$NETWORK//); while true; do /root/netclient checkin -n $NETWORK; sleep $SLEEP; done"]
  21. env:
  22. - name: ACCESS_TOKEN
  23. value: "ACCESS_TOKEN_VALUE"
  24. - name: NETWORK
  25. value: "microk8s"
  26. - name: SLEEP
  27. value: "30"
  28. - name: NODE_NAME
  29. valueFrom:
  30. fieldRef:
  31. fieldPath: spec.nodeName
  32. volumeMounts:
  33. - mountPath: /etc/netclient
  34. name: etc-netclient
  35. - mountPath: /usr/bin/wg
  36. name: wg
  37. - mountPath: /var/run/dbus/system_bus_socket
  38. name: systemd-bus-socket
  39. securityContext:
  40. privileged: true
  41. #capabilities:
  42. # add:
  43. # - ["NET_ADMIN","SYS_ADMIN","SYS_MODULE"]
  44. volumes:
  45. - hostPath:
  46. path: /etc/netclient
  47. type: DirectoryOrCreate
  48. name: etc-netclient
  49. - hostPath:
  50. path: /usr/bin/wg
  51. type: File
  52. name: wg
  53. - hostPath:
  54. path: /usr/bin/resolvectl
  55. type: File
  56. name: resolvectl
  57. - hostPath:
  58. path: /var/run/dbus/system_bus_socket
  59. type: ""
  60. name: systemd-bus-socket