sudo curl https://releases.rancher.com/install-docker/19.03.sh | sh
sudo usermod -aG docker $user
install Rancher in a docker container (single node) with persistent data. We’ll map 80 of the container to 8080 of the docker host and 443 of the container to 8443 of the external host, I’m doing this since I will be using the above ports for different containers.
docker run -d --restart=unless-stopped \
-p 8080:80 -p 8443:443 \
-v /opt/rancher:/var/lib/rancher \
check the status of the container:
docker ps -l
on a browser, open the IP address of the Docker host with the port specified previously. in my case it was https://192.168.3.101:8443/ , it should prompt you for a password similar to the below.
Once Done, You are prompted with the below page, click on “add a cluster” and then select “existing node”
Enter the cluster name and then hit next
In the node option, ensure that you select etcd, control plane and worker, copy the script from the below tab and run them on the Nodes that you want to spin up kubernetics.
In my senario since this is a lab setup, I will use the same docker host and 2 other nodes.
Once Setup, wait a while for the nodes to startup (you will see few warnings, do not panic. wait it out.)
once they are all up, it should look like the below:
Congratulations!!, you have now set up rancher and are ready to start deploying Kubernetes workloads!!