August 31, 2016 · docker kubernetes Ubuntu

Installing Kubernetes on Ubuntu 14.04

I typically run my linux environment via VirtualBox on a Windows host for mainly corporate reasons. MiniKube is the new recommended way to get up and running with Kubernetes for local development, however this requires a host system capable of running a vm and at this time VirtualBox does not support 64bit nested VM's. With that in mind here are the steps I took to install kubernetes locally, mostly taken from this guide.

Install Docker

apt-get install apparmor lxc cgroup-lite  
wget -qO- | sh  
sudo usermod -aG docker YourUserNameHere  
sudo service docker restart  

Install OpenSSL

sudo apt-get install openssl  

Install etcd

curl -L -o etcd-v3.0.6-linux-amd64.tar.gz  
tar xzvf etcd-v3.0.6-linux-amd64.tar.gz && cd etcd-v3.0.6-linux-amd64  
sudo mv etcd /usr/local/bin  
etcd --version  

Original install instructions here

Install Go 1.6+

Remember to remove any previous version installed.

tar xzf go1.7.linux-amd64.tar.gz  
export GOPATH="/home/singram/personal"  
export GOROOT="/home/singram/go/"  
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

go get -u  

Full instructions can be found here

Install Kubernetes

mkdir -p $GOPATH/src  
cd $GOPATH/src  
git clone --depth=1  

Build and Run kubernetes


Beware, you will most likely be prompted for your root password towards the end of the build process. If you let this timeout, your system will have a number of processes running which are somewhat annoying to cleanup. If this happens, restarting the system proved the simplest method to reset and retry this step.

If successful you should have a running kubernetes system up and running.

Configure Kubectl

From the previous step you should see some output similar to the the commands below. Open up a new shell and execute the following to set up your ~/.kube/config

cluster/ config set-cluster local --server= --insecure-skip-tls-verify=true  
cluster/ config set-context local --cluster=local  
cluster/ config use-context local  

From this point on you have a working kubernetes system. You can either use the cluster/ or simply install kubectl separately as part of your system. The config file in your home directory is configured and the important part which is what both kubectl versions will key off.

Check out your kubernetes cluster nodes (there'll only be one)

kubectl get no  
kubectl describe no  

What about your pods

kubectl get pods  

And now you should have a fully working locally hosted kubernetes cluster of one. Superb!