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.
The artifacts variable, used to calculate the original images (ogImages) slice, is populated using the values from all the images in all the pipelines.
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.
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