Rancher-setup

Introduction

One of the larger requirements that this project needs to fulfil is the scalability of the back-end. The migration from monolith to microservice. More about this can be read in the pages referenced in my Scalability page. To allow such a framework change requires a platform in which containers can be run, containing these microservices. The Docker platform is one of those options that can provide this; however, it’s use-case is more meant for personal projects. Kubernetes is a more refined Docker, and something I learned is that the maturity of Kubernetes is much higher. It allows for more configuration, which leads me to the opinion that it is more ready for the enterprise production.

Theory

While it is possible to manage your own Kubernetes cluster all from a CLI-interface; for a beginner in this subject it is much more desirable to have a front-end that can translate my input into commands. One of these platforms that delivers this service is Rancher. In this environment, you can set up your own Kubernetes Cluster, but it will be managed by Rancher. Rancher is an open-source tool that has been bought by the SUSE-foundation.

“Organizations predict that the demand for Kubernetes skills will enjoy a growth rate of more than 67% over the next 10 years.”

https://en.wikipedia.org/wiki/Rancher_Labs

Implementation

Originally, when starting this project I had good success setting up Rancher; but only found out later that unfortunately I had installed the demo/test version. Then I went back to step one and configured it from scratch using Helm, Kubectl & various few other tools.

Since then, I also upgraded the specifications of the virtual machine that Rancher runs on.

As I’ve been dealing with issues in relation to horizontal pod scalers, this was a required change.

Then I spun this VM up and ran the following commands one-by-one, as mentioned in the Rancher documentation (that has to be pieced together from various pages, might I add)

curl -sfL https://get.k3s.io |  INSTALL_K3S_VERSION=vX.Y.Z sh -s - server
apt install kubectl
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config

Then check the deployment using kubectl --kubeconfig ~/.kube/config/k3s.yaml get pods --all-namespaces

And then installing Helm by executing this command:

helm install rancher rancher-stable/rancher \
--namespace cattle-system \
--set hostname=rancher.my.org \
--set replicas=3

After adding the rancher.my.org to my host file I could access the dashboard through my browser.

https://i.imgur.com/WsYluFN.png