From Monolith to Microservices

The Contact List Application powers internal tooling for product and operations teams. To keep pace with feature delivery and seasonal load, the application evolved from a single virtual machine into a Kubernetes workload split across API, database, and worker microservices. This article documents the transformation and the playbooks that now keep the platform resilient.

The migration centred on five principles: declarative infrastructure, automated deployments, observability-first development, defence in depth, and cost transparency. Adhering to these pillars enabled every environment—development through production—to behave predictably while remaining easy to extend.

Reference Architecture

A dedicated Amazon EKS cluster hosts the workload. Helm charts manage service definitions, secrets use AWS Secrets Manager and External Secrets Operator, and Argo CD provides GitOps reconciliation. Traffic flows through AWS Application Load Balancer to an Nginx ingress controller, which routes requests to Flask API pods. Stateful workloads—MySQL and Redis—are deployed as managed services using Amazon RDS and ElastiCache for operational simplicity.

High-level Kubernetes deployment diagram

Operational Excellence Checklist

  • Blue/green rollouts through Argo Rollouts and GitHub Actions promote confidence in production deployments.
  • Grafana dashboards backed by Prometheus and Loki expose golden signals and release health in a single view.
  • Daily back-ups of the RDS instance ship to Amazon S3 with automated restore drills.
  • OPA Gatekeeper enforces namespace, resource, and network policies before manifests reach the cluster.

Automation Highlights

  • GitHub Actions pipeline builds, tests, and signs OCI images with Cosign.
  • Terraform modules provision EKS, VPC networking, and managed database services.
  • Terragrunt orchestrates environment-specific workspaces and remote state.
  • Argo CD ApplicationSets generate tenant-specific namespaces from a single manifest.
  • Karpenter autoscaler keeps cluster costs predictable during sporting-event traffic spikes.
  • PagerDuty on-call rotations trigger from Prometheus alert rules with contextual runbooks.

Every change starts as code review. Terraform plans, Helm linting, and Kubernetes policy checks run in pull requests, while integration tests execute against ephemeral preview environments. Once merged, Argo CD reconciles the desired state in minutes, and Grafana dashboards confirm success through automated synthetic checks.