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

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

  1. What is minikube?

Ans:- 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.

  1. 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

Lets begin with pods:

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-01:

Install minikube on your local

for installation please visit:https://minikube.sigs.k8s.io/docs/start/

Visit this webiste and select respetive os.

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

minikube start

So when you give above command it will throw below error as it needs driver to run i.e.docker so need to install docker

Visit this site:https://docs.docker.com/engine/install/ubuntu/

  1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:

     $ sudo apt-get update
    
     $ sudo apt-get install \
         ca-certificates \
         curl \
         gnupg
    
  2. Add Docker’s official GPG key:

     $ sudo install -m 0755 -d /etc/apt/keyrings
     $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
     $ sudo chmod a+r /etc/apt/keyrings/docker.gpg
    
  3. Use the following command to set up the repository:

     $ echo \
       "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
       "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
       sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    

Install Docker Engine

  1. Update the apt package index:

     $ sudo apt-get update
    
  2. Install Docker Engine, containerd, and Docker Compose.

    • Latest

    • Specific version

To install the latest version, run:

  1.                docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    

    sudo snap install kubectl

    sudo snap install kubectl --classic

    kubectl get po -A

    minikube status

    kubectl get node

    Here is MINIKUBE:

Task-02:

Create your first pod on Kubernetes through minikube.

  1. NGINX pod creation on Minikube:

Create pod.yml for NGINX

Note:

# After creating this file , run below command:

# kubectl apply -f <yaml file name>

Troubleshootings/errors:

if minikube start --driver=docker command is not working issue minikube start --force

If this error occurs exit and login back with root user sudo -i

Minikube installations/Github:https://github.com/gsbarure/kubeadm.git

Linkdin:https://www.linkedin.com/in/gajanan-barure-7351a4140

***Happy Learning :)***✌✌

Keep learning,Keep growing🎇🎇

Thank you for reading!! Hope you find this helpful.

#day31#90daysofdevops#devopscommunity#

Shubham Londhe