Minikube (Single Cluster of Kubernetes)

Minikube (Single Cluster of Kubernetes)
Written by Rakesh ShresthaMay 27, 2020
2 min read
DevOps
24 VIEWS 3 LIKES 1 DISLIKES SHARE
3 LIKES 1 DISLIKES 24 VIEWS SHARE
Rakesh Shrestha

DevOps

In this blog, we will see how to install Minikube (Single Cluster of Kubernetes) on Ubuntu Machine.

Minikube

Minikube is an open source tool that was developed to enable developers and system administrators to run a single cluster of Kubernetes on their local machine. Minikube starts a single node kubernetes cluster locally with small resource utilization. This is ideal for development tests.

Step 1: Update system:

sudo apt-get update

sudo apt-get install apt-transport-https

sudo apt-get upgrade

Step 2: Install Docker:

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable

apt-cache policy docker-ce

sudo apt-get install -y docker-ce

sudo systemctl status docker

docker run -d -p 5000:5000 --restart=always --name registry registry:2 #for local image

Step 3: Install Minikube:

sudo wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

sudo chmod +x minikube-linux-amd64

sudo mv minikube-linux-amd64 /usr/local/bin/Minikube

minikube version

Step 4: Install 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

sudo chmod +x ./kubectl

sudo mv ./kubectl /usr/local/bin/kubectl

kubectl version -o json

Step 5: Start Minikube:

echo ‘export CHANGE_MINIKUBE_NONE_USER=true’ >> ~/.bashrc

minikube start

eval $(minikube docker-env)

Step 6: Check Status Minikube and Kubectl:

minikube service list

minikube docker-env

kubectl cluster-info

kubectl config view

kubectl get nodes

Step 7: Deploy Pod:

kubectl create deployment test-nginx --image=nginx

Kubectl get pods

kubectl exec pod_name env

kubectl exec -it pod_name bash

kubectl scale deployment test-nginx --replicas=3

kubectl expose deployment test-nginx --type="NodePort" --port 80

kubectl get services test-nginx

minikube service test-nginx –url

Kubernetes
24 VIEWS 3 LIKES 1 DISLIKES SHARE
3 LIKES 1 DISLIKES 24 VIEWS SHARE
Was this blog helpful?
You must be Logged in to comment
Code Block
Rakesh Shrestha
DevOps
2 Blog Posts
0 Discussion Threads
Trending Categories
37
Software1
DevOps15
Frontend Development4
Backend Development2
Server Administration1
Linux Administration5
Data Center0
Sentry0
Terraform2
Ansible0
Docker3
Penetration Testing0
Kubernetes0
NGINX0
JenkinsX0
Jenkins2
SSL0
Ethical-Hacking1
Python0
NodeJs1
RedHat0
Github0
AngularJs0
Google Cloud Platform (GCP)0
SonarQube0
Amazon Web Service (AWS)0
VMware0
Blockchain0
Snipe-IT1
MongoDB0