Home 3 simple steps to install minikube on Azure VM
Post
Cancel

3 simple steps to install minikube on Azure VM

Step 0 - why

If you want to play with K8S MiniKube is the best option. Still, you don’t believe that K8S will survive the next few years? And you don’t want to install “new crap” on your PC? Using VM in a cloud is a good option :)

Step 1 - setup machine

First of all, we need a shiny machine with nested virtualization. Not all of them will be able to handle nested virtualization. As I remember you need a machine with v3 suffix, for example, Standard D2s v3 will do the job. To be sure that nested virtualization is available, run:

1
lscpu | grep -i virtual

You should see something like:

1
2
Virtualization:      VT-x
Virtualization type: full

If the output is empty, choose another one. The operating system I suggest Ubuntu. And after install run:

1
sudo apt-get update

just to make your machine updated to latest patches.

Step 2 - install Virtualbox

For the MiniKube we need a hypervisor to run Kubernetess. The easiest way is to install VirtualBox. First, we need to add repository key:

1
2
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.as
c -O- | sudo apt-key add -

Then install it with:

1
sudo apt install virtualbox

Step 3 - install MiniKube

To check latest version go to: https://github.com/kubernetes/minikube/releases

Then run (replace v.0.30.0 with the latest version):

1
2
3
4
curl -Lo minikube https://storage.googleapis.com/minikube/relea
ses/v0.30.0/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/

Now you are ready to run MiniKube:

1
sudo minikube start --vm-driver=virtualbox

This will take a while. Moreover, the above command suggests installing kubectl, which is the main tool for managing K8S. So do as it suggests with the command (copy it from output):

1
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo cp kubectl /usr/local/bin/ && rm kubectl

There is also a “full” instruction on official site, but above command is good enough.

To check if everything is fine:

1
2
3
sudo kubectl run hello-world --image=k8s.gcr.io/echoserver:1
.4 --port=8080
sudo kubectl expose deployment hello-world --type=NodePort

Now wait a bit (30 seconds) and run:

1
curl $(sudo minikube service hello-world --url)

You should see “echo” server page, if not repeat after a while.

The end

Now you can play safety with MiniKube. Have fun!

unsplash-logoPhoto by Maximilian Weisbecker

This post is licensed under CC BY 4.0 by the author.