Rancher deployment

Introduction

In order to mature the containers that are being deployed, a Kubernetes engine is more well suited. Rancher is one of these kubernetes engine’s; providing an interface to create pod deployments through an UI or by adjusting the YAML file attached to the pod. Furthermore it supports plugins from an open source marketplace, and I will be using a few to attribute towards the requirements of the application.

Implementation

When I first began annexing this assignment I found out I used the wrong command; I set up the demo/test version of Rancher; which was much more limited in its use. I began encountering issues when setting up ingress-pipelines & loadbalancers, and then found out that I ran the trial version: sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher but alas, the full installation requires much more configuration.

I chose a K3s cluster and followed

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

Here is the standard config (set up your own password and username if you are using this!)

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: [CERTIFICATE-DATA]
    server: [LOAD-BALANCER-DNS]:6443 # Edit this line
name: default
contexts:
- context:
    cluster: default
    user: default
name: default
current-context: default
kind: Config
preferences: {}
users:
- name: default
user:
    password: [PASSWORD]
    username: admin

And then checked the deployment using kubectl --kubeconfig ~/.kube/config/k3s.yaml get pods --all-namespaces & installing Helm after.

Which then enabled me to add the rancher repo: helm repo add rancher-stable https://releases.rancher.com/server-charts/stable and create a namespace for Rancher using kubectl create namespace cattle-system.

Finally installed rancher through 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