DevOps Project 3

In this blog, I will demonstrate, how to make a ci-cd pipeline using GitHub, Jenkins, Terraform, Helm, & Amazon EKS.

Suppose, you are a DevOps engineer or cloud ops engineer in your company, and your lead or manager asks you to create a ci-cd pipeline that can create an EKS cluster in AWS and after creating the cluster, pipeline should install some applications in it using Helm.

Follow the below steps:

Step1: Create a EC2 instance in AWS and install Jenkins. you will find the installation guide in the below link.

How to install Jenkins on Amazon Linux EC2 Machine

Step2: After installing Jenkins, you have to Install Git, Terraform, Helm & Kubelet.

Git Installation:

				
					sudo yum install git
				
			

Terraform Installation:

Terraform Installation on Amazon Linux 2 – EC2

Helm Installation:

Helm Installation on Amazon Linux 2 – EC2

Kubelet Installation:

kubelet Installation on Amazon Linux 2 -EC2

Step 3: Create an S3 bucket for storing your terraform state file.

Step 4: Replace the bucket name with the above one in the backend.tf file.

Step 5: Create a freestyle project in Jenkins, and configure it with git, shell script, and parameters. you will find the shell script in the below repo.

PARAMETERS:

    REGION : aws region

    VPC_ID : aws vpc id 

    CLUSTER_NAME : eks cluster name

    ACTION : terraform apply or destroy

https://github.com/shubhamm45/DevOps-Project/blob/main/DevOps_Project_3/Jenkins_Script.sh

Step 6: Create an IAM role and attach an admin policy to it. after creating, you have to attach the IAM role to the Jenkins server.

Step 7: We have set up everything for this project, and now we can run our Jenkins job. you can take the help of the below video for guidance.

 

Leave a Comment