3.2 KiB
Here's a step-by-step guide to set up Minikube on your Debian 12 system for a complete Kubernetes learning lab:
Prerequisites
-
System Requirements:
- 2 CPUs or more
- 2GB of free memory
- 20GB of free disk space
- Internet connection
-
Software Requirements:
- Docker
- Kubectl
- Minikube
Step 1: Install Docker
-
Update your package list:
sudo apt-get update -
Install required packages:
sudo apt-get install -y ca-certificates curl gnupg lsb-release -
Add Docker’s official GPG key:
sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg -
Set up the Docker repository:
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null -
Install Docker Engine:
sudo apt-get update sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin -
Start and enable Docker:
sudo systemctl start docker sudo systemctl enable docker -
Verify Docker installation:
sudo docker run hello-world
Step 2: Install Kubectl
-
Download the latest release:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" -
Make the kubectl binary executable:
chmod +x kubectl -
Move the binary to your PATH:
sudo mv kubectl /usr/local/bin/ -
Verify the installation:
kubectl version --client
Step 3: Install Minikube
-
Download the latest Minikube binary:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 -
Install Minikube:
sudo install minikube-linux-amd64 /usr/local/bin/minikube -
Verify the installation:
minikube version
Step 4: Start Minikube
-
Start Minikube with Docker driver:
minikube start --driver=docker -
Verify Minikube status:
minikube status
Step 5: Basic Minikube Commands
-
Check cluster info:
kubectl cluster-info -
Deploy a sample application:
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4 kubectl expose deployment hello-minikube --type=NodePort --port=8080 minikube service hello-minikube --url -
Access Minikube Dashboard:
minikube dashboard
Step 6: Stop and Delete Minikube
-
Stop Minikube:
minikube stop -
Delete Minikube:
minikube delete
Additional Resources
This setup will provide you with a complete learning lab for Kubernetes using Minikube on your Debian 12 system. Let me know if you need further assistance or have any questions!