pod.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: socialstream
  5. annotations:
  6. # Setting spec.force to true will make Flux recreate the Pod when any
  7. # immutable field is changed, forcing the Pod to run every time the
  8. # container image tag changes.
  9. kustomize.toolkit.fluxcd.io/force: enabled
  10. spec:
  11. restartPolicy: Never
  12. automountServiceAccountToken: false
  13. containers:
  14. - image: harbor.home.wugi.info/library/socialstream:0.1.45-2
  15. name: socialstream
  16. env:
  17. - name: container
  18. value: docker
  19. command:
  20. - /bin/bash
  21. - -c
  22. - |
  23. set -o nounset -o errexit -o pipefail -o xtrace
  24. systemctl enable socialstream.service
  25. rm -vf /usr/lib/systemd/system/systemd-networkd*
  26. rm -vf /usr/lib/systemd/system/systemd-firstboot.service
  27. rm -vf /usr/lib/systemd/system/systemd-resolved.service
  28. passwd --delete root
  29. umount /sys/fs/cgroup
  30. mount -t cgroup2 -o rw,relatime,nsdelegate,memory_recursiveprot cgroup2 /sys/fs/cgroup
  31. sed -i 's@#TTYPath=/dev/console@TTYPath=/dev/console@; s@#ForwardToConsole=no@ForwardToConsole=yes@' /etc/systemd/journald.conf
  32. exec /sbin/init
  33. securityContext:
  34. capabilities:
  35. add:
  36. - NET_ADMIN
  37. - NET_BIND_SERVICE
  38. - NET_RAW
  39. - SYS_ADMIN
  40. - SYS_NICE
  41. - SYS_TIME
  42. resources:
  43. limits:
  44. cpu: 2000m
  45. memory: 4096Mi
  46. requests:
  47. cpu: 100m
  48. memory: 512Mi
  49. tty: true
  50. livenessProbe:
  51. exec:
  52. command:
  53. - /bin/systemctl
  54. - is-system-running
  55. failureThreshold: 100
  56. periodSeconds: 10
  57. timeoutSeconds: 15
  58. volumeMounts:
  59. - mountPath: /run
  60. name: run
  61. - mountPath: /tmp
  62. name: tmp
  63. - mountPath: /tmp/.X11-unix/X0
  64. name: x11-unix-socket
  65. - mountPath: /dev/dri
  66. name: dev-dri
  67. volumes:
  68. - emptyDir:
  69. medium: Memory
  70. sizeLimit: 512M
  71. name: run
  72. - emptyDir:
  73. medium: Memory
  74. sizeLimit: 2G
  75. name: tmp
  76. - name: x11-unix-socket
  77. hostPath:
  78. path: /tmp/.X11-unix/X0
  79. type: Socket
  80. - name: dev-dri
  81. hostPath:
  82. path: /dev/dri
  83. type: Directory