Back to projectsThesis Project

Thesis Project: Kuro Custom

Design, implementation, and validation of a highly available, elastically scalable Linux cloud infrastructure (Ubuntu Server 24.04 LTS on AWS us-east-1) using self-managed Kubernetes (kubeadm), Calico CNI network segmentation, observability, and Chaos Engineering, validated with independent stress tests of 30,000 concurrent HTTP requests (300 threads in Apache JMeter).

Ubuntu Server 24.04 LTS NodesAWS us-east-1
Core Technology Stack
18 Technologies

Cloud infrastructure provisioned through declarative tooling (Terraform, Ansible, Kubernetes manifests), with no plaintext credentials in the repository and the full lifecycle automated through GitHub Actions.

AWSUbuntu 24.04 LTSKubernetes (kubeadm)containerdCalico CNITerraform ≥ 1.10AnsibleGitHub ActionsTrivyPrometheusGrafanaCloudflare APIPostgreSQL 16.3Django RESTAstro & ReactApache JMeterDockerMetrics Server
Terraform · Ansible · GitHub ActionsTwelve-Factor / FinOps
01 — Diagnostic & Traffic Audit
Audit Report

Configuration Drift & Flat Network Vulnerabilities

Traditional e-commerce cloud deployments often suffer from "configuration drift", costly downtime during deployments, uncontrolled cloud spending, and vulnerabilities caused by flat internal networks. Moreover, many organizations adopt managed cloud services without evaluating alternatives, or run Kubernetes clusters without granular control over internal traffic. The research question was how an automated cloud architecture (IaC and container orchestration on Linux) mitigates configuration drift, shortens deployment times, and ensures high availability compared with manual provisioning. The central objective was to design and implement an integral, scalable, fault-tolerant cloud architecture based on Linux and cloud-native technologies, and to validate it empirically on Kuro Custom, an e-commerce platform (Django backend, Astro/React frontend, and PostgreSQL 16.3). The experimental phase was limited exclusively to AWS (no GCP, Azure, EKS, or VM autoscaling) with Ubuntu Server 24.04 LTS (selected after comparing enterprise Linux distributions), self-managed Kubernetes (kubeadm), Calico CNI, observability, and declarative automation (Terraform + Ansible + GitOps), sustaining peaks of up to 800% CPU over the base quota with continuous availability, under FinOps and Green Cloud Computing principles.

Audited Traffic Matrix

Frontend → Backend API

ALLOWED

Allowed via NodePort 30800 & internal K8s Service abstraction.

Worker Nodes → Private RDS :5432

INTERNAL

Internal VPC routing without NAT Gateway fee; egress blocked.

Implicit Denied Traversal

DENIED

Frontend cannot reach RDS directly (5432); the monitoring namespace is isolated.

Controlled Linux 24.04 EnvironmentReproducible IaC
02 — Chaos Protocols & Kernel Policies
30,000 Req HTTP

Stress Testing & Chaos Protocols

Results measured with Apache JMeter in two independent runs (300 threads with a 60 s ramp-up and 100 iterations each: 30,000 HTTP requests per run): one against the frontend and one against the backend API, with HPA peaks of up to 794% and 800% CPU.

Frontend: Throughput & Errors374.87 req/s · 0.00%
30,000 requests, 300 threads, 301.79 ms average response time (p99 of 650 ms, APDEX 0.944)
Backend (API): Throughput & Errors195.00 req/s · 0.02%
99.98% success; 5 HTTP 502 errors during initial saturation; 700.34 ms average
HPA Pod Scaling2 → 5 replicas
Peaks of 794% (frontend) and 800% (backend) against the 50% target; automatic scale down to 2 replicas
Amazon RDS Impact18.1% CPU · 25 connections
Peak CPU from a 3.80% baseline, with 5 connections per backend replica
Worker Node Failure< 60 s
ALB convergence with no total service outage; pod rescheduling after ~5 min
Disaster Recovery (MTTR)3 min 44 s
Automated node rebuild via CI/CD, Terraform, and Ansible (from hours to minutes)
Calico CNI Kernel Enforcement

