Skip to content

Assignment 4 Installing Rancher

Krishna Vamsi Guntupalli edited this page May 6, 2022 · 3 revisions

Setting up Rancher

Create an instance and login in to the instance where a public domain has been assigned.

SSH:

Public key (of the local machine) should be copied and pasted into the remote machine.

To find the public key of your machine type in the below command
cat ~/.ssh/id_rsa.pub
Paste the content to the authorized keys file on your remote. (Run this on your remote machine)
vi ~/.ssh/authorized_keys
<paste the public key>

Cloudmon Configuration

https://airavata.slack.com/files/U030JR7JXDF/F03CA28HZ6J/cloudman.zip

The modified cloudmon code available in the cloudman compressed file (provided by Isuru) should be downloaded and extracted.

sample.ini available in the Inventory/sample.ini should be modified

  • Agent should be updated to your domain name.
  • Controllers should be updated to your domain name.
  • If the instance is created from the Exosphere, ansible user should be updated to exouser.
  • The ansible password should be updated to the passphrase.
  • The last line should be uncommented.
  • Edit the path to your public key.

After updating all the above details, we will be getting the below file:

[controllers]
js2-165-154.jetstream-cloud.org

[agents]
js2-165-154.jetstream-cloud.org

[rke_cluster:children]
controllers
agents

[all:vars]
ansible_ssh_port=22
ansible_user='exouser'
ansible_user_password='TATE DIME MOW DUAL TO MALL FAKE MAIL BIG OR WISE'
ansible_ssh_extra_args='-o StrictHostKeyChecking=no'
ansible_ssh_private_key_file=/Users/krgunt/.ssh/id_rsa

The terminal in the cloudmon folder should be updated. After updating it, create a virtual environment and activate it.

python -m venv cust-dev
source cust-dev/bin/activate
pip install ansible
ansible-playbook -i inventory/sample.ini  playbook.yml  

With this, Rancher, Helm, Kubernetes secrets, certificate setup, Cloudmon will be setup.

Rancher Setup

Now, login to the Jetstream VM.

helm repo add rancher https://releases.rancher.com/server-charts/stable
kubectl create namespace cattle-system
helm repo update

After the running the below command, it takes some time for the cluster to be started

helm install -n cattle-system rancher rancher/rancher --set hostname=js2-165-154.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
kubectl get all --all-namespaces

The above command can be used to check if everything is setup.

inginx-ngress-controller with a type Load balancer can be observed after running the below command.

kubectl get services  -n ingress-nginx

Then there is high chance that an issue might occur, which a certificate error while trying to access the URL. Run the following commands to resolve the issue.

helm delete ingress-nginx -n ingress-nginx
kubectl get all -n ingress-nginx
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/cloud/deploy.yaml
kubectl get all -n ingress-nginx

try to find the node port, which might have been changed because of the reinstallation of nginx-ingress service (which is done by running the above commands).

Then we setup Kubernetes cluster using rancher by following the steps neatly documented by team Terra. Click Here for the documentation.