How to deploy kubernetes using minikube
How to Deploy Kubernetes Using Minikube on Linux
Minikube is the easiest way to run Kubernetes locally on your Linux machine. It creates a single-node cluster perfect for learning and development.
Prerequisites
- Linux machine with 2GB RAM and 2 CPUs
- Docker or VirtualBox installed
- Terminal access
Step 1: Install Minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Step 2: Start Minikube
# Start with Docker driver (recommended)
minikube start --driver=docker
# Or with more resources
minikube start --driver=docker --memory=4096 --cpus=2
Step 3: Deploy Your First App
# Create nginx deployment
kubectl create deployment hello-nginx --image=nginx
# Expose as service
kubectl expose deployment hello-nginx --type=NodePort --port=80
# Get service URL
minikube service hello-nginx --url
Step 4: Access Kubernetes Dashboard
minikube dashboard
This opens the Kubernetes web UI in your browser
step 5: Essential Commands
# View deployments and pods
kubectl get deployments
kubectl get pods
# Scale your app
kubectl scale deployment hello-nginx --replicas=3
# Stop Minikube
minikube stop
# Delete cluster
minikube delete
# View Minikube status
minikube status
Conclusion
You now have Kubernetes running locally! Use Minikube to experiment with deployments, services, and other Kubernetes features. It's perfect for learning before moving to production clusters.
Pro tip: Always run minikube stop
when done to save system resources.
Comments
Post a Comment