Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster with only one node. Minikube is available for Linux, macOS, and Windows systems.
The other ways to install Kubernetes are:
Kubeadm
Managed Kubernetes [EKS(AWS), AKS(Azure), and GKE(GCP)]
Others [using Terraform]
Minikube Features:
Minikube supports Kubernetes features such as:
DNS
NodePorts
ConfigMaps and Secrets
Dashboards
Container Runtime: Docker, containerd and CRI-O
Enabling CNI (Container Network Interface)
Ingress
Direct API endpoint for blazing fast image load and build
Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy
Supports common CI environments
Installing Minikube
We can install Minikube in our Local machine or we can install it on a cloud instance. Here, I'll install it on an AWS EC2 instance.
We need at least 2 vCPU and 4GiB Memory, so we'll take "t2.medium" instance type.
When your instance is up and running, we can start downloading the minikube on it.
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Now, Install Kubectl:
sudo snap install kubectl --classic
Install docker and add user to the docker group then reboot your instance.
Then, start the minikube by using the command minikube start
Let's try a few kubectl commands.
kubectl get pods
kubectl get nodes
kubectl get namespace
Great! your minikube cluster is up and runnnig.
Pod
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod models an application-specific "logical host": it contains one or more application containers which are relatively tightly coupled.
Let's create a pod
We can create a pod using a manifest file (pod.yml) and apply it using kubectl command.
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
kubectl apply -f pod.yml
kubectl get pods
Great! You've learnt how to setup a minikube cluster on your local or a cloud instance.
Thanks for reading.
Happy Learning!