---
source: https://iinventedlight.com/library/notes/docker-build-builders-drivers-kubernetes.md
title: "Docker Buildx Kubernetes driver: run BuildKit pods in a cluster"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache License 2.0 (Docker, Inc.); Apache License 2.0 (Docker, Inc.); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Kubernetes driver; Docker, Inc., Kubernetes driver (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-27
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-27
as_of: 2026-11-27
confidence: medium
untested: "Not reproduced (2026-11-27). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-build-builders-drivers-kubernetes"
tags: [docker, buildx, kubernetes, buildkit, replicas]
client: Librarian
sources:
  - id: S1
    title: "Kubernetes driver"
    publisher: Docker, Inc.
    url: https://docs.docker.com/build/builders/drivers/kubernetes/
    accessed: 2026-11-27
    license: "Apache License 2.0"
  - id: S2
    title: "Kubernetes driver (source)"
    publisher: Docker, Inc.
    url: https://raw.githubusercontent.com/docker/docs/main/content/manuals/build/builders/drivers/kubernetes.md
    accessed: 2026-11-27
    license: "Apache License 2.0"
---
# Docker Buildx Kubernetes driver: run BuildKit pods in a cluster
**Answer:** The Kubernetes driver lets you connect your local development also or CI environments to builders in a Kubernetes cluster also to allow access to more powerful compute resources, optionally on multiple native architectures.

## Create the builder

A typical create command is docker buildx create --bootstrap --name=kube --driver=kubernetes, plus --driver-opt for driver-specific settings.

## Scaling and load balancing

namespace sets the Kubernetes namespace, defaulting to the namespace in the current Kubernetes context. replicas defaults to 1 and sets the number of Pod replicas to create.

default-load is false by default. default-load can automatically load images to the Docker Engine image store. The timeout is 120s before a build.

rootless starts at false and runs the container as a non-root user. loadbalance starts at sticky, or you can choose random. Under sticky, the pod is chosen from a hash of the context path.

Increasing replicas lets you use multiple nodes. random selects random nodes from the node pool. sticky, the default, connects the same build to the same node for better local cache use.

## Storage, scheduling, and QEMU

persistent-volume-claim.requests.storage puts the BuildKit cache on a PVC rather than the pod disk. With that option set, Buildx builds a StatefulSet rather than a Deployment.

Combined with replicas, each replica gets its own claim, so the cache stays with that pod across restarts. One example uses 20Gi of persistent storage per replica.

## See also

- [docker-build-builders-drivers-docker-container](https://iinventedlight.com/library/notes/docker-build-builders-drivers-docker-container/)
- [docker-build-builders](https://iinventedlight.com/library/notes/docker-build-builders/)
- [docker-build-buildkit-configure](https://iinventedlight.com/library/notes/docker-build-buildkit-configure/)

## Claims

- id: C1
  claim: The Kubernetes driver runs BuildKit in a cluster for Buildx.
  source: S2
  evidence: "run BuildKit in a Kubernetes cluster"

- id: C2
  claim: replicas starts at 1 and scales the BuildKit pod count.
  source: S1
  evidence: "Sets the number of Pod replicas to create"

- id: C3
  claim: sticky balancing is the default and hashes the context path.
  source: S2
  evidence: "If set to `sticky`, the pod is chosen"

- id: C4
  claim: A PVC size request makes Buildx create a StatefulSet.
  source: S2
  evidence: "creates a `StatefulSet` instead of a"

- id: C5
  claim: timeout starts at 120s while Buildx waits for pods.
  source: S2
  evidence: "Time         | `120s`"

## Sources

- [S1] Kubernetes driver. Docker, Inc.. https://docs.docker.com/build/builders/drivers/kubernetes/ . License: Apache License 2.0. Accessed 2026-11-27.

- [S2] Kubernetes driver (source). Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/manuals/build/builders/drivers/kubernetes.md . License: Apache License 2.0. Accessed 2026-11-27.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Kubernetes driver; Docker, Inc., Kubernetes driver (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
