MiniKube used to Run the Kubernetes Locally.
Minikube is a single-node Kubernetes cluster that you can use locally in your own development machine to test your Kubernetes deployment scripts, explore and study Kubernetes etc.
MiniKube is used for Development Purposes.
Minikube can’t be used in Production, as It’s One Node Machine.
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
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
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x ./minikube
sudo mv ./minikube /usr/local/bin/minikube
sudo apt-get install conntrack // this is dependecy for minicube
minikube start --vm-driver=none //
Let’s create a Kubernetes Deployment using an existing image named
nginx, which is a simple HTTP server and expose it on port 80
using --port.
sudo kubectl create deployment nginx --image=nginx
Create the Service
sudo kubectl create service nodeport nginx --tcp=80:80
kubectl get svc
kubectl patch svc nginx -p '{"spec":{"externalIPs":["ipaddress"]}}'
kubectl get pods -A
kubectl get deployment
kubectl delete services nginx
kubectl delete deployment nginx
Stop the local Minikube cluster:
minikube stop