Kind Cluster Setup

Lightweight local Kubernetes clusters using Docker containers as nodes. The fastest way to spin up a multi-node K8s environment for learning, CI/CD, and CKA practice.

Source: CKA Day 6 — Kind Tutorial

What is Kind?

Kind (Kubernetes IN Docker) runs local Kubernetes clusters where each “node” is a Docker container running systemd and all Kubernetes components.

AspectKindminikube
RuntimeDocker containersVM (or Docker driver)
StartupFasterSlower
Multi-nodeNative supportLimited
CI/CDExcellentModerate
Best forDev, testing, learningLocal dev with addons

Prerequisites

Single-Node Cluster

# Create default cluster (1 control-plane node)
kind create cluster
 
# Verify
kubectl get nodes
kubectl get pods -n kube-system   # See system components in their default namespace

Multi-Node Cluster

Define topology in kind-config.yaml:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker
kind create cluster --name cka-cluster --config kind-config.yaml
kubectl get nodes

Cluster Management

CommandPurpose
kind create clusterCreate default cluster
kind create cluster --name <name>Create named cluster
kind create cluster --config <file>Create from config
kind get clustersList all clusters
kind delete clusterDelete default cluster
kind delete cluster --name <name>Delete named cluster

Loading Local Images

Kind does not automatically see host Docker images. Load them explicitly:

docker build -t myapp:1.0 .
kind load docker-image myapp:1.0 --name cka-cluster
kubectl run myapp --image=myapp:1.0

Port Mapping

Expose cluster services to your host machine. This is essential for NodePort Services because Kind runs Kubernetes inside Docker containers — node ports are not automatically reachable from the host without explicit mapping.

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

With this config, a NodePort Service exposed on port 30001 inside the Kind node becomes accessible at localhost:30001 on your host. On cloud VMs, bare metal, or the CKA exam, NodePort works without extra configuration. Source: CKA Day 9

CKA Relevance

Kind provides a safe sandbox for:

  • Practicing kubectl commands and YAML manifests
  • Observing pod scheduling across multiple nodes
  • Testing control plane and networking behaviors
  • Reproducing cluster issues locally

Tags: kubernetes kind local-cluster cka devops docker