Skip to content

add loading options#8540

Open
wind57 wants to merge 3 commits intotestcontainers:mainfrom
wind57:add-loading-option-for-k3s
Open

add loading options#8540
wind57 wants to merge 3 commits intotestcontainers:mainfrom
wind57:add-loading-option-for-k3s

Conversation

@wind57
Copy link
Copy Markdown

@wind57 wind57 commented Apr 15, 2024

No description provided.

@wind57
Copy link
Copy Markdown
Author

wind57 commented Apr 15, 2024

I'm proposing to add two methods that will load images into k3s.

  • the first one accepts a list of existing, local, images. It uses ctr i import <IMAGE_NAME> to achieve that
  • the second method accepts paths - this is useful for when running in CI/CD and images are cached in a directory using tar achieves.

We have been using this method of loading images for a few years in spring-cloud-kubernetes, but it seems that the proper place for these would be here (unless they already exist elsewhere and I missed them).

Thank you.

@wind57 wind57 marked this pull request as ready for review April 15, 2024 16:20
@wind57 wind57 requested a review from a team April 15, 2024 16:20
@codefromthecrypt
Copy link
Copy Markdown

I think one of the more important points is that this is to reach parity of k3s in Go, something I had asked for. Thanks @wind57! https://github.com/testcontainers/testcontainers-go/blob/main/modules/k3s/k3s.go#L186-L218

@wind57
Copy link
Copy Markdown
Author

wind57 commented Apr 29, 2024

is there anything else needed from me here? I can keep this branch up to date, if there is interest in this at all. thank you

@codefromthecrypt
Copy link
Copy Markdown

@wind57 I no longer work at the same company that this was relevant to. I still think this is helpful, but as it has been many months, I wouldn't feel bad if you close it either. Up to you

@wind57
Copy link
Copy Markdown
Author

wind57 commented Apr 17, 2026

if there is still interest for this one, I will be glad to provide more input.

In this PR, I was creating a tar ball, copy over, unpack, use.

Since we were using this code in spring-cloud-kubernetes, we realized that we might not need all these steps. So we decided to use ctr pull inside.

I can change this PR to account for both ways to do it. Thank you

@eddumelendez
Copy link
Copy Markdown
Member

In this PR, I was creating a tar ball, copy over, unpack, use.

Since we were using this code in spring-cloud-kubernetes, we realized that we might not need all these steps. So we decided to use ctr pull inside.

creating a tar ball, copy over, unpack are too many steps. If there is a way to let k3s read/pull images connecting to the existing docker daemon, that would be great. I have attempted in the past but with no success.

@wind57
Copy link
Copy Markdown
Author

wind57 commented May 3, 2026

If there is a way to let k3s read/pull images connecting to the existing docker daemon

this isn't possible as we are talking about different things. containerd can not use dockerd or at least use its cache, where images build via docker build reside.

The only possible way that I have in my mind is via a registry. I am going to try that to see where it takes me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants