Prerequisite: Ensure you are running PowerShell as Administrator for all installation commands.
First, install the necessary CLI tools using Chocolatey.
Kind (Kubernetes in Docker) is the tool used to run local Kubernetes clusters using Docker containers as "nodes."
choco install kindThe command line tool for communicating with the Kubernetes cluster.
choco install kubernetes-cliCreate a multi-node cluster configuration file. This example sets up 1 Control Plane node and 2 Worker nodes.
File: config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30001
hostPort: 30001
- containerPort: 30002
hostPort: 30002
- role: worker
- role: workerRun the following command to spin up the cluster using the configuration file created above.
kind create cluster --name cka-cluster1 --config config.yaml --image kindest/node:v1.33.4@sha256:25a6018e48dfcaee478f4a59af81157a437f15e6e140bf103f85a2e7cd0cbbf2Command Breakdown:
--name: Sets the name of the cluster (e.g.,cka-cluster1).--config: Points to your multi-node setup file.--image: Specifies the exact Kubernetes version to use (useful for certification practice like CKA).
Once the cluster is running, verify the status and ensure kubectl is pointing to the right place.
Checks if the control plane is running and CoreDNS is active.
kubectl cluster-info --context kind-cka-cluster1If you have multiple clusters (e.g., Docker Desktop, Minikube, and Kind), you need to manage which one kubectl talks to.
List all available contexts:
kubectl config get-contextsSwitch to a specific cluster:
kubectl config use-context <cluster-name>
# Example:
# kubectl config use-context kind-cka-cluster1When you are finished with your lab, you can delete the cluster to free up resources.
kind delete cluster --name cka-cluster1