Skip to content

Deploying kubernetes cluster using rancher

Chanikya Reddy Vmmanagari edited this page May 6, 2022 · 2 revisions

Prerequisite rancher

To start with we need rancher setup our instance is available here https://jarvis.chanikya.dev:30039/ we have used the instructions from isuru and team terra documentation to setup rancher on jetstream2

Cluster

Now for cluster we need a master node/control plane and couple of slave nodes. These can be baremetal VM's but they need to have docker installed in them. We will be using ubuntu20.04 image with docker installed on jetstream

VM setup

  • Need to have docker installed
  • For ease of access to the VM's from local dev machine setup ssh public key authentication

Adding nodes to rancher

Here again we followed the guide from team terra on setting cluster on rancher. An important point to remember is that you need you master node up and its status to be active before you add any worker nodes, because if you add worker nodes before master node it will screw up the cluster because of some timing issues. But this is easy to fix just stop the docker container corresponding to rancher on worker node and delete nodes on rancher and start the process from start no need to build new VM's

kubectl setup

kubectl is used to perform all the operations on kubernetes cluster from cmd line, but it doesn't get packaged with rancher we need to install it manually on master/control node

After adding the package requirements for kubectl run the following to install the latest version of kubectl sudo apt-get install -y kubectl=1.22.4-00

Once we have kubectl we need a config file for it to interact with kubeadm, the config file can be downloaded from rancher