job.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. apiVersion: batch/v1
  2. kind: Job
  3. metadata:
  4. name: guix-rde-image-workstation
  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. - /bin/sh
  20. - -c
  21. - |
  22. nsenter --target "1" --mount --uts --ipc --net --pid --no-fork \
  23. /run/setuid-programs/sudo --user=oleg --login bash <<'EOF'
  24. set -o nounset -o errexit -o pipefail -o xtrace
  25. cd /home/oleg/src/github.com/abcdw/rde
  26. image=$(make --silent -C examples live/image/container)
  27. skopeo copy docker-archive:${image} docker://harbor.home.wugi.info/library/guix-rde-image-workstation:latest
  28. EOF
  29. image: docker-registry.wugi.info/library/util-linux-with-udev
  30. name: refresh
  31. resources:
  32. limits:
  33. cpu: 14000m
  34. memory: 4096Mi
  35. requests:
  36. cpu: 50m
  37. memory: 512Mi
  38. securityContext:
  39. privileged: true