Step-by-Step: Install Kubernetes with Kind (Kubernetes IN Docker) on RHEL 9 / CentOS Stream 9
Introduction:
Kind (Kubernetes IN Docker) runs full Kubernetes clusters as Docker containers. It’s lightweight, easy to create/destroy, and ideal for local development, CI, and CKA/CKAD practice. This guide walks you through installing Docker, Kind, and kubectl on a RHEL 9 / CentOS Stream 9 host and creating both single-node and multi-node clusters (control plane + worker nodes).
Prerequisites:
1) Hardware/Host
- A machine with at least 4 CPU cores and 8+ GB RAM recommended for multi-node clusters (1 control-plane + 2 workers).
- 20+ GB free disk recommended.
- Docker runs on the host.
2) OS & Access
- A RHEL 9 / CentOS Stream 9 system (or compatible).
- A user with
sudoprivileges (commands usesudowhere needed). - Internet access to download binaries and Docker images.
3) Software/Tools
curl,yum/dnf,sha256sumavailable (standard on RHEL/CentOS).- Optional:
gitif you want to pull repo manifests.
4) Network & Security
- Outbound HTTPS allowed to
dl.k8s.io, Docker repos. - If you have strict firewall rules, allow Docker and host ports you map (we use
hostPortin example).
Overview of the Setup Process
- Update the system.
- Install Docker.
- Install
kind. - Install
kubectl. - Create a single-node cluster (control plane).
- Create a multi-node cluster (control plane + 2 workers) with extra port mapping.
- Verify the cluster and run basic checks.
- (Optional) Delete the cluster.
ALSO READ:
- The Essential 5-Step Guide to Successfully Integrate Alertmanager with Prometheus and Send Email Alerts
- Complete 3-Step Guide to Successfully Set Up Prometheus, Node Exporter, and Grafana on Linux Server
- Effortless Way to Automatically Archive Log Files Older Than 30 Days in Linux with Bash Script
Step-by-step installation
Update the system
sudo yum update -yInstall Docker
# install required plugin
sudo dnf -y install dnf-plugins-core
# add Docker repo
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo
# install Docker and CLI
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# enable & start
sudo systemctl enable --now docker
# verify
docker --versionInstall kind (Kubernetes in Docker)
# For AMD64 / x86_64
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-linux-amd64
# For ARM64
[ $(uname -m) = aarch64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.30.0/kind-linux-arm64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
# verify
kind --versionNote: Replace the
v0.30.0version string if you want a newer kind release. Use thereleases page to check the latest.
Install kubectl CLI
# Download latest stable kubectl for linux/amd64
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
# Download checksum and verify
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
# install
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
# or place in local bin
chmod +x kubectl
mkdir -p ~/.local/bin
mv ./kubectl ~/.local/bin/kubectl
# verify
kubectl version --client --output=yaml
Create a single-node cluster (simple):
kind create cluster --image=kindest/node:v1.34.0@sha256:7416a61b42b1662ca6ca89f02028ac133a309a2a30ba309614e8ec94d976dc5a --name cka-cluster1
kubectl cluster-info --context kind-cka-cluster1
kubectl get nodesNote:
1)--image=kindest/node:v1.34.0pins the node image (Kubernetes version 1.34.0). Change to the version you prefer.2) Kind will use Docker to create container nodes.
Create a multi-node cluster (control-plane + 2 workers) with host port mapping
Create a config file kind-extraPortMappings-multi-nodeclusters.yml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30001
hostPort: 30001
- role: worker
- role: worker
Run the command
kind create cluster --image=kindest/node:v1.34.0@sha256:7416a61b42b1662ca6ca89f02028ac133a309a2a30ba309614e8ec94d976dc5a --config kind-extraPortMappings-multi-nodeclusters.yml --name cka-cluster1
Verify:
docker ps -a # should show kind containers cka-cluster1-control-plane, -worker, -worker2
kubectl get nodes
kubectl get pods -AVerify cluster & inspect nodes
kubectl cluster-info --context kind-cka-cluster1
kubectl get nodes -o wide
kubectl describe node cka-cluster1-control-plane
kubectl get pods -ADelete the cluster
kind delete cluster --name cka-cluster1
# confirm
kind get clusters
docker ps -aEX – Screenshot:

