{"record":{"id":"a205aa2c01b38edf","repo":"GoogleContainerTools/skaffold","slug":"loading-images-into-k3d-nodes-w","errorCode":null,"errorMessage":"loading images into k3d nodes: %w","messagePattern":"loading images into k3d nodes: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/kubernetes/loader/load.go","lineNumber":110,"sourceCode":"\t}\n\n\tartifacts := imagesToLoad(localImages, deployerImages, images)\n\n\tif config.IsKindCluster(i.kubeContext) {\n\t\tkindCluster := config.KindClusterName(currentContext.Cluster)\n\n\t\t// With `kind`, docker images have to be loaded with the `kind` CLI.\n\t\tif err := i.loadImagesInKindNodes(ctx, out, kindCluster, artifacts); err != nil {\n\t\t\treturn fmt.Errorf(\"loading images into kind nodes: %w\", err)\n\t\t}\n\t}\n\n\tif config.IsK3dCluster(i.kubeContext) {\n\t\tk3dCluster := config.K3dClusterName(currentContext.Cluster)\n\n\t\t// With `k3d`, docker images have to be loaded with the `k3d` CLI.\n\t\tif err := i.loadImagesInK3dNodes(ctx, out, k3dCluster, artifacts); err != nil {\n\t\t\treturn fmt.Errorf(\"loading images into k3d nodes: %w\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// loadImagesInKindNodes loads artifact images into every node of a kind cluster.\nfunc (i *ImageLoader) loadImagesInKindNodes(ctx context.Context, out io.Writer, kindCluster string, artifacts []graph.Artifact) error {\n\toutput.Default.Fprintln(out, \"Loading images into kind cluster nodes...\")\n\treturn i.loadImages(ctx, out, artifacts, func(tag string) *exec.Cmd {\n\t\treturn exec.CommandContext(ctx, \"kind\", \"load\", \"docker-image\", \"--name\", kindCluster, tag)\n\t})\n}\n\n// loadImagesInK3dNodes loads artifact images into every node of a k3s cluster.\nfunc (i *ImageLoader) loadImagesInK3dNodes(ctx context.Context, out io.Writer, k3dCluster string, artifacts []graph.Artifact) error {\n\toutput.Default.Fprintln(out, \"Loading images into k3d cluster nodes...\")\n\treturn i.loadImages(ctx, out, artifacts, func(tag string) *exec.Cmd {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/kubernetes/loader/load.go#L92-L128","documentation":"LoadImages detects a k3d cluster from the kubeContext and delegates image loading to the k3d CLI via loadImagesInK3dNodes. This error wraps any failure from that path — the k3d CLI missing, cluster not found, or the k3d image import command failing. k3d, like kind, requires images to be explicitly imported into node containerd/docker.","triggerScenarios":"Running skaffold dev/run/deploy/verify with a kubeContext detected as k3d (config.IsK3dCluster), and loadImagesInK3dNodes fails: k3d binary absent, K3dClusterName resolves to a non-existent cluster, or `k3d image import` exits non-zero.","commonSituations":"k3d CLI not installed or an old version with different CLI flags; the k3d cluster was deleted but the kubeconfig context remains; Docker daemon down so the built image isn't available for import; cluster name mismatch because the context was renamed.","solutions":["Install/verify the k3d CLI (`k3d version`) and ensure it is on PATH","List clusters (`k3d cluster list`) and confirm the cluster named by the current context exists and is running","Verify Docker is running and the image tag exists locally (`docker images <tag>`)","Run `k3d image import <tag> -c <cluster>` manually to see the underlying error","Fix the kubeconfig so the context/cluster naming matches the k3d cluster name"],"exampleFix":"// before: stale k3d context\ncurrent-context: k3d-old-cluster\n// after: use the live k3d cluster\nkubectl config use-context k3d-mycluster\n# or recreate it: k3d cluster create mycluster","handlingStrategy":"validation","validationCode":"// Before running skaffold against k3d\nif _, err := exec.LookPath(\"k3d\"); err != nil {\n    return fmt.Errorf(\"k3d CLI not found on PATH: %w\", err)\n}\nout, _ := exec.Command(\"k3d\", \"cluster\", \"list\").Output()\nif !strings.Contains(string(out), clusterName) {\n    return fmt.Errorf(\"k3d cluster %q not found\", clusterName)\n}","typeGuard":null,"tryCatchPattern":"err := loader.LoadImages(ctx, out, artifacts)\nif err != nil {\n    if strings.Contains(err.Error(), \"loading images into k3d nodes\") {\n        log.Warnf(\"k3d import failed: %v\", err)\n        return pushToRegistry(ctx, artifacts) // fallback\n    }\n    return err\n}","preventionTips":["Install/upgrade k3d CLI; old versions have different import flags","Confirm Docker daemon is up before building/importing","Recreate or update kubeconfig after renaming/deleting k3d clusters"],"tags":["kubernetes","k3d","image-loading","cli"],"backgroundTag":"k3d-image-import-failed","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}