The Rancher 2 cluster manager is available as a Docker container. Jack Wallen shows you how easy it is to deploy and use on Ubuntu Server 18.04.
Rancher is an open source software tool for deploying Kubernetes as a service. With Rancher, you can run Kubernetes anywhere, manage clusters, centralize policy and workload management, and enjoy a platform with zero vendor lock-in. Best of all, Rancher can be installed on off-the-rack hardware, running the Linux operating system.
I'm will walk you through the process of installing Rancher 2 on the Ubuntu Server 18.04 platform.
SEE: Quick glossary: Cloud platform services (Tech Pro Research)
What you need
I'll demonstrate with two nodes (adjust hostnames and IP addresses as needed):
- RANCHER at IP Address 192.168.1.190
RANCHER2 at IP Address 192.168.1.191
Both of these machines will be running a fully updated Ubuntu Server 18.04.
The first thing that must be done is to install the Docker dependency on both nodes. We want to install the latest version of Docker (not the version found in the standard repository). To do this, open a terminal window and issue the commands:
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get -y install docker-ce
Add user to Docker group
To avoid running Docker withsudo (which could lead to security issues), you need to add a user to the Docker group. From the terminal, issue the command:
sudo usermod -a -G docker $USER
In order for the change to take effect, you must log out and log back into your Linux server.
Deploy the Rancher container
This will be done on the primary node (RANCHER at 192.168.1.190). From the terminal, launch the container with the command:
sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/rancher
Open a browser and point it to https://SERVER_IP (where SERVER_IP is the IP Address of your hosting server). You will be greeted by the Rancher login window (Figure A).
Here, you will be required to create a new (strong) password for the Rancher 2 user admin.
In the next window (Figure B), you must set the URL (or IP Address) of your Rancher 2 server.
Creating your first cluster
Typically, you need a minimum of three machines to create a cluster. I will demonstrate using only two (the primary node and a secondary node). After setting the URL, you'll be presented with a button clearly marked Add Cluster. Click that and then navigate to Clusters | Add Cluster. In the section marked From My Existing Nodes, click Custom (Figure C).
Give the cluster a name and click Next. In the resulting screen (Figure D), make sure to check etcd, Control Plan, and Worker.
Copy the command from the command window and paste it into your secondary node. If you set up a third node, copy the command there as well. This command will take some time to complete, but when it does, you'll have a new node join your cluster. You should see the new node listed as registered in the Rancher window (Figure E).
Click the Done button in the Rancher window, and your cluster is ready to rock, Rancher 2 style.
- How to fix the Docker and UFW security flaw (TechRepublic)
- How to install a Kubernetes cluster on CentOS 7 (TechRepublic)
- How to monitor your Docker containers with ctop (TechRepublic)
- How to get quick stats on your Docker containers (TechRepublic)
- Docker now helps you manage containers across clouds (ZDNet)
- Docker Enterprise Edition 2.0 makes it easier to use Kubernetes (ZDNet)