Install Minikube on Mac
Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node.
Installation guide minikube
Prerequisites
- 2 CPUs or more
- 2GB of free memory
- 20GB of free disk space
- Internet connection
Minikube ← Theory Part
To install the latest minikube stable release on x86–64 macOS using Homebrew:
brew install minikube
If you check minikube installed or not
minikube version
If you run minikube start → Your kubernetes cluster will start
vm → single node Kubernetes Cluster
Create a cluster need to virtualization platform
Virtualization platform refers to the creation of a virtual machine that acts like a real computer with an operating system. If you run this cmd
Check out the drivers
minikube start --memory=4096 --driver=hyperkit
Starting the minikube before ensure if docker is running
minikube start
Kubernetes drive default used in docker driver
kubectl already connected to kubernetes cluster
kubectl get nodes
One node is running the name of minikube
Next, Installation of pods
Create a yaml file name of pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
Equivalent command for docker
docker run -d nginx:1.14.2 --name nginx -p 80:80
Create a pod
kubectl create -f pod.yml
Check the status of pod
kubectl get pods
Entire pod full details
kubectl get pods -o wide
Login to the container and execute the command
minikube ssh
curl 10.244.0.3
Pod logs check
kubectl logs nginx
The kubectl describe pods command provides detailed information about each of the pods that provide Kubernetes infrastructure.
kubectl describe pod nginx
Finally, delete the pod
kubectl delete pod nginx
Done…….