Skip to content

Project 4: Custos setup JS2

Vinayaka Gadag edited this page May 4, 2022 · 1 revision

Requirements

  • Create four VMs on jetstream2
  • One for rancher, and three for creating k8s cluster

Deploy Rancher

  • Download the code cloudman

  • Register rancher instance IP with domain (request AI/TA) - It will look like this, js2-xxx-xxx.jetstream-cloud.org

  • get the hostname by running nslookup <ip-address>

  • Update cloudman/cloudman-boot/inventory/sample.ini and replace controller and agents with the hostname

  • Update ansible_user='exouser', ansible_user_password='<pwd>', and ansible_ssh_private_key_file=<path to local machine id_rsa>

  • Update cloudman/cloudman-boot/playbook.yml, remove "rke" if present, under the section 'tags: ["controller", "agent", "rke"]'

  • Run the ansible playbook from your local machine, ansible-playbook -i inventory/sample.ini playbook.yml

  • * The above commands will setup the environment to deploy rancher. Now, install the rancher using helm chart

  • Login to jetstream2 VM using ssh, ssh <ip>

  • Add helm repo, helm repo add rancher https://releases.rancher.com/server-charts/stable

  • kubectl create namespace cattle-system

  • Update helm repos, helm repo update

  • Install rancher, helm install -n cattle-system rancher rancher/rancher --set hostname=HOSTNAME --set ingress.tls.source=letsEncrypt --set letsEncrypt.email="[email protected]" --set letsEncrypt.environment="production" --set letsEncrypt.ingress.class=nginx Step 2 : Bootstrap K8 Cluster on Bare Metals Servers With Rancher

  • Replace HOSTNAME with your hostname and email with your email

  • Check if all the services are up and running kubectl get all --all-namespaces

  • Follow the document from team terra if you get certificate error while accessing the rancher ui

  • Wait for few minutes to access the rancher from UI

  • Access the rancher UI using hostname:nodeport, nodeport starts from 3000 and above

    kubectl get svc -n ingress-nginx

    js2-xxx-xxx.jetstream-cloud.org:<nodeport>

  • User name is 'admin' and create password for the first login and follow the 'k8s setup' section to start with k8s cluster setup

Screen Shot 2022-04-30 at 2 35 44 PM Screen Shot 2022-04-30 at 2 35 36 PM

Add K8S cluster

  • Login to rancher and click on add cluster

  • Screen Shot 2022-04-30 at 2 45 17 PM
  • Select 'Create a new kubernetes cluster using existing nodes'

  • Screen Shot 2022-04-30 at 2 46 29 PM
  • Give a name to cluster and scroll down to bottom of the page and click on next

  • Add public ip under the cluster options and select node roles for the first VM and just worker role for the rest of the VM

  • Screen Shot 2022-04-30 at 2 49 34 PM
  • Copy the docker command and run in all the VMs and click on done

  • Wait for 5/10 mins and cluster will be in active state

  • Screen Shot 2022-04-30 at 2 52 54 PM