Skip to content

KIND: Kubernetes in Docker

KIND (Kubernetes IN Docker) is an official Kubernetes SIG tool that runs local clusters where each cluster node is a Docker container.


Terminal window
# On Linux (x86_64)
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
# On macOS via Homebrew
brew install kind
# Verify installation
kind version

Create a declarative cluster config file kind-config.yaml:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30080
hostPort: 8080
protocol: TCP
- role: worker
- role: worker

Spin up the cluster:

Terminal window
# Create cluster using config
kind create cluster --name dev-cluster --config kind-config.yaml
# Verify cluster nodes
kubectl get nodes -o wide