Skip to content

Final project combining all subjects learned throughout the course

Notifications You must be signed in to change notification settings

adanvmartinez/sre-final-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adan Martinez sre-final-project

Final project combining all subjects learned throughout the course

DevOps Lifecycle with AWS

In this project, you’ll be creating the infra using terraform and will perform application/tool stack configuration using shell scripts and will effectively use Jenkins for running automated CICD for both the application and infra deployment.

Provisioning a managed EKS cluster and setting up a mutable environment setup which ensures the HA and Resilience of the application.

Post-Mortem SRE Scoped Project: Install and configure the monitoring tool stack (Splunk and Dynatrace) to monitor the Application and Infra which is very essential for every production software system.

Goals:

  • Create infrastructure using terraform [ managed EKS cluster ]

  • Use Jenkins to run automated CICD for the application

  • Set up Dynatrace and Splunk to monitor the application

  • Make it all highly portable

Setting up EC2 Instance for Jenkins

Create an EC2 for the CICD

Add the inbound rules TCP 80 for the EC2 security group

Install NGINX and reverse proxy forward traffic from port 80 to localhost port 8080

Settting up Jenkins on the EC2

$ sudo curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \ /usr/share/keyrings/jenkins-keyring.asc > /dev null
$ sudo echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
 /etc/apt/sources.list.d/jenkins.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install fontconfig openjdk-11-jre
$ sudo apt-get install jenkins

To view the password needed to login

$ sudo cat  /var/lib/jenkins/secrets/initialAdminPassword

Load the page on EC2 instalve public IP to access the Jenkins panel

Once the account was set up, I created linked the pipeline to a Github repository and set the project to be built by Github hook trigger for GITScm polling.
After that, I triggerd a webhook on Github to be sent to jenkinsurl/ so that the project will be rebuilt every time ofter every commit to the Github repository.

Running the Jenkins pipeline and Terraform

To create the infrastructure, the process was broken down into multiple terraform files for readability.

For this project, an existing NGINX image was used from the online repostory.

The pipeline runs the following commands to start the service

kubectl create deployment app-deployment --image=nginx --port=80 --dry-run=client -o yaml > nginx-deploy.yaml
kubectl apply -f nginx-deploy.yaml
kubectl expose deployment app-deployment  --type=ClusterIP  --name=app-service-cluster-ip
kubectl expose deployment app-deployment  --type=NodePort  --name=app-service-nodeport
kubectl expose deployment app-deployment  --type=LoadBalancer  --name=app-service-loadbalancer

Setting up the Monitoring Tool Stack

For connecting the EKS cluster to monitoring, the following was done

Open up the cloud shell Connect to the EKS created

aws eks --region us-east-2 update-kubeconfig --name <my cluster name>

For Connecting Splunk to the webserver

Working on it...

About

Final project combining all subjects learned throughout the course

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published