GoogleContainerTools/skaffold · error

creating deployer: %w

Error message

creating deployer: %w

What it means

`GetDeployer` instantiates the deployer (kubectl, helm, kustomize, kpt, or cloud) from the skaffold.yaml deploy config. This wraps failures creating it — including missing/invalid kubeconfig context referenced at construction time.

Source

Thrown at pkg/skaffold/runner/new.go:91

	}

	var deployer deploy.Deployer

	hydrationDir, err := util.GetHydrationDir(runCtx.Opts, runCtx.WorkingDir, true, isKptRendererOrDeployerUsed(runCtx.Pipelines))
	if err != nil {
		return nil, fmt.Errorf("getting render output path: %w", err)
	}

	renderer, err := GetRenderer(ctx, runCtx, hydrationDir, labeller.Labels(), runCtx.UsingLegacyHelmDeploy())
	if err != nil {
		endTrace(instrumentation.TraceEndError(err))
		return nil, fmt.Errorf("creating renderer: %w", err)
	}

	deployer, err = GetDeployer(ctx, runCtx, labeller, hydrationDir, runCtx.UsingLegacyHelmDeploy())
	if err != nil {
		endTrace(instrumentation.TraceEndError(err))
		return nil, fmt.Errorf("creating deployer: %w", err)
	}
	rOpts := platform.ResolverOpts{
		KubeContext:               runCtx.KubeContext,
		CliPlatformsSelection:     runCtx.Opts.Platforms,
		CheckClusterNodePlatforms: runCtx.CheckClusterNodePlatforms(),
		DisableMultiPlatformBuild: runCtx.DisableMultiPlatformBuild(),
	}

	platforms, err := platform.NewResolver(ctx, runCtx.Pipelines.All(), rOpts)
	if err != nil {
		endTrace(instrumentation.TraceEndError(err))
		return nil, fmt.Errorf("getting target platforms: %w", err)
	}

	var verifier verify.Verifier
	verifier, err = GetVerifier(ctx, runCtx, labeller)
	if err != nil {
		endTrace(instrumentation.TraceEndError(err))

View on GitHub (pinned to a1189de023)

Solutions

  1. Check the wrapped error; fix the corresponding `deploy:` block in skaffold.yaml.
  2. Verify the kube-context exists: `kubectl config get-contexts`; create/update kubeconfig in CI via kubeconfig secret.
  3. Validate helm/kubectl flags passed via `flags` are supported by the installed binary version.
  4. Run `skaffold diagnose` for detailed config validation.

Example fix

// skaffold.yaml before
deploy:
  kubectl:
    flags:
      apply: ["--unknown-flag"]
// after
deploy:
  kubectl: {}
Defensive patterns

Strategy: validation

Validate before calling

func kubeContextExists(name string) error {
  out, err := exec.Command("kubectl", "config", "get-contexts", "-o", "name").Output()
  if err != nil { return err }
  return fmt.Errorf("context %q found=%v", name, strings.Contains(string(out), name))
}

Try / catch

runner, err := runner.NewForConfig(runCtx)
if err != nil {
  if strings.Contains(err.Error(), "creating deployer") {
    return fmt.Errorf("deployer setup failed - check deploy config and kubeconfig: %w", err)
  }
  return err
}

Prevention

When it happens

Trigger: skaffold.yaml `deploy:` config that fails during construction: references a kube-context that doesn't exist, invalid kubectl/helm flags, malformed `kpt` deploy config, or the kubeconfig cannot be parsed when the deployer validates cluster access.

Common situations: Typo'd `kubeContext` name; CI environment without `~/.kube/config`; helm deployer with invalid `flags` or chart values; migrating from legacy `deploy.kustomize` to the renderer while deploy config remains inconsistent.

Related errors


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