Search for a command to run...
Complete guide for installing Minikube for local Kubernetes development across different operating systems.
Minikube is a tool that makes it easy to run Kubernetes locally. It runs a single-node Kubernetes cluster inside a VM on your laptop.
# Install required packages
sudo apt update
sudo apt install -y curl wget apt-transport-https
# Download 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
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install kubectl /usr/local/bin/kubectl
# Start Minikube
minikube start
# Verify installation
minikube status
kubectl get nodes
# Start with default configuration
minikube start
# Start with specific Kubernetes version
minikube start --kubernetes-version=v1.24.0
# Start with more resources
minikube start --cpus=4 --memory=8192mb
# Start with specific driver
minikube start --driver=docker
# List available addons
minikube addons list
# Enable an addon
minikube addons enable dashboard
minikube addons enable ingress
# Access dashboard
minikube dashboard
# Point shell to minikube's Docker daemon
eval $(minikube docker-env)
# Build image using minikube's Docker
docker build -t my-app .
# Revert to host's Docker
eval $(minikube docker-env -u)
# Create named cluster
minikube start -p cluster2
# Switch between clusters
minikube profile cluster2
# List all clusters
minikube profile list
# Access service
minikube service my-service
# Get service URL
minikube service my-service --url
# Enable ingress
minikube addons enable ingress
# Create PersistentVolume
kubectl apply -f - <<EOF
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
hostPath:
path: /data/pv0001/
EOF
Resource Management
# Monitor resource usage
minikube dashboard
kubectl top nodes
kubectl top pods
Image Management
# Cache images
minikube cache add nginx:latest
minikube cache list
Backup Configuration
# Export cluster config
kubectl get all --all-namespaces -o yaml > cluster-backup.yaml