0% found this document useful (0 votes)
22 views9 pages

Kubernetes Mini Kube Setup Ashok IT Cab17674 d337 4329 b3d4 F00bfde597e0

Uploaded by

x-factor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views9 pages

Kubernetes Mini Kube Setup Ashok IT Cab17674 d337 4329 b3d4 F00bfde597e0

Uploaded by

x-factor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

DevOps Mr.

Ashok

Kubernetes
(K8S)

Mini Kube
Cluster Setup
By Mr. Ashok
DevOps Mr. Ashok

Mini Kube
-> As the name suggests, minikube is a single node Kubernetes (k8s) cluster.
-> Anyone who is new to the Kubernetes and wants to learn and try deploying application
on it, then minikube is the solution.
-> Minikube provides a command line interface to manage Kubernetes (k8s) cluster and its
component.
Minikube System Requirements

• 2 GB RAM or more
• 2 CPU / vCPU or more
• 20 GB free hard disk space or more
• Docker / Virtual Machine Manager – KVM & VirtualBox
Note: We will be using Docker container as a base for minikube.
Step -1) Launch AWS EC2 Medium instance with Ubuntu AMI (Ubuntu Server 20.04)
Note: t2.medium instance we are using here
DevOps Mr. Ashok

Step – 2) Connect to Ubuntu VM using MobaXterm


DevOps Mr. Ashok

Note: once we connect to Ec2 instance, it will open terminal like above

Step – 3) 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
Step – 4 ) Install Docker by executing below commands
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo usermod -aG docker $USER && newgrp docker
Step – 5) Install Minikube dependencies
Install the following minikube dependencies by running below command
$ sudo apt install -y curl wget apt-transport-https
DevOps Mr. Ashok

Step - 6) Download Minikube Binary


Use the following wget command to download latest minikube binary
$ wget 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 by executing below commands
$ sudo cp minikube-linux-amd64 /usr/local/bin/minikube
$ sudo chmod +x /usr/local/bin/minikube
Verify the minikube version by executing below command
$ minikube version
DevOps Mr. Ashok

Step - 7) Install Kubectl utility


-> 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 by executing below commands
$ chmod +x kubectl
$ sudo mv kubectl /usr/local/bin/
Now verify the kubectl version
$ kubectl version -o yaml
DevOps Mr. Ashok

Step – 8 ) Start minikube


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

Perfect, above confirms that minikube cluster has been configured and started
successfully.
Run below minikube command to check status,

Run following kubectl command to verify the Kubernetes version, node status and cluster
info.
$ kubectl cluster-info
$ kubectl get nodes
DevOps Mr. Ashok

Step - 9) Verify Minikube Installation By Deploying Nginx Server


# Run below kubectl command to install nginx based deployment.
$ kubectl create deployment my-nginx --image=nginx
# Run following kubectl command to verify deployment status
$ kubectl get deployments.apps my-nginx
$ kubectl get pods

# Expose the deployment using following command


$ kubectl expose deployment my-nginx --name=my-nginx-svc --type=NodePort --port=80
$ kubectl get svc my-nginx-svc
DevOps Mr. Ashok

# Use below command to get your service url, after getting URL we can access that URL
using curl command like below

Note: If we are able to get above output, that means Nginx server deployed successfully in
Kubernetes.
Step - 10) Managing Minikube Cluster
$ minikube stop
$ minikube start

=== Learn Here.. Lead Anywhere ...!! ===

You might also like