Minikube in Cloud

Ashish Bansal
3 min readJul 20, 2020

--

I have been trying to resolve the ‘Minikube’ installation issue in my Windows 10 Pro for few weeks and have invested enormous amount of time troubleshooting the ‘HyperV ‘and ‘Kubectl’ settings, even stalked multiple help forums but all in vain.

Issue details: Not able to create Network Switch (External) in HyperV and using Docker driver will set ~minikube ip as 127.0.0.1 (no browser access to your services in container). I tried Kubectl port forward but that didn’t worked either, then I checked the Github issue page of K8s and found out that both these are known open (#7344) issues.

So, I finally moved to AWS cloud setup and would like to share an easy guide with you on ‘how to install ‘Minikube’ on AWS EC2' (I am on Windows 10 Pro and same steps can be replicated for other CSPs).

Container on Cloud: Picture edited by Ashish Bansal, Original Source

Prerequisite: AWS Account, EC2, Putty Key Generator, Putty

AWS Setup:

  1. Login to Console > Select EC2 > Ubuntu Server 18.04 LTS (HVM) > t2.medium with 2 vCPU (Minimum requirement for Minikube), 4GB Memory and 100GB Storage (Default is 8GB).
  2. Select existing or create new Key and convert the PEM to PPK for accessing the EC2 instance via SSH from Putty.

(PEM to PPK can be done via Putty Key Generator, Open Putty Key Generator > File > Load Private Key > Save Private Key)

3. Open Putty and use the generated PPK key to access the EC2 Ubuntu instance, the default user is ‘Ubuntu’ and you are done. (You can change is as per your requirement).

Warning: You will be charged for this instance and it is not eligible for free usage, so please switch off the instance when not in use.

Minikube: A tool that makes it possible to run “Kubernetes” locally, so you can run single-node K8s cluster on a single machine for testing or learning purposes.

Minikube — AshishSecDev
Minikube

Minikube installation would also involve setting up Kubectl (a CLI utility to manage K8s cluster), and Docker for runtime containers.

Kubectl Binary Installation using CURL:

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

Change execution permission:

sudo chmod +x ./kubectl

Move the binary into your PATH: You can use && with the above command

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

~~Docker Installation:

sudo apt-get update && \sudo apt-get install docker.io -y

Install Minikube:

sudo curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && sudo chmod +x minikube && sudo mv minikube /usr/local/bin/

Minikube in installed and you may try ‘Minikube version’, but the most critical part here is to start it without any issues.

The Start command for Minikube is “sudo minikube start bla! bla!” but here it will give you an error, so in order to rectify this issue we will have to install “Conntrack” utility for Linux.

Conntrack: It is an essential connection tracking feature for Linux Kernel networking stack that allows Kernel to track all the logical network connections and flows.

Installation: sudo apt update && \ 
sudo apt install conntrack

All required installations are complete and now it is time to test our deployment.

Finally, we are going to start MiniKube:

sudo minikube start --vm-driver=none #Please use 'none'~minikube status

Hurray!

Minikube is finally running,so now you can start with the creation of your containers or services.

It is just a start of learning K8s and we have a long bumpy path ahead, so the best way to would be to keep practicing the concepts.

Please feel to reach out for any additions or changes to the article.

~Ashishsecdev

--

--

Ashish Bansal
Ashish Bansal

No responses yet