- Application Overview
- Docker compose and Dev ENV
- Helm Overview.
- Frontend Helm Deployment
- Backend Helm Deployment
- Infrastructure Configurations
- Pipeline and Repository URLs
- Monitoring and Observability
Contacts application for managing contacts, where contacts are stored in a MongoDB database. You can delete, update, and add new contacts.
-
App URL: https://intouch.cloud-stacks.com/
-
api endpoint:
- For Backend check ReadMe File in this repo: https://github.com/yousabu/contacts-system-backend.git
- For Frontend check ReadMe File in this repo: https://github.com/yousabu/contacts-system-frontend.git
- I have created a Helm template that can be used for both frontend and backend deployments. By using the values.yaml file located in each repository (frontend/backend), the deployment logic will be determined.
Backend values.yaml : https://github.com/yousabu/contacts-system-backend/blob/main/values.yaml
Frontend values.yaml: https://github.com/yousabu/contacts-system-frontend/blob/main/values.yaml
Helm Values Configuration
├── replicaCount
│
├── backend/frontend
│
├── namespace
│
├── image
│ ├── repository
│ ├── tag
│ └── pullPolicy
│
├── service
│ ├── type
│ ├── port
│ └── nodeport
│
├── autoscaling
│ ├── enabled
│ ├── minReplicas
│ ├── maxReplicas
│ └── targetCPUUtilizationPercentage
│
├── env vars
- As per image bellow:
- Runnig Resources:
-
Cluster: I used MicroK8s installed on an EC2 instance on AWS to create a lightweight cluster and enabled public access to it. I then generated a configuration file (config) for future use.
-
Service Connection: I set up the connection between Azure DevOps and the cluster using the configuration file.
-
Connections: The cluster contains an internal ingress to route traffic between the frontend and backend.
-
Ingress: I set up an Ingress for the domain (https://intouch.cloud-stacks.com/) and requested a certificate for it using Cert Manager, issued by Let's Encrypt.
-
Horizontal Pod Autoscaler (HPA): Configured to automatically scale the number of pod replicas up or down based on observed CPU utilization or other selected metrics. This ensures that the application can handle varying loads efficiently
We have two pipelines, each in its own repository, to build, push, and deploy the application using Helm:
- HelmChart Repository: https://github.com/yousabu/contacts-system-helmchart.git
- Pipeline For Backend & Frontend on azure: https://dev.azure.com/abuhamda/retail-media-org/_build
- Backend GitHub Repository: https://github.com/yousabu/contacts-system-backend.git
- Frontend GitHub Repository: https://github.com/yousabu/contacts-system-frontend.git
- Due to a lack of resources, I didn't use Prometheus and Grafana, even though they are the most popular monitoring tools. Instead, I used a New Relic free trial as a lightweight monitoring tool.
Dashboard:
Runnig Service:
- The best practice for managing secrets is to use a mechanism like Sealed Secrets, which encrypts secret files so that only the cluster can decrypt them. However, I did not implement this here because it requires Sealed Secrets Manager, and I had limited resources to set it up.