Serverless Cost-Efficient CI/CD with Jenkins on AWS Fargate: Dynamic Agents and Persistent Storage...
Briefly

Serverless Cost-Efficient CI/CD with Jenkins on AWS Fargate: Dynamic Agents and Persistent Storage...
"In the Networking section, select the same VPC in which you have created EFS and select a Security Group (SG); select either the default or create a new one. Remember, in your SG, these ports must be allowed as an inbound rule. In the load balancing section: Type: Application load balancer Container: Jenkins 8080:8080 Select Create a new load balancer & give it a name: Jenkins-Alb Listener: In the target group: Select create new target group. Target group name: jenkins-tg Protocol: HTTP port: 8080 Deregistration delay: 300 health check protocol : HTTP health check path : /login Then click on create."
"Your service is ready, and within minutes, you will see the status as Active and the deployment as completed. It means our Jenkins master is live. To access, go to: Ec2 > Load balancing > Jenkins-ALB > Copy DNS name. You can even check the health status of the endpoint by going into the target group. It should be "healthy." Copy that DNS into a browser, and you will be able to see the Jenkins home page. For the first-time login, check the logs of the task to get the password."
"Now in Jenkins master, go to Manage jenkins > Plugins In Available plugins, search "ecs" & install the Amazon Elastic Container Service (ECS)/Fargate plugin. After installing the plugin, go back to ECS >> Task Definition. Step 5: Now we will create a task definition for our slave to launch dynamic agents to do our task. Go to ECS > Task Definition > click on "Create New Task Definition." Name: jenkins-agent Infrastructure requirements: Launch type: AWS fargate OS: Linux/x86_64 CPU: 1 Memory: 3 gb Task role: create one or"
Create an ECS service using the jenkins-master-task family and name it jenkins-master-service. Use Fargate as the compute option with the latest platform version. Select the VPC containing EFS and a security group that allows required inbound ports. Configure an Application Load Balancer named Jenkins-Alb, map container Jenkins 8080:8080, and create a target group jenkins-tg on HTTP port 8080 with a /login health check and 300s deregistration delay. After deployment becomes Active, obtain the ALB DNS to access Jenkins and retrieve the initial password from task logs. Install the Amazon ECS/Fargate plugin in Jenkins and create a jenkins-agent task definition (Fargate, Linux/x86_64, CPU 1, 3 GB memory) for dynamic agents.
Read at Medium
Unable to calculate read time
[
|
]