A DevOps Perspective To An Application Lifecycle
DevOps - My humble opinion
DevOps as we all know it, is a principle and not a function. But, over the period of time, Sysadmins, Platform engineers and Automation engineers merged into a middle ground between Application development and Application support and followed the devops principles.
DevOps Principles or DevOps Model is a tight integration between application development and operations which enables the organization to deliver the services with high quality and high frequency. My humble opinion is,
"A DevOps Engineer should know most of the application development, how it is configured, how it is working, testing the application,etc., to what are the requirements of that application to run and what infrastructure configurations are required to run the application and how to release a new version of application without any significant impact to the end users".
Join me in this epic journey of developing, testing, releasing, monitoring and provisioning the infrastructure required for that app.
Tackling DevOps head on
I'm creating a series of articles targeted to deploy an app from zero to production from a DevOps perspective.
Our first step is to create a nodejs app, which connects to a postgres DB for a sample event management application. The nodejs apis will be consumed by a frontend application (Angular/ React). Once done, the user will be able to create an event through this application, invite friends through email and change event timings. The idea of using this scenario is to provide placeholders to extend the application with microservices, authentication and CRUD operations.
This application is going to be in multiple parts and we are going to target multiple layers of taking an application to prod and the things that needs to be considered when developing an application.
We are not going to focus on how the application has to be written, rather, we will focus on the infrastructure required for the application to run.
Assumptions:
- We don't have any infrastructure pre-built for us.
- No networking is ready for the application to connect to.
What we are going to do?
We will create a simple three tier architecture for our application.
- Web layer
- App layer
- DB layer
For Web, we will use nginx servers. For APP (authentication and APIs) we will use nodejs and for DB, we will use Postgresql.
In this series, we will create our infra and deploy our application in two ways. By having everything in the same repo (monolithic repo) and by having individual repos for web, app and services.
How we are going to do our setup?
- We will deploy our frontend in nginx server
- We will create nodejs apis
- We will add postgres libs in nodejs for DB connectivity
- Dockerize the app, web and DB layers
- Test it locally by using a
docker compose
setup. - Create a Build Pipeline to build these images in github
- Create ECR repos using terraform
- Upload these images to ECR using github workflows
- Create EC2 instances for web, app and DB using terraform
- Create load balancers for web, app and DB using terraform
- Create VPC and NAT gateway using terraform
- Create Public and Private Subnets using terraform
- Create auto-scaling groups using terraform
- Deploy the containers in the ec2 instances using chef framework and github workflows
- Run an end to end test (integration test) using playwright in the pipeline
- Setup Application Monitoring.
We are going to have multiple pathways in this journey. We will use AWS as our cloud provider for the start and use different deployment architectures in our journey.