Add tech_docs/minikube_setup_debian.md

This commit is contained in:
2024-06-25 06:08:14 +00:00
parent fed0cfcd8c
commit 9961262b61

View File

@@ -0,0 +1,166 @@
Here's a step-by-step guide to set up Minikube on your Debian 12 system for a complete Kubernetes learning lab:
### Prerequisites
1. **System Requirements**:
- 2 CPUs or more
- 2GB of free memory
- 20GB of free disk space
- Internet connection
2. **Software Requirements**:
- Docker
- Kubectl
- Minikube
### Step 1: Install Docker
1. **Update your package list:**
```sh
sudo apt-get update
```
2. **Install required packages:**
```sh
sudo apt-get install -y ca-certificates curl gnupg lsb-release
```
3. **Add Dockers official GPG key:**
```sh
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
```
4. **Set up the Docker repository:**
```sh
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
```
5. **Install Docker Engine:**
```sh
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
```
6. **Start and enable Docker:**
```sh
sudo systemctl start docker
sudo systemctl enable docker
```
7. **Verify Docker installation:**
```sh
sudo docker run hello-world
```
### Step 2: Install Kubectl
1. **Download the latest release:**
```sh
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
```
2. **Make the kubectl binary executable:**
```sh
chmod +x kubectl
```
3. **Move the binary to your PATH:**
```sh
sudo mv kubectl /usr/local/bin/
```
4. **Verify the installation:**
```sh
kubectl version --client
```
### Step 3: Install Minikube
1. **Download the latest Minikube binary:**
```sh
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
```
2. **Install Minikube:**
```sh
sudo install minikube-linux-amd64 /usr/local/bin/minikube
```
3. **Verify the installation:**
```sh
minikube version
```
### Step 4: Start Minikube
1. **Start Minikube with Docker driver:**
```sh
minikube start --driver=docker
```
2. **Verify Minikube status:**
```sh
minikube status
```
### Step 5: Basic Minikube Commands
- **Check cluster info:**
```sh
kubectl cluster-info
```
- **Deploy a sample application:**
```sh
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:**
```sh
minikube dashboard
```
### Step 6: Stop and Delete Minikube
- **Stop Minikube:**
```sh
minikube stop
```
- **Delete Minikube:**
```sh
minikube delete
```
### Additional Resources
- [Kubernetes Documentation](https://kubernetes.io/docs/home/)
- [Minikube Documentation](https://minikube.sigs.k8s.io/docs/)
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!