Wed. Sep 23rd, 2020

TEC FLIP

Learning Technology Your Own Way

How to Install Single Node Minikube Kubernetes Cluster on Linux

3 min read
Step by Step guide to Install single node Kubernetes cluster using Minikube on AWS Linux EC2 server for development and testing purpose.

Here we are providing Step wise guide to deploy single node MiniKube Cluster on Amazon EC2 for learning and development purpose.

What is Minikube?

MinuKube is a lightweight K8S implementation that creates a VM on our local machine and deploy a simple cluster containing only one node.

Minimum Hardware Requirement for Minikube

  • 2 GB RAM
  • 2 vCPU
  • 20 GB Free Space.

Step-1

Launch EC2 instance with the below configuration

  • Instance Type: t2.medium ( 2 vCPU, 4 GB RAM)
  • Security Group: Open Port 22 from your Local System IP.
  • AMI: Amazon Linux, CentOS or RHEL (Latest Version Recommended)

Step-2

Login to the instance using your private key and create a new user. We need to do this as we can not start minikube if we are logged in as root user. We need other user with admin privileges.

useradd minikubeuser
Add User To Linux Machine for Minikube

Step-3

Install docker using below command

yum install docker
Install Docker

Verify the docker by executing below command

docker –version
Verify Docker Installation

Step-4

Add the user minikube_user to docker group.

usermod -aG docker minikube-user

Set the password for this user.

passwd

Step-5

Download and Install RPM package for minikube.

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
Download Minikube RPM Package
sudo rpm -ivh minikube-latest.x86_64.rpm

Step-6

Start minikube.

minikube can be deployed as a VM, a container, or bare-metal.
Below drivers are supported for linux

  • Docker – container-based (preferred)
  • KVM2 – VM-based (preferred)
  • VirtualBox – VM
  • None – bare-metal
  • Podman – container (experimental)

We will be deploying using the Docker. Switch to the non root user minikube-user before excuting below commands otherwise it will run into error.

minikube start --driver=docker
Start Minikube Using Docker Driver

To make docker the default driver:

minikube config set driver docker

Confirm and verify the minikube cluster status.

minikube status.
Minikube Status Verify

Step-6

Install kubectl

To install kubectl we first need to add Kubernetes.repo to yum repolist.

cd /etc/yum.repos.d
vi amzn2.extras.repo

Add below repository to the list.

[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
Add Repository for Kubectl Installation

Execute below command now to install kubectl.

minikube kubectl --get po -A
Install kubectl using Minikube
yum install kubectl
Install kuectl using yum

Verify kubectl installation.

Kubectl cluster-info
Kubectl get node
Verify kubectl Installation

You lab environment to play with Kubernetes is UP and running now . Enjoy.

7 thoughts on “How to Install Single Node Minikube Kubernetes Cluster on Linux

  1. Hi there, You have done an excellent job. I will certainly digg it and personally recommend
    to my friends. I am sure they will be benefited from this
    site.

  2. Hey! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly?
    My blog looks weird when browsing from my iphone. I’m trying to find a template
    or plugin that might be able to resolve this problem.
    If you have any recommendations, please share. Many thanks!

  3. Having read this I thought it was rather informative.

    I appreciate you spending some time and energy to put
    this article together. I once again find myself personally spending way too much
    time both reading and posting comments. But so what,
    it was still worthwhile!

Leave a Reply

Your email address will not be published. Required fields are marked *

Who Am I

Akshay Kumar Chauhan

My name is Akshay Chauhan and this is my personal blog or better my personal knowledge base where I am writing down my thoughts all around Linux, Windows, Cloud and Google Services. I am working for Infosys as AWS Cloud Engineer. I am always keen to learn new technologies and experiment with computer systems.

Copyright © tecflip.com | All rights reserved. | Newsphere by AF themes.
Copy link
Powered by Social Snap