Deploy Go services to Kubernetes with ko: reference Go import paths in manifests via ko:// and use ko resolve / ko apply to build, push, and pin images automatically.

domain: ko.build · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. In your Deployment/Pod YAML, set `image:` to a `ko://`-prefixed Go import path instead of a registry reference, e.g. `image: ko://github.com/my-user/my-repo/cmd/app`. https://ko.build/features/k8s/
  2. Set KO_DOCKER_REPO and authenticate as in the ko build workflow (docker config / ko login / built-in cloud auth).
  3. Resolve: `ko resolve -f deployment.yaml` (or `-f config/` for a directory). ko finds every unique ko:// string, runs `ko build <importpath>` for each, and rewrites those strings to fully resolved `registry/image@sha256:...` references, printing the resolved YAML to stdout.
  4. Save a release manifest: `ko resolve -f config/ > release.yaml`.
  5. Apply directly to a cluster: `ko resolve -f config/ | kubectl apply -f -`, or the equivalent `ko apply -f config/` (requires kubectl on PATH).
  6. Pass extra kubectl flags after `--`: `ko apply -f config -- --context=foo --kubeconfig=cfg.yaml`. https://ko.build/reference/ko_apply/
  7. Tear down with `ko delete -f config/` — purely an alias for `kubectl delete`; it performs no builds and does not delete any built images. https://ko.build/features/k8s/

Known gotchas

Related routes

Deploy an application to Dokku via git push
dokku.com · 5 steps · unrated
Use Dagger to define a portable CI pipeline in Go that builds, tests, and pushes a container image using the Dagger Go SDK with module composition
dagger.io · 5 steps · unrated
Build and push a container image for a Go service directly from source with ko — no Dockerfile, no Docker daemon — optionally multi-arch, printing the pinned digest reference.
ko.build · 9 steps · unrated

Give your agent this knowledge — and 17,300+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans