Introduction:
Welcome to the 31st blog of the "90 Days of DevOps" series! Today, we will dive into the minikube, features of minikube and installation and setup of minikube on local machine. Launching our First Kubernetes Cluster with Nginx running for DevOps Engineers.
What is minikube?
Minikube is a tool that quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows. It can deploy as a VM, a container, or on bare metal.
Minikube is a pared-down version of Kubernetes that gives you all the benefits of Kubernetes with a lot less effort.
This makes it an interesting option for users who are new to containers, and also for projects in the world of edge computing and the Internet of Things.
Features of minikube:
Supports the latest Kubernetes release (+6 previous minor versions)
Cross-platform (Linux, macOS, Windows)
Deploy as a VM, a container, or on bare-metal
Multiple container runtimes (CRI-O, containerd, docker)
Direct API endpoint for blazing-fast image load and build
Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy
Addons for easily installed Kubernetes applications
Supports common CI environments
Task-01:
Install minikube on your local
There are a few steps to setup Minikube on your local machine
-> First Go to AWS(Amazon Web Services) lunch a instance take the t2-medium because minikube takes more stores than it needs on 4GB RAM.
Now update your machine
sudo apt update
Install necessary essential packages including curl, wget, and apt-transport-https:
sudo apt install -y curl wget apt-transport-https
Install and start docker and configure it to launch on system startup:
# Install docker
sudo apt install docker.io
# add the current user to the "docker" group
sudo usermod -aG docker $USER
# Start & enable docker
sudo systemctl start docker
sudo systemctl enable docker
Download the Minikube binary using curl, make it executable, and add it to your system's PATH:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/
Download the kubectl binary using curl, make it executable, and add it to your system's PATH:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
Now start minikube
minikube start-driver-docker
check the minikube status is it installed or not and check the nodes
minikube status
kubect get nodes
Task-02:
Create your first pod on Kubernetes through minikube.
- Start Minikube (if not running):
minikube start
-> Create a Pod YAML Manifest:
vim first-pod.yml
Create a YAML file that describes your pod. In the K8s for every task create a manifest file
For example, you can create a simple pod named first-pod in the YAML file named first-pod.yml with the following content:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
That's it! We have created and accessed your first pod on Kubernetes.
Pods are the fundamental units in Kubernetes.
So I encourage you to try this on your own and let me know in the comment section about your learning experience
Thank you for reading!
Thank You! Stay Connected โ๏ธ๐ฉโ๐ป๐
Contact me at :
LinkedIn: linkedin.com/in/akash-singh-48689a176
E-mail: akashsingh6474@gmail.com