Kubernetes Container Orchestration using Rancher under 2 minutes.

Rancher is an enterprise grade container orchestration platform built on top of Kubernetes. While Kubernetes is itself a solution that requires hours of effort to understand, learn and equip for a production deployment, Rancher takes care of all that and gets itself up and running under 2 minutes. However, you’d need a bit more time and resource if you’d like to take it production ready.

This document walks you through a single-node installation of Rancher which is quite sufficient for a personal development environment, or even for a sandbox. I’ve even taken it for production though I wouldn’t recommend it for high scale or high volume deployments.

Prerequisite

Rancher requires Docker installed. If you haven’t done the same, you can read through my article Installing Docker CE in Ubuntu 18.04 LTS under 2 minutes for a quick start.

You can also read through the installation requirements (tl; dr) and also the supported versions of docker and other components.

Getting Rancher up and running

Rancher starts with just a single docker command. You have multiple ways of getting the SSL certificate installed, but for our general case, we can either go with the self signed cert generated by Rancher, or if your deployment is on a public domain, you can have it setup with lets encrypt.

Simple install with self signed certificate

$ sudo docker run -d --restart=unless-stopped \
	-p 18080:80 -p 18443:443 \
	rancher/rancher:latest

Rancher stores all its config in etcd, and this installation runs on one such etcd node. For a production deployment, have it deployed on a kubernetes cluster.

Once installed, you can visit https://localhost:18443/ to see your Rancher Server web dashboard. You will most certainly be greeted by a security warning since your Rancher Server’s self signed certificate isn’t trusted. You can hit the Advanced button and proceed further by Accepting the Risk or by adding an exception.

You’d be asked to set an admin password for the first time as shown below. Remember to set some strong password.

Rancher welcome screen to set admin password.

Proceed further to set your Rancher Server URL. Rancher will almost always auto-detect this correctly; change only if required or if you are behind a NAT Firewall.

That’s it. You are all done. Save the URL and proceed to the Rancher Dashboard, which would help you manage your Kubernetes cluster and pods from an easy to use web based dashboard.

In my next blog, I’d walk you through setting up your first node and deploying a hello-world container onto it.

Adios!

Installing Docker CE in Ubuntu 18.04 LTS under 2 minutes

Docker allows you to achieve container virtualization, isolating the application scope from the underlying operating system. You can use the following instructions to install Docker Community Edition (CE) in Ubuntu 18.04 under 2 minutes.

Remove any previous installation of docker from your system.

$ sudo apt-get remove docker docker-engine docker.io containerd runc

Update and install prerequisites, and setup the docker repository.

$ sudo apt-get update

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

$ sudo apt-key fingerprint 0EBFCD88

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Install the docker engine.

$ sudo apt-get update

$ sudo apt-get install docker-ce docker-ce-cli containerd.io

Check if the docker engine is running.

$ sudo systemctl status docker

And you are done!

Checkout the following terminal recording if you’d like to see me doing it.

https://asciinema.org/a/291368