Skip to content

Rancher Setup

rajdeepc2792 edited this page May 4, 2022 · 1 revision

Installing Rancher

  1. Create an instance on Jetstream1, perform nslookup $IP on the instance and get domain name, in our case:- js-156-175.jetstream-cloud.org
  2. Setting up Rancher on the instance:-
  1. Setting up SSH:-
// On our local machine perform key setup
ssh-keygen
cat ~/.ssh/id_rsa.pub
// Copy the content of public key

// now on the remote machine where we want to setup rancher
vi ~/.ssh/authorized_keys
// paste the above fetched public key
// ready to perform ssh from local machine
  1. Configure Cloudmon
  • Use the Cloudman-boot provided by Isuru or download https://airavata.slack.com/files/U030JR7JXDF/F03CA28HZ6J/cloudman.zip
  • Modify sample.ini file present in inventory folder:-
[controllers]
js-156-175.jetstream-cloud.org

[agents]
js-156-175.jetstream-cloud.org

[rke_cluster:children]
controllers
agents

[all:vars]
ansible_ssh_port=22
ansible_user='rajchauh'
ansible_user_password='WATT EGO RARE GAIN LEEK JOIN HIND CITY IKE JAKE WE'
ansible_ssh_extra_args='-o StrictHostKeyChecking=no'
ansible_ssh_private_key_file=/Users/rajdeepchauhan/.ssh/id_rsa
  1. Create a venv and apply ansible playbook
python -m venv venv
source venv/bin/activate
pip install ansible
ansible-playbook -i inventory/sample.ini playbook.yml

Result:- image

  1. Additional steps to setting up rancher(on Jetstream Instance):-
helm repo add rancher https://releases.rancher.com/server-charts/stable
kubectl create namespace cattle-system
helm repo update
helm install -n cattle-system rancher rancher/rancher --set hostname=js-156-175.jetstream-cloud.org --set ingress.tls.source=letsEncrypt --set letsEncrypt.email="[email protected]" --set letsEncrypt.environment="production" --set letsEncrypt.ingress.class=nginx --version 2.5.5

The resultant will be:- Happy Containering

  1. Debugging known issue:-

Check all pods:-

kubectl get all -all-namespaces

Get nodeport of ingress-nginx:-

kubectl get services  -n ingress-nginx

Here we will not be able to get page successfully using URL:- https://{host}:nodeport

To resolve the error followed below steps:-

helm delete ingress-nginx -n ingress-nginx
// wait for pod to go down

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/cloud/deploy.yaml
// wait for it to come up

kubectl delete -n ingress-nginx -A ValidatingWebhookConfiguration ingress-nginx-admission

//Again get the nodeport of ingress-nginx
kubectl get services  -n ingress-nginx

Post this https://{hostname}:nodeport will be accessible, our rancher is active on:- https://js-156-175.jetstream-cloud.org:31646/

image

Clone this wiki locally