Rancher 2.x : First impressions

Sumanth Reddy
3 min readApr 19, 2019

--

Source: DuckDuckGo & Packet.com

Rancher is an open source container management platform. More about Rancher at https://rancher.com/

The newest release, Rancher 2.x helps us manage Kubernetes clusters easily and effectively. I decided to give it a spin and this blog is about my first impressions on the process. This isn’t a how-to tutorial nor helps you install anything. If you want that, you may need to head for https://rancher.com/docs/rke/latest/en/os/ and https://rancher.com/docs/rancher/v2.x/en/installation/

Spoiler alert: If you do not have patience to read the entire article, in short, the installation process for Kubernetes cluster with rke and deploying rancher server is dumb, no-brainer and pretty smooth. I really loved the simplicity and abstraction, kudos Rancher Labs.

So the first thing i did was to spin up 3 VM’s to use, one as master and two as workers. I wasn’t interested in full production HA setup, just few nodes to try out how it works.

Read on architecture at https://rancher.com/docs/rancher/v2.x/en/overview/architecture/#rancher . Then I went ahead and installed docker using the steps at https://rancher.com/docs/rke/latest/en/os/#software I have used Ubuntu 16.04 and Docker version 18.09.2

Now we are ready to install Kubernetes on our nodes. There are many ways to do this. We can either create cluster using any methods at https://kubernetes.io/docs/setup /or use rke to do so. Rancher also supports importing existing clusters. I downloaded the rke binary from https://rancher.com/docs/rke/latest/en/installation/#download-the-rke-binary It is just 35 MB, very small for the work it does :P

From what i understood from docs, rke requires two things to work. one cluster.yml which has various options about how to reach nodes and config for nodes, cluster. Second the access to nodes. I have created a minimal cluster.yml as below and had setup key based ssh access to nodes. Complete config options at https://rancher.com/docs/rke/latest/en/config-options/

Then i did rke up. This installed the control pane and etcd plane on master and worker plane on worker nodes. Then i hit a snag while worker plane is getting installed on worker nodes. The error is as below:

FATA[0204] [workerPlane] Failed to bring up Worker Plane: [Failed to verify healthcheck: Failed to check https://localhost:10250/healthz for service [kubelet] on host [XXXX.XXXX]: Get https://localhost:10250/healthz: Unable to access the service on localhost:10250. The service might be still starting up. Error: ssh: rejected: connect failed (Connection refused)

Tried reading up about the issue at https://github.com/rancher/rancher/issues/12657 wasn’t able to make out anything from the issue which was helpful for my environment. Then went ahead to post the question on Rancher slack. Community is one of the strongholds of Rancher. There are lot of Rancher folks and others, always ready to help with anything. David Noland from Rancher labs was quick in helping out with the issue and also suggested i join #rke channel on slack. It turned out to be some issue with my VM’s and had to reboot since the docker restart didn’t help. More about this at https://github.com/rancher/rancher/issues/12657#issuecomment-484636144

Tada, Using the KubeConfig generated by rke, i was able to use kubectl get nodes command and i have my master and workers ready :)

Then i went ahead and deployed Rancher server using instructions at https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/imported-clusters/

docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
-v /opt/rancher:/var/lib/rancher \
rancher/rancher:latest

My Rancher UI is ready, i just have to import my Kubernetes cluster now. This was pretty simple.

curl --insecure -sfL https://master.my-domain.com/v3/import/dfhzj74vmd4r7lgcwmslt962m6kbpb4x4jgfwzp4f22jjvbhfjehdt.yaml | kubectl apply --kubeconfig kube_config_cluster.yml -f -

My kubernetes cluster is now ready to be managed by Rancher, yaaay :)

Key Takeaways:

  1. The docs about Rancher 2.x and rke are pretty straight forward and simple to follow.
  2. When you hit a snag, ask for help. Can be on github or on slack. Rancher slack can be registered for, at https://slack.rancher.io/
  3. Lot of the issues while setup are due to the environment, like network firewall block or access issues etc. Read up on requirements.

Happy ranchering :)

--

--

No responses yet