Project 3: Deploy web app using Jenkins master and worker node.
Table of contents
No headings in the article.
Here we will deploy a web app through Jenkins master to Jenkins worker node.
- Create EC2 instances as
· jenkins-server
· Jenkins-agent-1
- Generate SSH keys on “Jenkins-server” by running
“ssh-keygen”
- Now goto “.ssh” folder and there will be public and private key in Jenkins-server.
- Add public key from “Jenkins-server” to “Jenkins-agent-1” under location “.ssh/authorized_keys”
- Now, go to the Jenkins dashboard, and click on “Manage Jenkins”.
Now, click on “Manage Nodes and Clouds”
Now, click on “+ New Node”
- Add details of your second node, accordingly.
- Now click on “Ok”, and the node will be connected and online.
- Now, go to configurations in your task or project scheduled in Jenkins, and add the Label as same with the name of Node.
- Click on Save, and your project will be tied to Agent2.
- Now, build your project.
- Now, the web app will be up and running on “Jenkins-agent-1” and can be accessible via:
<ip of Jenkins agent:8001>