How DevOps and SRE principles can be used in practice to achieve Continuous Deployment (from development to production as fast and frictionless as possible).
This repository is divided in two parts:
In reality these would be multiple repositories, but we're keeping everything here for the sake of simplicity.
├── dev
│ │
│ ├── api
│ │ ├── chart
│ │ └── src
│ │
│ └── webapp
│ ├── chart
│ └── src
│
└── ops
│
├── environments
│ └── dev
│ ├── 01_vpc
│ ├── 02_rds
│ ├── 03_eks
│ ├── 04_argocd
│ └── 05_applications
│
└── tf_modules
├── argocd
├── eks
├── rds
└── vpc
Where the application code is written.
The app consists of two microsservices:
- WEB Application
- API
The API is backed by a PostgreSQL database and is the only service with access to it. Because of that, the WEB APP needs to call the API in order to get the data.
Here is also where the Helm Charts are developed so the application can be deployed on Kubernetes.
Contains instructions on how to create the infrastructure needed.
The infrastructure is on AWS, written in Terraform, and consists of:
- A VPC with three subnets: public, private and database;
- An Aurora RDS Cluster;
- An EKS Cluster with autoscaling;
- An ArgoCD Server that deploys:
- The application (WEB APP and API);
- NGINX Ingress Controller;
- Prometheus;
- Grafana.
To achieve Continuous Integration the following GitHub Actions are used:
- Dev
- Ops
Once the changes hit the master
branch a GitHub Action will automatically:
- Build and push container images to DockerHub (using commit hash as tag);
- Update values at
environments/$ENV/05_applications
with the new image tag; - Push changes from previous step into the
master
branch.
ArgoCD will detect the changes and sync the cluster, giving us Continuous Deployment (without any need of human interaction).