Hey Folks 🖐️, This repository contains a DevOps project that leverages various technologies, including Terraform, Ansible, Docker, eksctl, EKS cluster, Helm, jenkins, and kubectl to automate the deployment and management of an application on Amazon EKS.
This DevOps project aims to automate the provisioning, deployment, and management of applications on an Amazon EKS cluster using Terraform for infrastructure provisioning, Ansible for configuration management, Docker for containerization, eksctl for EKS cluster creation, kubectl for Kubernetes cluster management, Helm for package management, and Jenkins for continuous integration and continuous deployment (CI/CD).
In this project, Terraform is used to provision infrastructure, including 3 EC2 instances:
- bootstrap-server: Used to install kubectl and eksctl, and build the EKS cluster.
- ansible-server: Utilized for necessary configuration on the target hosts.
- jenkins-agent: Employed to run Jenkins build jobs.
Helm is utilized to package Jenkins and the application, and the Helm charts are uploaded to an S3 bucket using Terraform.
- Terraform (IaC)
- Ansible (Configuration Management)
- Docker (Containerization Application)
- Kubernetes (Containers Orchestration)
- Helm (Package Manager)
- Jenkins (CI/CD)
- Terraform must to be installed
-
Download or clone the repository to your local machine.
-
Install Terraform your local machine if you haven't already done so.
-
Make the necessary changes in the provider.tf file, specifically the project name and region, to match your own project settings
-
Navigate to the Terraform directory and initialize it by running the command
terraform init
-
Run the command
terraform validate
to validate your terraform code , thenterraform plan
to review the infrastructure changes that terraform will apply. -
After reviewing the changes, run the command
terraform apply
to apply the changes to your infrastructure
Note: this guide assumes that you have a basic understanding of Docker, Terraform, and AWS Platform.
- To ssh into the vm-instance run this command
ssh -o StrictHostKeyChecking=no -i bootstrap-key.pem ec2-user@<ec2-instance-ip>
- Note: You Will find that the kubectl already installed using script created by eksctl. no need to install it manually
- Note: You Will find that the ingress controller already installed using script created by helm. no need to install it manually
-
Install Helm Charts for jenkins and application using shell script run
./install-charts.sh
-
After installation the helm charts for jenkins and application
- Run this command to get the loadbalancer-ip for application:
kubectl get ingress/<release-name> -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' -n <release-namespace>
- Run this command to get the loadbalancer-ip for application:
kubectl get ingress/<release-name> -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' -n default