job.yaml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. apiVersion: batch/v1
  2. kind: Job
  3. metadata:
  4. name: git-dotfiles
  5. annotations:
  6. # Setting spec.force to true will make Flux recreate the Job when any
  7. # immutable field is changed, forcing the Job to run every time the
  8. # container image tag changes.
  9. kustomize.toolkit.fluxcd.io/force: enabled
  10. spec:
  11. backoffLimit: 0
  12. template:
  13. spec:
  14. hostNetwork: true
  15. hostPID: true
  16. restartPolicy: Never
  17. containers:
  18. - command:
  19. - nsenter
  20. - --target
  21. - "1"
  22. - --mount
  23. - --uts
  24. - --ipc
  25. - --net
  26. - --pid
  27. - --no-fork
  28. - /bin/sh
  29. - -l
  30. - -c
  31. - sudo --chdir=$WORKSPACE --user=oleg --login bash -ic 'git pull --rebase origin master'
  32. env:
  33. - name: WORKSPACE
  34. value: /home/oleg/.local/share/chezmoi
  35. image: docker-registry.wugi.info/library/util-linux-with-udev
  36. name: refresh
  37. resources:
  38. limits:
  39. cpu: 14000m
  40. memory: 4096Mi
  41. requests:
  42. cpu: 10m
  43. memory: 128Mi
  44. securityContext:
  45. privileged: true