-
Notifications
You must be signed in to change notification settings - Fork 0
Setting Up Instances, Kubernetes Cluster, Jenkins
Kaustubh Bhalerao edited this page Mar 21, 2020
·
6 revisions
Instance 1: DevengersJenkins(Jenkins Master) Instance 2: (Kubernetes-Master) Instance 3: (Kubernetes-Worker1) Instance 4: (Kubernetes-Worker2)
All the 4 instances are created using following steps:
- Set the Allocation : TG-CCR180043
- Click on the Project -> Compute -> Instances -> Launch Instance
- [Details]Select Instance Name -> As per your choice, Description -(Instance Functionality Description), Availability Zone-(Check Any), Count (Check -> 1) -> click on Next
- [Source] Select Boot Source -> Image -> Select 'JS-API-Featured-Ubuntu18-Feb-14-2020' '8.00 GB' Image. Click on next
- [Flavor] Select m1.quad for Kubernetes(master and slave node) Else Select m1.medium for Jenkins.
- [Networks] Select Devengers_net, Click on next
- [Network Ports] Skip Click on next
- [Security Groups] Select Devengers_security_group, click on next
- [Key Pair] Select key as Devengers, Click on Launch Instance
- Once the Instance is created -> On the extreme right side you will see Actions tab, Under that select dropdown from "Create Snapshot" -> Associate a Floating IP. Select a Floating IP that's available. Note the floating IP for every instance as you will need this to ssh the instance.
- sudo apt-add-repository ppa:ansible/ansible
- sudo apt update
- sudo apt install ansible
- Then do, sudo vi /etc/ansible/hosts, paste the below content:
[servers]
<master_alias> ansible_host=<master_ip>
<slave1_alias> ansible_host=<slave_ip>
<slave2_alias>ansible_host=<slave_ip>
[servers:vars]
ansible_python_interpreter=/usr/bin/python3
Once the ansible is installed using above step, then proceed with Kubernetes Cluster installation guidelines:
- Clone the github -> Go to the folder :- cd kube-cluster (Citing: https://iu.instructure.com/courses/1857048/discussion_topics/9220186).
- Open the file named hosts(nano hosts) and enter your Kubernetes Master and Slave IP's.
- Open the initial.yml nano (initial.yml) make sure the key name is right and key has permission 400.(if
not use command "chmod 400 id_rsa"). You could get the key from the repo.
-> Run the command ansible-playbook -i hosts ~/kube-cluster/initial.yml - Don't change anything inside kube-dependencies.yml -> Run the ansible-playbook -i hosts kube-dependencies.yml
- Don't change anything inside master.yml -> Run the ansible-playbook -i hosts master.yml
- Don't change anything inside worker.yml -> Run the ansible-playbook -i hosts worker.yml
- Finally, Verify the cluster ssh ubuntu@Kubernetes_master_ip
- Get the status of the cluster -> kubectl get nodes