Built with;
This repository contains the final project developed under the Patika.dev & Protein DevOps Engineer Bootcamp. While some directories are isolated developments, the overall purpose of the project is deploying a containerized application on optimized AWS infrastructure with the ability of Terraform using Gitlab CI/CD pipelines.
If you are looking for something specific, check out the directory content first!
#️⃣ Assignment 🔝
Fully cover the DevOps cycle and create a full-on CI/CD and cloud infrastructure.
- Create a simple React application.
- Containerize the image with the smallest possible size.
- Design a Gitlab CI/CD pipeline to automate all processes.
- Create the ideal VPC and implement security measures.
- Create an Application Load Balancer in front of the service.
- Deploy Docker image on ECS Fargate.
- Deploy the application on Kubernetes.
- Describe strategies and choices on related files.
- Configure an auto-scaling on the ECS service.
- Create a Cloudwatch dashboard with proper metrics.
- Draw the AWS infrastructure and describe the relations between services.
- Configure a self-hosted runner on Gitlab and share its configuration with the implementation steps.
- Create a script that sends an email if the disk usage of the system exceeds 90% in the OS.
📔 Overview 🔝
The project presents an example of a fully automated DevOps CI/CD cycle with the ability to deploy on AWS infrastructure. Check out the featured section for a quick preview of the project features.
✨ Featured 🔝
- Simple React application dockerized with the smallest image size. (~ 24 MB)
- Terraform stack that is built with module composition to fully utilize AWS capabilities.
- AWS infrastructure that implements most of the security measures and best practices.
- An automated main CI/CD pipeline on Gitlab.
- Simple workflow on Github to mirror this repository to Gitlab. (Also produces another Docker Image to Docker Hub for the demonstrative purposes)
- Both pipelines are working on self-hosted runners.
- Example project board to demonstrate Scrum framework by using Github Projects & Issues.
- YAML templates for issues and pull requests for making data inputs easier.
- Both pipelines are working on self-hosted runners.
- Auxilary shell scripts and k8s deployment manifests.
- Vagrantfile to easier build a VM test environment for shell scripts.
📅 Project Board 🔝
To demonstrate the Agile framework, a scaled-down Scrum methodology is used to utilize total project time with the most efficiency. Originally, I intended to use Jira Software but due to the timeframe of the project, I decided to use Github Projects and Issues are utilized as a backlog of the board and the board cards are populated from here. The image below is an example taken in the middle of the project.
🔀 Project Workflow 🔝
A simple React project is created and used as a sample application. Github is used as an auxiliary repository to dockerize the application's development environment and pushes the Docker image to Docker Hub along with mirroring the entire repository to Gitlab, which is the main repository. After the mirroring to Gitlab, the main pipeline begins building the project as a production environment and containerizing the application with Docker. This image is pushed to Gitlab's and AWS' (ECR) container registries. A self-hosted runner is hosted on both Github's and Gitlab's pipelines to run these pipelines.
Upon finishing the main pipeline, the child pipeline built for Terraform starts initializing process and plans the requested resources from AWS. Developing a reusable code (IaC) to utilize AWS was critical since the project requires many of the AWS main and sub-services. The execution step(Terraform apply) must be triggered manually since automatic execution may cause unwanted outcomes. The project also contains other deployment methods such as Kubernetes and an additional shell script as a part of the assignment.
🔌 AWS Infrastructure 🔝
📂 Directory Content 🔝
/ : Gitlab CI/CD parent pipeline manifest.
.github/ : Github Actions workflow manifests, issue and pull request templates.
.gitlab/ : Terraform deployment manifest, self-hosted runner configuration.
ansible/ : Simple shell script for checking the disk usage and sending email alerts.
assets/ : AWS infrastucture diagram draw.io export.
docker/ : React application, Dockerfiles for production and development environments.
k8s/ : Kubernetes deployment manifests.
terraform/ : Modular Terraform Stack featuring most AWS services.