Calico v3.28 · default-deny-ingress · Pod CIDR: 192.168.0.0/16

Target Tracking HPA > 50%Apache JMeter · Calico CNI
03 — Declarative Cloud Architecture

Declarative Infrastructure & Network Segmentation

Architecture deployed on AWS us-east-1 following the Twelve-Factor App methodology and AWS Well-Architected Framework pillars:

Infrastructure as Code & Network (IaC)

01
Terraform ≥ 1.10 · S3 State Locking · Multi-AZ VPC

Declarative VPC (10.0.0.0/16) with public and private subnets in us-east-1a and us-east-1b. Multi-AZ Application Load Balancer with path-based routing (/api/* to Django, / to Astro/React) and TLS via ACM, with DNS managed in Cloudflare.

Linux Node Hardening & Containerd Runtime

02
Ubuntu 24.04 LTS · Ansible · containerd · kubeadm

Ansible provisioning in 4 layers: OS hardening (SSH, sysctl, swap off), container tooling (containerd, kubeadm), cluster init with Calico and Metrics Server, and observability. One control plane (c7i-flex.large) and 2 workers (m7i-flex.large) across both AZs.

Isolated Data Tier without NAT Costs

03
Amazon RDS PostgreSQL 16.3 · Private Subnets · No NAT Gateway

PostgreSQL in private subnets with no route to the Internet Gateway and no NAT Gateway cost. Internal VPC routing and a dedicated Security Group allow port 5432 only from the workers; no public access, encryption at rest (KMS), and egress blocked.

Network Segmentation Policies (Calico CNI)

04
Calico CNI · iptables · Default-Deny-Ingress

Default-deny-ingress model with explicit per-service allowlists and specific egress rules for backend and frontend, preventing unauthorized pod-to-pod traffic and lateral movement. The monitoring namespace has its own default-deny-ingress policy plus explicit allow rules.

Immutable Observability & Telemetry Stack

05
Prometheus · Grafana · cAdvisor · Node Exporter

Auto-provisioned via ConfigMaps and Secrets without plaintext passwords in git, with Prometheus scraping Node Exporter and cAdvisor to track node and pod saturation during load tests.

Containers & GitOps CI/CD

06
Docker · Docker Hub · GitHub Actions · Tfsec · Trivy

Backend (Django) and frontend (Astro/React) images published to Docker Hub. Separate infrastructure (Terraform + Ansible) and application pipelines, ephemeral SSH access closed with if: always(), and a security workflow (Tfsec in warning mode and Trivy, which fails on CRITICAL CVEs).

AWS Multi-AZ · Calico CNI · K8s kubeadmNo Secrets in Repo
04 — Architectural Diagrams
4 Diagrams
Tier 1 — Architecture & Network

Global Thesis Cloud Architecture (AWS Multi-AZ & K8s)

End-to-end view in four phases: (I) AWS base infrastructure with the ALB, Security Groups, and RDS PostgreSQL 16.3; (II) Linux nodes (1 control plane and 2 workers); (III) Kubernetes orchestration with frontend (Astro SSR on Node) and backend (Django + Gunicorn) pods, HPA, Calico Network Policies, Metrics Server, and Node Exporter; (IV) GitOps flow with GitHub Actions. It also shows the JMeter stress test hitting the ALB.

Expand Image
Global Thesis Cloud Architecture (AWS Multi-AZ & K8s)
Tier 2 — Request Flow & GitOps

User Request Flow & ALB Routing

The user resolves kurocustom.uk via Cloudflare DNS and reaches the ALB (443, ACM certificate). By default (/) traffic goes to the frontend (NodePort 30080); /api/*, /admin/*, and /static/* go to the Django backend (NodePort 30800); and the grafana.kurocustom.uk host goes to Grafana (NodePort 30300). Only the backend connects to RDS on port 5432.

Expand Image
User Request Flow & ALB Routing
Click or pinch to inspect in full HDVPC CIDR /16
05 — Empirical Findings & Impact
6 Findings

Empirical Findings & Production Readiness

The experimental validation showed 0.00% errors on the frontend and a 99.98% success rate on the backend API (0.02% error rate) under extreme load, on a fixed-node infrastructure.

  • >Frontend under stress: 30,000 requests at 374.87 req/s, 301.79 ms average response time, and 0.00% errors. Backend API: 195.00 req/s and 99.98% success (0.02% error rate).
  • >Elastic scaling validated: HPA went from 2 to 5 replicas with CPU peaks of 794% (frontend) and 800% (backend), and returned to 2 replicas after cooldown.
  • >Multi-AZ high availability: on abrupt Worker Node failure, the ALB converged in under 60 s and the service never suffered a total outage.
  • >MTTR cut from hours to minutes: automated rebuild of a destroyed node in 3 min 44 s through GitHub Actions, Terraform, and Ansible.
  • >Decoupled persistence: Amazon RDS absorbed 25 simultaneous connections with a CPU peak of only 18.1%. Internal segmentation with Calico CNI.
  • >Immutability audit: terraform plan detected and reverted manual Configuration Drift on a Security Group. Aligned with Twelve-Factor App, FinOps, and Green Cloud Computing.
Chaos Engineering Validated0.00% / 0.02% Error
06 — Architectural Decisions

Rigorous Engineering Trade-offs

Each technical choice was intentionally balanced against cost, observability, and experimental reproducibility.

1 / 8

Self-managed Kubernetes (kubeadm) vs. Amazon EKS

kubeadm on EC2 was chosen to avoid the EKS control plane fee of $0.10/hour (~$73/month), which falls outside the AWS Free Tier, and to observe etcd, kube-apiserver, and the scheduler directly in Prometheus without a managed-service abstraction. The trade-off: no native Cluster Autoscaler, so HPA scales pods but nodes stay fixed.

Fixed EC2 sizing as a methodological experimental decision

The 3 nodes (1 c7i-flex.large control plane and 2 m7i-flex.large workers, in different Availability Zones) were provisioned with fixed capacity by experimental design, so Chaos Engineering tests would be reproducible and comparable across runs. This is a deliberate choice, unlike the static sizing anti-pattern; in production, Auto Scaling Groups or EKS with Karpenter would be used.

Calico CNI with strict Network Policies vs. basic overlays

Unlike Flannel (VXLAN connectivity without segmentation), Calico programs iptables rules enforcing a default-deny-ingress model: the frontend cannot reach RDS directly, the backend does not initiate connections to the frontend, and the monitoring namespace is isolated. Specific egress rules for backend and frontend complement the policy.

RDS in private subnets without NAT Gateway operational cost

RDS only accepts inbound connections from the workers and never initiates outbound internet connections. Since both share the same VPC, workers reach PostgreSQL through internal routing, with no need for a NAT Gateway and its associated cost. During the stress test, the database absorbed 25 simultaneous connections with a CPU peak of just 18.1%.

Horizontal Pod Autoscaler (HPA) with 50% CPU Target Tracking

In-cluster autoscaling: the backend and frontend Deployments scale from 2 to 5 replicas when average CPU usage exceeds 50%. With 30,000 requests per test (300 threads), the frontend recorded 0.00% errors and the backend 0.02% (5 HTTP 502 responses before the new replicas passed their readiness probes); after a ~10-minute cooldown both returned to 2 replicas.

Dynamic CI/CD with ephemeral Security Group ingress windows

The GitHub Actions pipeline opens SSH (port 22) in the Security Groups only for the runner IP while the job runs, and closes it with if: always() even if the pipeline fails. A separate security workflow runs Tfsec on Terraform (soft_fail) and Trivy on images, and fails on CRITICAL vulnerabilities. The same pipeline rebuilt a terminated node in 3 min 44 s.

In-cluster frontend hosting vs. decoupled S3 + CloudFront

S3 + CloudFront was evaluated and discarded to keep UI traffic inside the cluster under study. Serving the frontend from Kubernetes made it possible to measure the full load (frontend and backend) on the HPA and Prometheus metrics, free of external variables such as CDN caching.

Automated DNS & TLS lifecycle management (Terraform + Cloudflare)

Cloudflare provider integrated in Terraform to handle DNS changes when infrastructure is recreated: it creates the ACM validation records and updates the CNAMEs for the main domain (www and @) and Grafana to point to the new ALB.

Well-Architected FrameworkGitOps / Immutable
07 — Research Conclusions

Conclusions

The research empirically demonstrated the technical, economic, and operational feasibility of replacing manual server administration with a Cloud-Native architecture governed by IaC, container orchestration, and CI/CD. On the Kuro Custom case the hypothesis is validated: declarative infrastructure coding combined with Kubernetes cuts deployment and recovery times, eliminates outages caused by human configuration errors, and optimizes compute consumption.

  • 01Base operating system: Ubuntu Server 24.04 LTS

    With Linux kernel 6.8.0-1008-aws and the containerd runtime, and no graphical interface, the node kept a light footprint: 14.8% RAM out of 8 GiB during peak-load tests, leaving nearly all hardware to the microservices.

  • 02Idempotency and end of Configuration Drift (Terraform)

    Terraform modules provisioned the VPC, ALB, EC2 instances, and Amazon RDS (PostgreSQL). In the audit on the sg_kuro_custom Security Group, terraform plan detected the manual change and reverted it in place (1 to change, 0 to destroy).

  • 03Automation, hardening, and DevSecOps (Ansible and GitHub Actions)

    With dynamic AWS inventory, SSH opened only while the runner executes, and unattended containerd setup, a destroyed node was rebuilt and joined from scratch in 3 min 44 s.

  • 04Multi-AZ high availability, self-healing, and elasticity (Kubernetes and Calico)

    Kubernetes v1.29.15 cluster (kubeadm). Deleted pods recovered in 7 to 42 s with no outage; when a worker was stopped, the ALB isolated it in under 60 s and Kubernetes rescheduled the replicas (continuous HTTP 200); with CPU peaks of 794% (frontend) and 800% (backend), the HPA scaled both services from 2 to 5 replicas spread across the nodes.

  • 05Observability, stress performance, FinOps, and Green Cloud

    With 30,000 concurrent requests (300 JMeter threads): frontend at 374.87 req/s, 301.79 ms average, and 0.00% errors; API at 195.00 req/s and 99.98% success (5 HTTP 502 errors, 0.02%); RDS peaking at 18.1% CPU and 25 connections. Scaling down to 2 replicas brought CPU to 1%-2%, avoiding static overprovisioning (FinOps) and idle resources (Green Cloud).

Hypothesis validated5 specific objectives
08 — Strategic Future Work
5 Lines

Next Steps for Kuro Custom

Lines of development derived from the budget and scope limits of the research (section 1.7.2) and the evolution of the Cloud-Native ecosystem.

  • Managed control plane (Amazon EKS)

    Move from kubeadm on EC2 to EKS, delegating high availability, scaling, and patching of the API Server and etcd to the provider.

  • Node autoscaling (Karpenter / Cluster Autoscaler)

    Today HPA scales pods over a fixed EC2 fleet; the proposal is to provision and destroy nodes autonomously when pods exhaust physical capacity.

  • Service mesh (Istio or Linkerd)

    Zero-Trust with transparent mTLS for east-west traffic, plus Canary Releases and A/B testing without changing application code.

  • Distributed tracing (OpenTelemetry)

    Instrument the microservices with OpenTelemetry and Jaeger or Grafana Tempo to trace each transaction from the ALB, through Django, down to the SQL query in RDS.

  • Active-Active Multi-Region topology

    Extend Terraform across several AWS regions with latency-based routing in Amazon Route 53 and cross-region read replicas in RDS.

EKS · Karpenter · Service MeshMulti-Region
David_Nicanor.dev

$ status --current Available for hire

Insolus Marca
© 2026 David Nicanor. All rights reserved.
Built with Astro · React · TypeScriptHosted on S3 · CloudFront