-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
docker-containers: add missing kubelet dependency for container systemd services #78313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-containers: add missing kubelet dependency for container systemd services #78313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand well, you would like to load Docker image in order to use them with the docker-containers
module. There is currently nothing to do this and it seems to me all images used by docker-containers
have to be fetched from an Docker registry.
In this context, I'm not in favor of adding a dependency to the kubelet service, just to load Docker images.
Instead, I think you could add a seedDockerImage
option in the docker-container
module and add some code to load this Docker image in the ExecStartPre
script of the container systemd service (something similar to the kubelet module).
If you need to load Docker images for testing purpose, you could use the dockerPreloader
module to speed up your tests since it avoids the Docker load at runtime.
Good points. I was not aware that loading docker images is so trivial that it can be done in a one liner and has nothing to do with kubelet at all. Since So after this we would have:
With having this, we could also remove What do you think? |
Why would you like to load all images in one go? Also, I think it would be easier to add a |
Take a look at #78366 ;) |
You can always mess with I'm neutral on the changes proposed here, but they seem unnecessary. |
Amazing! #78366 is exactly what i was looking for. This can be closed. Thanks! |
Motivation for this change
Currently docker container systemd services generated by the option
config.docker-containers
can crash on startup when kubelet is not seeding docker images fast enough.I found zero documentation on how to preload docker images via nixos config. But from reading #49379 I guess the right way to do it in production is by using
services.kubernetes.kubelet.seedDockerImages
.Therefore the systemd services of
config.docker-containers
should probably depend on kubelet and wait for it to start.Things done
Extend systemd service in
virtualisation/docker-containers.nix
to depend also onkubelet.service
in case kubelet is activated viaconfig.services.kubernetes.kubelet.enable
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)