-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
minikube image cache slow (Support image caching for 'clean resetup') #14032
Comments
Yes. The cache directory is on the host. It gets copied to the node with Unfortunately not all container runtimes support having more than one image to load. So there is one tarball per image, which misses out on some optimization possibilities.
It is not possible to access the docker images remotely, without using a registry. But we could run a docker registry on the host, and have the nodes pull from there. Note however, that there might not be a docker daemon running on the host at all. |
I think that was a misunderstanding, it isn't really... It is more like the "minikube cache" and "minikube image" commands have different semantics, and different config memory. The cached images are recorded, and when a new cluster or node is started - they all get copied to it, same as |
When running with Docker on Linux, there are some optimizations that could be done with regards to the cache. The original kind implementation bakes the images into the "node" image, but that makes it harder to extend later. But one could also use the old * https://github.com/google/go-containerregistry#crane That would save the overhead of having to copy them, like we otherwise need to do when running virtual machines. I wouldn't say that these are "hacks", though. It is about image distribution, it's the bind-mount that is the hack. When running on a single Linux node, the easiest workaround would be to deploy Kubernetes right on the host. As soon as we have separate nodes, we need some way to distribute the images. The easiest being: a registry. |
This all makes sens to me. For the docker registry then, I would configure it as a pass-through cache to get images from something like |
Only the in-cluster registry is supported now, and only through the See the "registry" plugin |
I see, so I would have to re-tag all my images to be from that registry? and then push all the images to that registry on startup. Assuming I have them stored locally in docker to begin with. (This is if I want to do it all |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What Happened?
I am running a multi-node (2 to be specific) cluster via minikube. It takes about 10 minutes to setup from scratch (including image pulling).
Once everything is started up and running, I want to 'save' the images out so then I could do the clean setup again, but significantly faster (since we should not have to pull images again). So, I resorted to
minikube image ls | xargs minikube cache add
. This correctly gets all my images and adds them to~/.minikube/cache/images
. I thenminikube delete
, and start setting up my cluster again. This time though, my complete setup takes 15 minutes!? When I dominikube image ls
I see there are two copies of every image that I cached. I assume what it did was it copy all images to both my nodes ('minikube' and 'minikube-m02'). That is not needed nor desired, but regardless, how is starting from cached images, slower than just pulling from the internet? I have about 36 images and some are upwards of 2GB (total size is only 9GB though). I know it's not doing anything with the internet because I displayed wifi and it was able to start (also did not disable wifi and it still took the 15 minutes).Does the cache directory not get mounted to the minikube VM? Meaning it is copying 9GB into a VM, then into each of the nodes? My computer is able to copy the cache folder in (so I assume it is doing more than just copying that is taking forever?)
I have noticed that
cache
is being deprecated, so I attempted to useimage save
but that does not seem to do anything... I have gotten it to save when I explicitly specify a.tar
file, but I cannot seem to get multiple images to save to a tar file (not supported I assume).I was able to
minikube image ls | docker image pull
then save all via docker to one tar file, then load that back into minikube, this does not actually work for all the images it seemsI see there is the
eval $(minikube docker-env)
that (does not work for multi node clusters) that points your docker to minikubes docker, but why is there not a config to just have minikube point to local docker? That way the images always persist in my local docker and I do not have to try all these hacks to get around itAttach the log file
I am not uploading my logs, their are sensitive container names/images. Sorry.
Operating System
Ubuntu
Driver
Docker
The text was updated successfully, but these errors were encountered: