Minikube – install and test- U16+miniK8s+VirtualBox5.2

One of the great Features about Kubernetes is that you can try it out locally on your computer at home.  The package name we use is a little difference and is really meant for local development purposes.

Here are the steps I used to installl Minikube on Ubuntu 16.04.

  1. Find, Download, and install
    • “virtualbox-5.2_5.2.4-119785~Ubuntu~xenial_amd64.deb”
  2. sudo apt-get update -y && sudo apt-get

  3. curl -Lo minikube && chmod +x minikube && sudo mv minikube /usr/local/bin/

  4. curl -Lo kubectl$(curl -s && chmod +x kubectl

Installation Done!!!


Now Lets do a little test.

Initialize Virtual Cluster:

minikube start –vm-driver=virtualbox

Preview cluster information:

kubectl cluster-info

Output:  Kubernetes master is running at https://x.x.x.x:xxxx

Start Kubernetes Dashboard:

minikube dashboard


Create Simple webpage:

Create the following folder and file structure
├── Dockerfile
├── html
│   └── index.html

Dockerfile contents:

FROM nginx
COPY html /usr/share/nginx/html

index.html contents:

    <title> Test Page Title... </title>
    <h1> Test page body </h1>


Eval Minikube Env:

eval $(minikube docker-env)


Build the container:

docker build -t testdoc:v1 .


WARN[0000] Unable to use system certificate pool: requires building with go 1.7 or later
Sending build context to Docker daemon 3.584 kB
Step 1/2 : FROM nginx
latest: Pulling from library/nginx
e7bb522d92ff: Pull complete
6edc05228666: Pull complete
cd866a17e81f: Pull complete
Digest: sha256:285b49d42c703fdf257d1e2422765c4ba9d3e37768d6ea83d7fe2043dad6e63d
Status: Downloaded newer image for nginx:latest
—> 3f8a4339aadd
Step 2/2 : COPY html /usr/share/nginx/html
—> 29320171ac73
Removing intermediate container cb79431be6d5
Successfully built 29320171ac73
Successfully tagged testdoc:v1

Run the container in Kubernetes (creates deployment):

kubectl run testdoc –image=testdoc:v1 –port=80


deployment “testdoc” created


Check deployments:

kubectl get deployments


testdoc 1 1 1 1 1m


Expose the deployment; exposure is backed by load balancer:

kubectl expose deployment testdoc –type=LoadBalancer


service “testdoc” exposed


Preview Services Running:

kubectl get services


kubernetes ClusterIP <none> 443/TCP 1h
testdoc LoadBalancer <pending> 80:32498/TCP 10s


Actually Open Service:

minikube service testdoc


Opening kubernetes service default/testdoc in default browser…

# browser window should pop up at this point showing a url like this and displaying the index.html contents that we set earlier.


Stopping Minikube VM:

minikube stop


Starting up the same VM again:

Remember that a good portion of the Minikube cluster is already created, so we only need the following:

minikube start –vm-driver=virtualbox

minikube dashboard

eval $(minikube docker-env)

kubectl get services

minikube service testdoc



FYI, Minikube is a lightweight version meant for local development and has features that can link your local environment to your production Kubernetes environment, allowing for local testing to be done, while leveraging production services, and then pushing those local builds to production.


Please leave questions or comments below.  Hope this helped.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s