Skip to content

Conversation

@Blaimi
Copy link

@Blaimi Blaimi commented Nov 23, 2025

This POC abstracts docker save to the providers so that images from podman and nerdctl can also be used with the load container-image command can be used instead of restrict it to docker with load docker-image.

TBD

  • With this implementation, you can only use the same provider for loading images as is used for running kind. I.e. it is not possible to load an image from podman and have the cluster running in docker. Changing this would either need to have multiple commands (like load {docker,podman,nerdctl}-image and/or have additional configuration options like KIND_EXPERIMENTAL_PROVIDER.

TODO

  • ajust unit-tests
  • run actual tests (didn't even test it on my machine)
  • better abstraction of the backwards-compatibility code for load docker-image because it is actually copy&paste with very small ajustments.

Fix: #2038
Relates: GoogleContainerTools/skaffold#9901

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/provider/docker Issues or PRs related to docker labels Nov 23, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Blaimi
Once this PR has been reviewed and has the lgtm label, please assign aojea for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 23, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added area/provider/nerdctl Issues or PRs related to nerdctl area/provider/podman Issues or PRs related to podman labels Nov 23, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @Blaimi!

It looks like this is your first PR to kubernetes-sigs/kind 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kind has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 23, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @Blaimi. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 23, 2025
@Blaimi Blaimi force-pushed the feature/2038_load-with-providers branch from 650366c to 7f09e46 Compare November 23, 2025 23:45
@Blaimi Blaimi changed the title Feature/2038 load with providers replace load docker-image with load container-image to support multiple providers Nov 23, 2025
Copy link
Contributor

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this implementation, you can only use the same provider for loading images as is used for running kind. I.e. it is not possible to load an image from podman and have the cluster running in docker.

I think that's fine and would probably be the expected/desired behavior for most users.

Short: "Loads docker images from host into nodes",
Long: "Loads docker images from host into all or specified nodes by name",
Deprecated: "Please use 'kind load container-image' instead of 'kind load docker-image', 'docker-image' will be removed in future releases and is restricted to the docker-provider.",
RunE: func(cmd *cobra.Command, args []string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked closely, but can we have this command just call the new code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This would break existing installations, where the image is built/available via docker but the cluster runs on podman/nerdctl. I'm a huge fan of not breaking stuff because of new features ;-)

@Blaimi Blaimi force-pushed the feature/2038_load-with-providers branch from 7f09e46 to 720bccc Compare November 24, 2025 15:33
Copy link
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple quick thoughts

I think this overall makes sense, but it's also not quite the UX discussed in the issue (can't override source, only supports locally stored images ...).

}

// ContainerSave saves images to dest, as in `docker save`
func (p *provider) ContainerSave(images []string, dest string) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saving images from storage isn't really a property of implementing nodes, and this is already a pretty complicated object. I think we should probably split this out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also lose the ability to import across providers cleanly, which while a bit weird we probably already have users doing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saving images from storage isn't really a property of implementing nodes, and this is already a pretty complicated object. I think we should probably split this out.

Any idea for locations? I would suggest pkg/cmd/kind/load/providers/*/provider.go

We also lose the ability to import across providers cleanly, which while a bit weird we probably already have users doing.

Can you explain that? load docker-image will be backwards compatible.

@@ -0,0 +1,262 @@
/*
Copyright 2019 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new files should drop the year (previously they should've had the year of creation, so 2025 here)

dropping the year is ... new kubernetes/steering#299

return
}
exists = true
sanitizedImage = sanitizeImage(imageName)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may be inaccurate on podman where the user may have configured a different default image host because :reasons:

for our own node images, forcing the default host we actually use makes sense, for user's images ... maybe not

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any suggestion? Just not sanitizing will lead to an error then—or make the command interactive which might lead to new problems …

Copy link
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renaming the existing command, modifying it, and then back-adding a supposedly compatible version seems ... far more confusing than just introducing a new command to begin with and leaving the existing one ~untouched

@Blaimi
Copy link
Author

Blaimi commented Nov 25, 2025

renaming the existing command, modifying it, and then back-adding a supposedly compatible version seems ... far more confusing than just introducing a new command to begin with and leaving the existing one ~untouched

That's for the long run of the git history. Once the then deprecated load docker-image is removed, the history of the files has the correct origins. And I'm not happy with this implementation because it contains a lot of duplicate code. If this gets resolved with clean abstractions, it might make even more sense to "rename&add for bc" instead of "add new&deprecate"

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

Labels

area/provider/docker Issues or PRs related to docker area/provider/nerdctl Issues or PRs related to nerdctl area/provider/podman Issues or PRs related to podman cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unified image loading: podman/docker/nerdctl/tarball

4 participants