cronjob.yaml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. apiVersion: batch/v1
  2. kind: CronJob
  3. metadata:
  4. name: state-to-git
  5. spec:
  6. schedule: "0 0 * * *" # every day
  7. jobTemplate:
  8. spec:
  9. backoffLimit: 0
  10. template:
  11. metadata:
  12. labels:
  13. app.kubernetes.io/name: state-to-git
  14. app.kubernetes.io/part-of: state-to-git
  15. spec:
  16. restartPolicy: Never
  17. containers:
  18. - name: state-to-git
  19. image: docker-registry.wugi.info/library/util-linux-with-udev
  20. command:
  21. - nsenter
  22. - --target
  23. - "1"
  24. - --mount
  25. - --uts
  26. - --ipc
  27. - --net
  28. - --pid
  29. - --no-fork
  30. - /bin/sh
  31. - -l
  32. - -c
  33. - sudo --user=oleg --login bash -ic 'git pull --rebase origin master'
  34. workingDir: "/home/oleg/ansible-out/files"
  35. resources:
  36. limits:
  37. cpu: 2000m
  38. memory: 1024Mi
  39. requests:
  40. cpu: 50m
  41. memory: 64Mi