This project demonstrates how to set up a High Availability (HA) Jenkins environment on AWS. The setup includes the use of an Auto Scaling group, EC2 instances, an Application Load Balancer, an EFS filesystem for Jenkins' data, and the necessary IAM roles and policies. The Jenkins controllers and agents are deployed in an Auto Scaling group, with the minimum, maximum, and desired instance counts set to 1.
- AWS EC2 Auto Scaling Group: Ensures Jenkins controllers and agents are highly available and scalable.
- Application Load Balancer: Distributes incoming traffic to the Jenkins instances.
- Amazon EFS: Provides a shared storage solution for Jenkins' data directory.
- IAM Policies and Roles: Secures access to the resources.
- Packer & Ansible: Used for creating a custom Jenkins Controller & Agent AMI's.
- Terraform: Provisioned AWS resources such as Auto Scaling group, EC2 instances, and EFS.
- Ansible: Automated the configuration of Jenkins on EC2 instances.
- Packer: Built custom AMIs for Jenkins Controller & Agent.
- Initialize Terraform root module for IAM and apply the configuration using the following commands:
terraform init
terraform plan
terraform apply --auto-approve
- Initialize Terraform root module for EFS and apply the configuration using the following commands:
terraform init
terraform plan
terraform apply --auto-approve
- Use Packer to create custom Jenkins agent AMIs.
packer build -var "efs_mount_point=<efs_mount_point_DNS>" jenkins-controller.pkr.hcl
packer build -var "public_key_path=<Dir Created in AWS Parameter Store>" jenkins-agent.pkr.hcl
- Use O/P Controller Custom AMI Created & Initialize Terraform root module for alb-asg for High Avaliablity Jenkins Controller and apply the configuration using the following commands:
terraform init
terraform plan
terraform apply --auto-approve
- Use O/P Agent Custom AMI Created & Initialize Terraform root module for EC2 for Jenkins agent and apply the configuration using the following commands:
terraform init
terraform plan
terraform apply --auto-approve