Day 28 Task: Jenkins Agents |7 Deploy web app using Jenkins master and worker node.
Here we will deploy a web app through Jenkins master to the Jenkins worker node to make work easier and with better approach:
1. Create EC2 instances (AWS) as:
· jenkins-server
· Jenkins-agent-1 (worker node)
2. Generate SSH keys on “Jenkins-server” by running
“ssh-keygen” command
3. Now goto “.ssh” folder and there will be public and private key in Jenkins-server EC-2 machine.
4. Add public key from “Jenkins-server” to “Jenkins-agent-1” under location “.ssh/authorized_keys”
5. Now, go to the Jenkins dashboard, and click on “Manage Jenkins”.
6. Now, click on “Manage Nodes and Clouds”
7. Now, click on “+ New Node”
8. Add details of your second node, accordingly.
9. Now click on “Ok”, and the node will be connected and online.