GoogleContainerTools/skaffold · error

loading images into kind nodes: %w

Error message

loading images into kind nodes: %w

What it means

LoadImages detects a kind cluster from the kubeContext and delegates image loading to the kind CLI via loadImagesInKindNodes. This error wraps any failure from that path — the kind CLI is missing, fails, or rejects the load command. It occurs because kind (unlike a registry-backed cluster) needs images injected into its nodes explicitly.

Source

Thrown at pkg/skaffold/kubernetes/loader/load.go:101

}

// LoadImages loads images into a local cluster.
// imagesToLoad is used to determine the set of images we should load, based on images that are
// marked as local by the Runner, and part of the calling Deployer's set of manifests
func (i *ImageLoader) LoadImages(ctx context.Context, out io.Writer, localImages, deployerImages, images []graph.Artifact) error {
	currentContext, err := i.getCurrentContext()
	if err != nil {
		return err
	}

	artifacts := imagesToLoad(localImages, deployerImages, images)

	if config.IsKindCluster(i.kubeContext) {
		kindCluster := config.KindClusterName(currentContext.Cluster)

		// With `kind`, docker images have to be loaded with the `kind` CLI.
		if err := i.loadImagesInKindNodes(ctx, out, kindCluster, artifacts); err != nil {
			return fmt.Errorf("loading images into kind nodes: %w", err)
		}
	}

	if config.IsK3dCluster(i.kubeContext) {
		k3dCluster := config.K3dClusterName(currentContext.Cluster)

		// With `k3d`, docker images have to be loaded with the `k3d` CLI.
		if err := i.loadImagesInK3dNodes(ctx, out, k3dCluster, artifacts); err != nil {
			return fmt.Errorf("loading images into k3d nodes: %w", err)
		}
	}

	return nil
}

// loadImagesInKindNodes loads artifact images into every node of a kind cluster.
func (i *ImageLoader) loadImagesInKindNodes(ctx context.Context, out io.Writer, kindCluster string, artifacts []graph.Artifact) error {
	output.Default.Fprintln(out, "Loading images into kind cluster nodes...")

View on GitHub (pinned to a1189de023)

Solutions

  1. Install/verify the kind CLI: `kind version`; ensure it is on PATH
  2. Confirm the kind cluster is running: `kind get clusters` and that the current kubectl context matches it
  3. Verify the image was built locally and the Docker daemon is up (`docker images <tag>`)
  4. Run `kind load docker-image <tag> --name <cluster>` manually to see the raw failure
  5. Ensure config.KindClusterName(currentContext.Cluster) maps to the right cluster name; fix kubeconfig context naming if not

Example fix

// before: context points to a stale kind cluster
current-context: kind-kind-stale
// after: point kubeContext at the running kind cluster
kubectl config use-context kind-kind
# then re-run skaffold
Defensive patterns

Strategy: validation

Validate before calling

// Before running skaffold against kind
if _, err := exec.LookPath("kind"); err != nil {
    return fmt.Errorf("kind CLI not found on PATH: %w", err)
}
out, err := exec.Command("kind", "get", "clusters").Output()
if err != nil || !strings.Contains(string(out), clusterName) {
    return fmt.Errorf("kind cluster %q is not running", clusterName)
}

Try / catch

err := loader.LoadImages(ctx, out, artifacts)
if err != nil {
    if strings.Contains(err.Error(), "loading images into kind nodes") {
        // fall back to pushing via registry instead of kind load
        return pushToRegistry(ctx, artifacts)
    }
    return err
}

Prevention

When it happens

Trigger: Running skaffold dev/run/deploy/verify against a kubeContext whose cluster is detected as kind (config.IsKindCluster), and loadImagesInKindNodes fails: kind binary absent, wrong cluster name, or kind load docker-image command exits non-zero.

Common situations: kind binary not on PATH; multiple kind clusters and current context points to one that is not running; Docker daemon not reachable so the image isn't present for `kind load docker-image`; kubectl context renamed so KindClusterName resolves to a wrong cluster.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/29271417b2d33af3. Report an issue: GitHub.