这是indexloc提供的服务,不要输入任何密码
Skip to content

Skaffold not automatically loading images into KinD cluster #9829

@mikluko

Description

@mikluko

Expected behavior

When deploying to a KinD cluster, Skaffold should automatically detect the local cluster and load built images directly into the cluster nodes instead of pushing to a remote registry and having the cluster pull them.

Actual behavior

Skaffold builds images locally but does not load them into the KinD cluster. The cluster attempts to pull images from the remote registry (ghcr.io), resulting in authentication failures since the cluster nodes don't have registry credentials.

Information

  • Skaffold version: 2.16.0 (also tested with 2.15.0 and 2.14.0)
  • Operating system: macOS Darwin 24.5.0 (arm64)
  • Installation method: GitHub releases (curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.16.0/skaffold-darwin-arm64)
  • Contents of skaffold.yaml:
apiVersion: skaffold/v4beta13
kind: Config
metadata:
  name: upkind

build:
  local:
    useBuildkit: true
    useDockerCLI: true
    concurrency: 0
    push: true
    tryImportMissing: true
  tagPolicy:
    gitCommit:
      variant: AbbrevCommitSha
  artifacts:
    - image: ghcr.io/uptime-com/upkind/toolbox
      context: docker/toolbox

manifests:
  rawYaml:
    - job.yaml

deploy:
  kubectl: {}

Contents of job.yaml (demonstrates toolbox image usage):

apiVersion: batch/v1
kind: Job
metadata:
  name: test-job
spec:
  template:
    spec:
      containers:
      - name: test
        image: ghcr.io/uptime-com/upkind/toolbox
        command: ["echo", "hello"]
      restartPolicy: Never

Steps to reproduce the behavior

  1. Create a KinD cluster: kind create cluster
  2. Set global config: skaffold config set --global local-cluster true
  3. Run Skaffold: skaffold run --force --cache-artifacts=false
  4. Observe that Skaffold detects local cluster but doesn't load images
  5. Check cluster for images: docker exec kind-control-plane crictl images | grep toolbox (returns empty)
  6. See authentication errors in pod logs when cluster tries to pull from registry

Debug evidence:

  • Skaffold correctly detects KinD: Found [kind-kind] context, using local docker daemon.
  • Local cluster detection works: Using local-cluster=true from config
  • Images build successfully and exist locally
  • Different versions show different symptoms:
    • v2.16.0/v2.15.0: 401 Unauthorized errors from registry
    • v2.14.0: Container image ... is not present with pull policy of Never

Workaround: Manual loading works: kind load docker-image <image>

This appears to be a regression affecting automatic KinD image loading across multiple recent Skaffold versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions