Welcome to an immersive DevSecOps learning experience! This project guides you through deploying a Tetris game on AWS EKS while mastering the art of DevSecOps.
- EKS-TF: Explore Terraform scripts for deploying EKS clusters on AWS.
- Jenkins-Pipeline-Code: Jenkins pipeline code for automated CI/CD.
- Jenkins-Server-TF: Terraform scripts for provisioning Jenkins servers on AWS EC2.
- deployments: Kubernetes manifest files for Tetris application deployment.
- Tetris-V1: Initial version of the Tetris game application.
- Tetris-V2: Enhanced version of the Tetris game application.
- Clone the Repository:
git clone https://github.com/thedevopsprashant/end-to-end-devsecops-tetris-project.git
- Explore the Directories: Navigate into each directory to find detailed scripts, pipelines, and configurations.
- Jenkins: Automated CI/CD pipelines
- Terraform: Infrastructure as Code for AWS EKS
- EKS Kubernetes: Orchestration for containerized applications
- ArgoCD: Continuous deployment to Kubernetes
- SonarQube: Unveiling code quality insights
- Docker: Containerized application deployment
- Trivy: Container vulnerability scanner
- OWASP Dependency-Check: Ensuring secure dependencies
Special Thanks to the open-source community and Aman Pathak for the medium blog, the contributors who make learning and collaboration an incredible journey.
- Go to Jenkins-Server-TF, Create the Jenkins server using TF - Run tf init, tf plan, tf apply.
- Now setup the jenkins server install required addons, Install and Configure tools/plugins on Jenkins server.
Install Jenkins Plugins:
- aws creds
- pipeline step
- pipeline stage view
- rebuilder
- docker
- docker common
- docker api
- sonarqube scanner
Add Jenkins global credentials for: aws-key, sonar-token, github, docker.
Configure Jenkins System tools for Sonar, docker.
Configure Project and generate token on Sonar.
Create Dockerhub repo for the App.
-
Create/Configure Jenkins pipeline to create the EKS cluster using terraform. In folder 'Jenkins-Pipeline-Code', use Jenkinsfile-EKS-Terraform to configure the jenkins pipeline. Then Run the pipeline to create EKS Cluster. This will take around 15mins.
-
Configure the App pipeline, In folder 'Jenkins-Pipeline-Code', use Jenkinsfile-TetrisV1. Run the pipeline
-
Install ArgoCD and ALB Controller using Helm on EKS cluster.
-
Run below on Jenkins Ubuntu Server:
aws configure
aws eks update-kubeconfig --name Tetris-EKS-Cluster --region ap-south-1
#Install helm on Ubuntu
sudo snap install helm --classic
helm version
#Install argocd on Ubuntu
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d && echo- Open and Login in ArgoCd, Create a App on ArgoCd add the /deployments files for the deployment. Create it.
- Open AWS, Get the Loadbalancer DNS for the app LB, Access it. Tetris Game should be accessible.
Optional: Docker Commands to build multi-arch supported Docker Images:
docker buildx build --platform linux/amd64 -t prashantsharma288/tetrisv1:2 .
docker buildx build --platform linux/amd64,linux/arm64 -t prashantsharma288/tetrisv1:2 .