It's a portfolio application with 2 backend microservices. One for fetching user data and one for fetching user projects. The frontend has been developed using React and the backend with NodeJS.
For the implementation of the infrastructure the following tools were used.
- Kubernetes
- Kustomize
- Terraform
- Helm
- Grafana and Datadog for Visualization.
- Prometheus, to pull metrics.
I used the library winston on Nodejs to enable logging These are the logs generated by app. We added a unique Request_id and the Client IP Address to the logs for a better analysis of the logs.
We used the library prom-client to configure metrics in the application. This is a custom metrics that we created. Those metrics are pulled by our prom-client to prometheus. We visualized our cluster metrics using grafana.
For the automation we used 2 stacks in terraform.
Here we created a resource group for the cluster and provisioned an AKS cluster. We also configured Terraform to use Azure Blob Storage as remote state backend.
We created the monitoring setup for our application using Kubernetes provider as well as Helm provider. We used the kube-prometheus-stack helm chart to install proetheus and grafana.
This is the architecture of the deployment of the application.
We used the blue/green deployment strategy because we want to maintain two identical production environments. In this case, the blue deployment has a label "V1.0.0" and the green has a label of "V2.0.0". During the update we wanted the new version deployed and tested on a production environment and redirecting the user traffic after it has been verified.
To set-up the cluster we used a micro-stack architecture using Terraform.
The cluster micro-stack will provision the AKS cluster with a node pool of two nodes. It will output the kube-config for the other stack to use.
terraform init
terraform plan
terraform apply