Steps
- Save cluster.yaml with boilerplate template, I have changed my name: to home-lab
- Deploy Cluster
kind create cluster --config cluster.yaml
Creating cluster "home-lab" ...
✓ Ensuring node image (kindest/node:v1.34.0)
✓ Preparing nodes
✓ Writing configuration
✓ Starting control-plane
✓ Installing CNI
✓ Installing StorageClass
✓ Joining worker nodes
Set kubectl context to "kind-home-lab" - Verification:
kind get clusters
kubectl get nodesNAME STATUS ROLES AGE VERSION
home-lab-control-plane Ready control-plane 5m25s v1.34.0
home-lab-worker Ready <none> 5m9s v1.34.0
home-lab-worker2 Ready <none> 5m9s v1.34.0
home-lab-worker3 Ready <none> 5m9s v1.34.0
Common Commands
Deploy Cluster
kind create cluster
List Clusters
kind get clusters
Boilerplate Template for MultiNode Cluster
apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
name: kind
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
- role: worker
- role: worker
- role: worker We have one control plane node, and 3 worker nodes. The control plane role sets up the taints etc so your deployments will not usually end up there. I
extraPortMappings: allows connecting to the kind cluster once we start using the ingress. We don’t need this when port-forwarding