Day 31 Task: Launching your First Kubernetes Cluster with Nginx running

DevOps Enthusiast || BCA Grad || MCA Pursuing | AWS, Docker, Kubernetes || Automation Specialist || Git & GitHub || Terraform || Seeking Entry-Level Opportunities.
This is#90DaysofDevopschallenge under the guidance of ShubhamLondhe sir.
- What is minikube?
Minikube is a tool which 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
(a) Supports the latest Kubernetes release (+6 previous minor versions)
(b) Cross-platform (Linux, macOS, Windows)
(c) Deploy as a VM, a container, or on bare-metal
(d) Multiple container runtimes (CRI-O, containerd, docker)
(e) Direct API endpoint for blazing fast image load and build
(f) Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy
(g) Addons for easily installed Kubernetes applications
(h) Supports common CI environments
Task-01:
Install minikube on your local
Here are the steps:
Launch an EC2 instance and select "t2.medium" as the instance type.
Once the instance is running, connect to it using SSH.

Update the package list using the command: "sudo apt-get update".

Install Docker using the command: "sudo apt-get installdocker.io".

That's it! Your EC2 instance should now have Docker installed and ready to use.
sudo usermod -aG docker $USER sudo systemctl start docker sudo systemctl enable dockercurl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64After running the CURL command you will see minikube folder

Download the Minikube binary using
curlMake it executable and move it into your path:chmod +x minikube sudo mv minikube /usr/local/bin/
To check the version of Minikube you have installed, just open your terminal or command prompt and type:
minikube version
To check if both the hypervisor and Minikube are installed correctly, you can run a command that starts a local Kubernetes cluster.
Now, let's install
kubectl, which is a command-line tool.curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
Make it executable and move it into your path
chmod +x kubectl sudo mv kubectl /usr/local/bin/
To activate Minikube and check its status, you can run the appropriate commands.
minikube start --driver=dockerIn the image below, we selected "docker" as the driver_name, which means you should install Docker on your computer first.

After the Minikube startup process completes, use the following command to verify the status of the cluster:
minikube status

If you've installed Minikube before, and you run:
minikube startand minikube start returned an error:
machine does not existthen you need to clear minikube local state:
minikube deleteFor log in to minikube use command:
minikube ssh
Let's understand the concept 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.
Task-02:
Create your first pod on Kubernetes through minikube.
Install kubectl using command
sudo snap install kubectl --classic
To create a pod we need to create a yaml file. Here we are going to create a pod of nginx.
apiVersion: v1 kind: Pod metadata: name: nginx-pod spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80

To create a pod using the
pod.yamlfile, use the following command:kubectl apply -f pod.yaml
To check list of pods:

We have successfully completed.
If you enjoyed reading and found it useful, please consider showing your support by following and giving a thumbs-up ๐.
Thank you for taking the time to read!๐




