preload a docker image on the k3s node agents#141
preload a docker image on the k3s node agents#141ibuildthecloud merged 3 commits intok3s-io:masterfrom
Conversation
|
Confirmed that this version is working for my use case in #92 |
|
Does this work with compressed archives too? Just curious. |
pkg/agent/containerd/containerd.go
Outdated
| } | ||
| } | ||
|
|
||
| imageDir := "/var/lib/rancher/k3s/agent/images" |
There was a problem hiding this comment.
You need to add a new struct field, cfg.Containerd.Images which is the path to the images and then setup the real path in pkg/agent/config/config.go run(...)
pkg/agent/containerd/containerd.go
Outdated
| for _, fileInfo := range fileInfos { | ||
| if !fileInfo.IsDir() { | ||
| filePath := filepath.Join(imageDir, fileInfo.Name()) | ||
| fileContent, err := ioutil.ReadFile(filePath) |
There was a problem hiding this comment.
This is going to cause memory issues because you are reading the whole thing into memory (could be gigabytes). Can you just open the file and pass that to import?
Have not tried yet. Also, I have a strange issue: when using this image only for worker nodes, coredns never starts. Trying to work from latest v0.2.0-rc2 to provide a reproducible use case. |
|
@dduportal Sorry v0.2.0-rc2 is not working. I deleted the tag because it completely fails to start. So master is basically broken. I'm trying to fix now. Also need better CI :/ |
|
Master is fixed and v0.2.0-rc3 is released which is stable again. |
I think that the |
|
@juliens That's fine. We can add support for compression later. I left just one more small comment, if you can address that I'll merge and do a build with this in it. |
Co-Authored-By: juliens <julien.salleyron@gmail.com>
|
@juliens This should be in v0.2.0-rc4 now if you could please validate the build that would be great! |
|
We (the Traefik team: @juliens, @dduportal and me) will validate if the k3s-inator 😄 works well tomorrow morning (it's 2am for us). |
|
It works perfectly. Thanks ;) 👏 |
|
Confirmed here also: works like a charm (v0.2.0-rc4 with image preloading). |
|
I have added images which I exported with I get the following error.
This should work right? |
Hi, I just used this feature today. It looks like an image tagged as This can be observed through this command: |
This PR adds preloading existing container images (
docker saveformat ) from/var/lib/rancher/k3s/agent/imagesFixes #92