A Deep Dive into Minikube Version v1.32

A Deep Dive into Minikube Version v1.32

Let's demystify & walk through step by step the latest Minikube version installation in T2.medium instance .


Prerequisites:-

a> 2 GB RAM or more

b> 2 CPU / vCPU or more

c> 20 GB free hard disk space or more

d> Docker / Virtual Machine Manager – KVM & VirtualBox

e> Kubectl

Install Docker Dependencies

  • Login to your Ubuntu 22.04 system and run the following apt commands to install docker dependencies.

$ sudo apt update
$ sudo apt install ca-certificates curl gnupg -y        

  • Though the docker packages are available in default package repositories of Ubuntu 22.04 but it is recommended to use docker official repository. So to enable its repository first add Docker’s official GPG key, run.

$ 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        

  • Next, add the Docker repository to the system’s package sources

$ 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        

  • Now that the Docker repository is added, update the package index and install Docker.

$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y        

  • Once the docker package is installed, add your local user to docker group so that user can run docker commands without sudo

$ sudo usermod -aG docker $USER
$ newgrp docker        

  • Verify the Docker version

$ docker version        

  • Check docker service status, run below systemctl command.

$ sudo systemctl status docker        

  1. Now let's install Minikube with Kubectl utility .

  • Apply all updates of existing packages of your system by executing the following apt commands

$ sudo apt update -y
$ sudo apt upgrade -y        

  • Once all the updates are installed then reboot your system once.

$ sudo reboot        

  • Install the following minikube dependencies by running beneath command .

$ sudo apt install -y curl wget apt-transport-https        

  • Use the following curl command to download latest minikube binary.

$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64        

  • Once the binary is downloaded, copy it to the path /usr/local/bin and set the executable permissions on it.

$ sudo install minikube-linux-amd64 /usr/local/bin/minikube
        

  • Verify the minikube version.

$ minikube version
minikube version: v1.30.1
commit: 08896fd1dc362c097c925146c4a0d0dac715ace0
$        

  • Kubectl is a command line utility which is used to interact with Kubernetes cluster. It is used for managing deployments, service and pods etc. Use below curl command to download latest version of kubectl.

$ curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl        

  • Once kubectl is downloaded then set the executable permissions on kubectl binary and move it to the path /usr/local/bin.

$ chmod +x kubectl
$ sudo mv kubectl /usr/local/bin/        

  • Kubectl version details in yaml format

kubectl version -o yaml        

  • As we are already stated in the beginning that we would be using docker as base for minikue, so start the minikube with the docker driver, run

$ minikube start --driver=docker        

  • Run below minikube command to check status.

pkumar@linuxtechi:~$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
pkumar@linuxtechi:~$        

  • Run following kubectl command to verify the Kubernetes version, node status and cluster info.

$ kubectl cluster-info
$ kubectl get nodes
$ kubectl get pods -A
$ kubectl get pods -o wide (To display the pods in a descriptive long format)        

  • By default, only couple of addons are enabled during minikube installation such as the below one .

$ minikube addons enable ingress        

  • Next create a new pod and deploy accordingly

apiVersion: v1
kind: Pod
metadata:
  name: my-app
spec:
  containers:
  - name: my-app
    image: my-app:1.0 (eg: Any docker image from Docker hub)
    ports:
    - containerPort: 8080        

Or

apiVersion: v1
kind: Pod
metadata:
  name: my-nginx-pod
spec:
  containers:
    - name: nginx-container
      image: nginx:1.21.4
      ports:
        - containerPort: 80        
kubectl apply -f my-nginx-pod.yaml        

  • To access the above pod in a web browser make that as type NodePort .

kubectl expose deployment my-nginx --type=NodePort --port=8080        

  • After a moment, your deployment will show up when you run

kubectl get services my-nginx        

  • Now the application can be accessible at https://localhost:7080/

Priyanka kumari yadav

100k+ follower across all social media platforms |Youtube| AWS DevOps Engineer| Technical Writer | Freelancer |content creators | certified yoga instructor ??♀?|Helping Learning| Open for Collaboration??

1 年

Very useful information Soumyadip Chatterjee

回复
Chandra Reddy D

Cloud & DevOps Engineer | Kubernetes | AWS | Ansible | GIT | Terraform | Gitlab | Docker | Jenkins | Rancher |

1 年

thanks for this one

Swathi Punreddy

Senior Associate | Developer | AWS CCP Certified | Devops | Git | Jenkins | Docker | Kubernetes | Ansible | Terraform | Python

1 年

Thanks for sharing

要查看或添加评论,请登录

Soumyadip Chatterjee的更多文章

社区洞察

其他会员也浏览了