Skip to content
Latchkey

kind create cluster: Ephemeral Clusters in CI

kind create cluster runs a full Kubernetes cluster inside Docker containers, ready in under a minute for ephemeral CI testing.

kind (Kubernetes IN Docker) gives a real API server and nodes as containers, perfect for integration tests that need an actual cluster and tear down clean.

What it does

kind create cluster boots a control plane (and optional worker nodes) as Docker containers, writes a kubeconfig context named kind-<name>, and waits for the API server. A --config file defines node count, port mappings, and feature gates.

Common usage

Terminal
kind create cluster --name ci
kind create cluster --name ci --config kind.yaml --wait 120s
kind create cluster --image kindest/node:v1.29.2
kubectl cluster-info --context kind-ci

Options

FlagWhat it does
--nameCluster name (context becomes kind-<name>)
--configCluster config YAML (nodes, ports, gates)
--imageNode image, pinning the Kubernetes version
--waitWait up to a duration for the control plane
--kubeconfigWrite kubeconfig to a specific path
--retainKeep containers on failure for debugging

In CI

Pin --image kindest/node:vX.Y.Z so the Kubernetes version is reproducible. Add --wait 120s so the next step does not race the API server. On GitHub-hosted runners Docker is already present; create the cluster, run tests, then kind delete cluster --name ci.

Common errors in CI

ERROR: failed to create cluster: ... Cannot connect to the Docker daemon means Docker is not running or the socket is unavailable. failed to create cluster: node(s) already exist for a cluster with the name "ci" means a leftover cluster; delete it first. failed to init node with kubeadm ... timed out on small runners is usually too little memory; reduce nodes or raise resources.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →