daemonset.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. apiVersion: apps/v1
  2. kind: DaemonSet
  3. metadata:
  4. name: archlinux-builder
  5. spec:
  6. updateStrategy:
  7. type: OnDelete
  8. selector:
  9. matchLabels:
  10. app.kubernetes.io/name: archlinux-builder
  11. app.kubernetes.io/part-of: archlinux-builder
  12. template:
  13. metadata:
  14. labels:
  15. app.kubernetes.io/name: archlinux-builder
  16. app.kubernetes.io/part-of: archlinux-builder
  17. spec:
  18. automountServiceAccountToken: false
  19. terminationGracePeriodSeconds: 600
  20. containers:
  21. - image: harbor.home.wugi.info/library/archlinux-systemd-builder:latest
  22. name: archlinux
  23. env:
  24. - name: container
  25. value: docker
  26. securityContext:
  27. capabilities:
  28. add:
  29. - NET_ADMIN
  30. - NET_BIND_SERVICE
  31. - NET_RAW
  32. - SYS_ADMIN
  33. - SYS_NICE
  34. - SYS_TIME
  35. privileged: true
  36. tty: true
  37. lifecycle:
  38. preStop:
  39. exec:
  40. command:
  41. - /bin/sh
  42. - -c
  43. - |
  44. if /bin/systemctl poweroff
  45. then
  46. :
  47. else
  48. exit 0
  49. fi
  50. volumeMounts:
  51. - mountPath: /run
  52. name: archlinux-run
  53. - mountPath: /tmp
  54. name: archlinux-tmp
  55. - name: home-oleg-ssh-authorized-keys
  56. mountPath: /home/oleg/.ssh/authorized_keys
  57. readOnly: true
  58. volumes:
  59. - emptyDir:
  60. medium: Memory
  61. sizeLimit: 4G
  62. name: archlinux-tmp
  63. - emptyDir:
  64. medium: Memory
  65. sizeLimit: 512M
  66. name: archlinux-run
  67. - name: home-oleg-ssh-authorized-keys
  68. hostPath:
  69. path: /home/oleg/.ssh/authorized_keys
  70. type: File