Skip to content

aliyasser98/Jenkins-HA-Setup-on-AWS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins-HA-Setup-on-AWS

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.

Architecture Design

Alt text

Architecture Overview

  • 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.

Key Technologies

  • 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.

Steps to Deploy

  1. Initialize Terraform root module for IAM and apply the configuration using the following commands:
terraform init
terraform plan
terraform apply --auto-approve
  1. Initialize Terraform root module for EFS and apply the configuration using the following commands:
terraform init
terraform plan
terraform apply --auto-approve
  1. 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
  1. 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
  1. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published