netclient-template.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.11
  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 --dns on -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. volumes:
  42. - hostPath:
  43. path: /etc/netclient
  44. type: DirectoryOrCreate
  45. name: etc-netclient
  46. - hostPath:
  47. path: /usr/bin/wg
  48. type: File
  49. name: wg
  50. - hostPath:
  51. path: /usr/bin/resolvectl
  52. type: File
  53. name: resolvectl
  54. - hostPath:
  55. path: /var/run/dbus/system_bus_socket
  56. type: ""
  57. name: systemd-bus-socket