The k8s rabbithole - Installing Docker and Rancher (#2)

Now it's time to get Docker installed. There are plenty of ways to do this, but luckily Rancher provides a handy script that will install it in one line.

Install Docker...
wings@k8s-1:~$ curl | sh

Add our current user to the docker group
wings@k8s-1:~$ sudo usermod -aG docker $USER

Log out, log in, then...

wings@k8s-1:~$ docker ps

With Docker installed on our first node, we can get Rancher going.

We'll be using the Manual method since this is an "on-premises" Rancher installation.

Manual Quick Start

First steps, run the Rancher docker container:

wings@k8s-1:~$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher
[sudo] password for wings:
Unable to find image 'rancher/rancher:latest' locally
latest: Pulling from rancher/rancher
af637d9f9908: Downloading  19.89MB/45.71MB
f9224574abce: Downloading  15.41MB/31.13MB
ebae3352c76e: Download complete
7b21d0842057: Downloading  491.5kB/47.78MB
88a4b8d1c9ea: Waiting
068e40008a4a: Waiting
af8d478ed359: Waiting
0570bed5c15a: Waiting
f7dfd304c929: Waiting
e0f5d341d113: Waiting
bd89a58c597d: Waiting
c03c718eef46: Waiting
5e1f456cdbf8: Waiting
e55dca76e75f: Waiting
c9a821480bc3: Waiting
c6e3491b680d: Waiting
9d7c10a11f0f: Waiting

and go make a coffee while it runs...

After a while, we should be able to go to your host and log into your new Rancher server. This is Rancher v2.6 (latest as of this writing).

Follow the instructions...

wings@k8s-1:~$ docker ps -a
CONTAINER ID   IMAGE             COMMAND           CREATED         STATUS         PORTS                                                                      NAMES
2669a9faf756   rancher/rancher   ""   5 minutes ago   Up 4 minutes>80/tcp, :::80->80/tcp,>443/tcp, :::443->443/tcp   ecstatic_goldstine
wings@k8s-1:~$ docker logs  ecstatic_goldstine  2>&1 | grep "Bootstrap Password:"
2021/11/21 01:43:51 [INFO] Bootstrap Password: REDACTED

and log in, then set your password (redacted in this screenshot)

Hit Continue and you should be greeted with the main Rancher dashboard.

You have a basic K8s cluster called Local used to run the Rancher Server, dashboard and other initial workloads.