GoogleContainerTools / skaffold

Easy and Repeatable Kubernetes Development
https://skaffold.dev/
Apache License 2.0
15.08k stars 1.63k forks source link

Improve/fix load Image logic in deployers, related with Kind and K3D #8946

Open renzodavid9 opened 1 year ago

renzodavid9 commented 1 year ago

When running skaffold dev in a project with multiple modules, each pointing to different local clusters (Kind and/or K3D), Skaffold will try load all the images, from all the modules, in all the clusters, this is not needed.

We should load only the proper images in each cluster, that means, only the images detected in the module for each context.

Looks like the problem relies in the way we are calculating the images to load, for instance: https://github.com/GoogleContainerTools/skaffold/blob/a3ee2cc2254181ff375e29da7ab60ef8e23174b8/pkg/skaffold/deploy/kubectl/kubectl.go#L116-L122

The artifacts variable, used to calculate the original images (ogImages) slice, is populated using the values from all the images in all the pipelines.

For more context about this issue, check this comment.

Information

Skaffold yaml file for repoduction: Pending

jeroenrinzema commented 7 months ago

I've noticed this issue as well. Often, cached images are loaded even though they are available within the cluster, resulting in long deployment cycles as we wait for these cached images to be loaded into k3d.