Minikube Installation (WSL Ubuntu)¶
This guide outlines the steps to install and configure Minikube on a Windows Subsystem for Linux (WSL) Ubuntu 20.04 LTS environment.^[400-devops-06-kubernetes-minikube-01-install.md]
Prerequisites¶
Before installing Minikube, it is recommended to update the system packages to their latest versions^[400-devops-06-kubernetes-minikube-01-install.md].
sudo apt update -y
sudo apt upgrade -y
curl, wget, and apt-transport-https are required^[400-devops-06-kubernetes-minikube-01-install.md].
sudo apt install -y curl wget apt-transport-https
Installation¶
The installation process involves downloading the latest Minikube binary and the kubectl command-line tool, then making them executable on your system^[400-devops-06-kubernetes-minikube-01-install.md].
1. Install Minikube¶
Download the Minikube binary, move it to your system path, and apply executable permissions^[400-devops-06-kubernetes-minikube-01-install.md].
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo cp minikube-linux-amd64 /usr/local/bin/[Minikube](<./minikube.md>)
sudo chmod +x /usr/local/bin/[Minikube](<./minikube.md>)
Verify the installation by checking the version^[400-devops-06-kubernetes-minikube-01-install.md].
[Minikube](<./minikube.md>) version
2. Install kubectl¶
Download the specific version of kubectl that matches the latest stable Kubernetes release and install it^[400-devops-06-kubernetes-minikube-01-install.md].
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x [kubectl](<./kubectl.md>)
sudo mv [kubectl](<./kubectl.md>) /usr/local/bin/
You can verify the client version with the following command^[400-devops-06-kubernetes-minikube-01-install.md].
[kubectl](<./kubectl.md>) version -o yaml
Starting the Cluster¶
To start the cluster, you can use the minikube start command. While --driver=docker is an option, the Docker driver may be automatically selected if other drivers are not available^[400-devops-06-kubernetes-minikube-01-install.md].
[Minikube](<./minikube.md>) start --driver=docker
Recommended Start Flags¶
The following command provides a robust configuration for development, allocating specific resources and enabling necessary add-ons like the Ingress Controller and Flannel CNI^[400-devops-06-kubernetes-minikube-01-install.md].
[Minikube](<./minikube.md>) start --addons=ingress --cpus=2 --cni=flannel --install-addons=true --kubernetes-version=stable --memory=6g
- --addons=ingress: Enables the Ingress Controller for routing external traffic.
- --cpus=2: Allocates 2 CPUs.
- --cni=flannel: Sets the Container Network Interface to Flannel.
- --memory=6g: Allocates 6GB of RAM. Note: Ensure your cgroup configuration allows memory limits; otherwise, this may trigger a warning.
Verification¶
Once the cluster has started, you can verify its status and components^[400-devops-06-kubernetes-minikube-01-install.md].
Check the general Minikube status:
[Minikube](<./minikube.md>) status
Check cluster information:
[kubectl](<./kubectl.md>) cluster-info
List the available nodes:
[kubectl](<./kubectl.md>) get nodes
Managing Addons¶
Minikube includes various add-ons that can be enabled or disabled. You can view the current status of all available add-ons using the list command^[400-devops-06-kubernetes-minikube-01-install.md].
[Minikube](<./minikube.md>) addons list
storage-provisioner, default-storageclass, and ingress (if specified during start) are typically enabled^[400-devops-06-kubernetes-minikube-01-install.md].
Sources¶
^[400-devops-06-kubernetes-minikube-01-install.md]