job.yaml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. apiVersion: batch/v1
  2. kind: Job
  3. metadata:
  4. name: nix-container-systemd
  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. kubectl --namespace=nix exec --stdin=true pod/runc-kube1-nix-builder -- runc exec -e TERM=screen-256color -e USER=oleg -u 1000:998 --additional-gids 131 nix-builder /usr/bin/env bash -l <<'EOL'
  26. cd "${HOME}/.local/share/chezmoi" || exit 1
  27. nix-shell -p skopeo --command 'make container-systemd-taskexecutor'
  28. EOL
  29. EOF
  30. image: docker-registry.wugi.info/library/util-linux-with-udev
  31. name: refresh
  32. resources:
  33. limits:
  34. cpu: 14000m
  35. memory: 4096Mi
  36. requests:
  37. cpu: 50m
  38. memory: 512Mi
  39. securityContext:
  40. privileged: true