kube-image-prefetch
kube-image-prefetch copied to clipboard
Exit containers rather than sleep
As the DaemonSet is recreated on any change to needed images we have no need to keep the pods running on each node. Instead we should be able to exit each container with a 0 exit code and set the restart policy to only restart on failure.
It looks like this may not be possible with a Daemonset. Maybe It's worth looking in to creating a job that runs on all nodes?
Why is the Daemonset recreated? Would it not be possible to have it change only if there is an actual change to the Daemonset itself rather than on a derived / dependent resource like a Deployment? If some kind of workload orchestration is required, maybe it would be a reasonable solution to have the Daemonset spawn up jobs that does the actual pull?