AWS Builder Center
I Built a 3-Tier App on EKS Entirely by Hand Here's Everything That Broke (and Why)

I Built a 3-Tier App on EKS Entirely by Hand Here's Everything That Broke (and Why)

A console-first walkthrough of deploying a React/Node/Postgres app on Amazon EKS IAM least privilege, custom VPC networking, IRSA, persistent storage, and ALB Ingress plus the real bugs that taught me more than any tutorial would have.

Senior Devops Engineer @ Ampity | 3x AWS Professional Certified | DevOps, Terraform & Automation

I Built EKS Entirely by Hand and Everything That Broke Along the Way

Why build EKS by hand?

Most EKS tutorials reach for  eksctl  or Terraform on day one, and for good reason, they're faster, and in production you'd use one of them anyway. But speed wasn't the point of this project. I wanted to understand what those tools actually do underneath, so I built every piece by hand instead: VPC and subnet tagging, IAM roles, the cluster itself, node groups, IRSA trust policies, storage classes, ingress routing, a CDN, autoscaling, observability, and security hardening, almost entirely through the AWS Console. kubectl and Helm were fair game for anything Kubernetes-native with no console equivalent, but if a console button existed, I used it instead of a CLI shortcut.
This is the full story, start to finish, thirteen phases plus one bonus round, including the bugs that taught me more than any of the tutorials I skipped.

The project: TaskBoard

TaskBoard is a deliberately simple 3-tier app: a React kanban board (Todo / In Progress / Done), a Node/Express API, and RDS Postgres as the data tier. The app itself doesn't matter, it's thin on purpose. What matters is that deploying and operating it end-to-end touches nearly every core EKS concept: networking, IAM/IRSA, two compute models, persistent storage, ingress, a CDN, autoscaling, observability, and security hardening.

Architecture, and the reasoning behind it

The VPC is a  /16  split into two public and two private subnets across two Availability Zones. The public subnets exist for exactly two things: a NAT Gateway, and an internet-facing ALB. Everything else, the EKS control plane's association, the node group, the Fargate profile, RDS, lives entirely in the private subnets.
That was a deliberate choice, not a default. Most walkthroughs associate the EKS cluster with all four subnets at creation time, because it "just works" without more thought. I associated mine with private subnets only, specifically because the AWS Load Balancer Controller discovers subnets for an ALB by scanning the entire VPC for tags,  kubernetes.io/role/elb  on public subnets,  kubernetes.io/role/internal-elb  on private ones, not by asking which subnets the cluster itself is attached to. Going private-only proved that distinction directly, instead of leaving it as something I'd just read about.

Phase 0–1: IAM least privilege, and a VPC built tag by tag

Before touching any AWS resource, I created a dedicated IAM user with MFA and a custom policy scoped tightly to this project, no  AdministratorAccess , ever. Every IAM role created afterward follows a strict  taskboard-*  naming convention, enforced by the policy itself via resource-level restrictions on  iam:CreateRole  and  iam:PassRole .
The VPC came next: two public subnets, two private subnets, an Internet Gateway, a single NAT Gateway, and separate route tables for each side. The part that actually matters for EKS is the subnet tagging,  kubernetes.io/cluster/<cluster-name> = shared  on all four subnets,  kubernetes.io/role/elb = 1  on the public ones, and  kubernetes.io/role/internal-elb = 1  on the private ones. These tags look like a formality during setup. They are not, a mistake here stayed completely invisible for seven entire phases before it surfaced.

Phase 2: the cluster, and the OIDC step almost everyone skips

Creating the cluster itself was straightforward: a cluster IAM role with the  AmazonEKSClusterPolicy  managed policy, private-subnet-only association, both public and private endpoint access (public for kubectl from a laptop, private so node-to-control-plane traffic never leaves the VPC), and all five control plane log types enabled.
The step that's easy to miss: EKS automatically creates an OIDC issuer the moment the cluster exists, but it does not register that issuer with IAM as a trusted identity provider, those are two separate things. Skip the registration, and IRSA simply cannot function later, with no obvious error pointing back to the missing piece.

Phase 3–4: two compute models, and a real app in ECR

A managed node group ( t3.medium , autoscaling 2–4) and a Fargate profile scoped to their own namespace, running side by side, so I could feel the operational difference between "I manage the EC2 instances" and "AWS manages the compute entirely" within the same cluster.
The app itself is real: a Vite-built React frontend served by nginx, and an Express backend talking to Postgres. The frontend's Dockerfile is a genuine multi-stage build, a  node:20-alpine  stage runs the build, producing a  dist/  folder of static files; a completely separate  nginx:1.27-alpine  stage then copies forward only that folder, discarding the entire Node toolchain. The final image ships at roughly 40MB, no JavaScript runtime inside it at all.
One Apple-Silicon-specific gotcha: building on an M-series Mac produces  arm64  images by default, but the node group's EC2 instances run  x86_64 . Every build needed an explicit  --platform linux/amd64  flag, without it, the image pulls fine and then crash-loops with an exec format error.

Phase 5: IRSA, and the bug that came back twice

This is where the project's most persistent bug lived. IRSA lets a specific Kubernetes service account assume a specific IAM role, using the OIDC provider from Phase 2 as the trust anchor. Setting it up for the EBS and EFS CSI drivers meant a Web Identity trust type, then manually tightening the trust policy's  Condition  block with a  :sub  clause scoped to the exact service account name:
"Condition": {
"StringEquals": {
"oidc.eks.<region>.amazonaws.com/id/<oidc-id>:aud": "sts.amazonaws.com",
"oidc.eks.<region>.amazonaws.com/id/<oidc-id>:sub": "system:serviceaccount:kube-system:ebs-csi-controller-sa"
}
}

Twice, the EKS console's add-on wizard let me visibly select the correct IAM role for a driver, and twice the resulting service account showed  Annotations: <none> , with controller pods stuck at partial readiness. The trust policy was correct both times; the console simply failed to persist the selection. The reliable fix was setting the annotation directly and forcing a pod restart. Later, the same failure reappeared in a subtler form: the annotation was already correct, yet the controller pods still failed on credentials, because those exact pods had been running since before the annotation was fixed, and IRSA credentials are only injected at pod creation time, never retroactively.

Phase 6: RDS, and three bugs in a row

First: connecting from the backend threw  no pg_hba.conf entry for host... no encryption . RDS enforces SSL by default; my local  docker-compose  Postgres enforced nothing, so this never surfaced until the app touched a real RDS instance. Fixed with a small, environment-gated SSL option in the connection pool.
Second:  database "taskboard" does not exist . RDS's "Initial database name" field during creation looks optional, skip it, and only the default  postgres  database exists, even though the master user was created correctly. Since RDS was deliberately private, fixing it meant reaching it from inside the VPC via a disposable pod running  psql  directly, created and destroyed in one command.
Third: the frontend's nginx container refused to start,  host not found in upstream "backend" . The  /api  proxy block pointed at a hostname that only ever existed inside Docker Compose's private network. The fix: a variable-based  proxy_pass  (forcing per-request resolution instead of resolving once at boot) pointed at the real Kubernetes Service DNS name.

Phase 7: storage, permissions, and a stale credential in disguise

Adding an EBS-backed PVC and an EFS-backed PVC surfaced two more bugs. First, a  Permission denied  writing to the EBS volume, the backend runs as a non-root user (Phase 4 hardening), but a freshly-provisioned volume is root-owned by default. Fixed with  securityContext.fsGroup . Second, the same stale-credential IRSA issue from Phase 5, wearing a different hat, on the EFS driver this time, fixed the same way, restarting the affected pods.
Once both were resolved, I proved  ReadWriteMany  genuinely worked, not just configured, by writing a file from one backend replica and reading it back from a completely separate one.

Phase 8: the ALB that wouldn't appear, then the one that lied

Installing the AWS Load Balancer Controller via Helm and creating an Ingress should have produced a working ALB within minutes. Instead, the Ingress sat empty for over an hour:  subnets count less than minimal required count: 1 < 2 . This is where the Phase 1 tagging mistake finally surfaced, one public subnet had been tagged  kubernetes.io/role/internal-elb  instead of  kubernetes.io/role/elb , invisible for seven phases because nothing before this one needed the controller's subnet auto-discovery. Fixing the tag didn't immediately help either, the controller doesn't re-scan subnets just because a tag changed elsewhere; it needed an explicit nudge via a harmless annotation change to force reconciliation.
Then the target groups reported the backend unhealthy,  404  on every check, despite the app working perfectly through direct requests. The controller defaults to health-checking  / , and the Express backend has no route there at all, only  /health  and  /api/tasks . A working app and a "healthy" load balancer target are not the same claim; the fix was pointing the health check at a route that actually exists.

Phase 9: CloudFront, and a certificate that lives somewhere else entirely

Putting a CDN in front of the ALB introduced a genuinely counterintuitive AWS quirk: CloudFront requires its certificate to exist specifically in  us-east-1 , regardless of which region everything else runs in. Miss that, and the certificate simply never appears as a selectable option when creating the distribution, no error, just an empty dropdown that looks like something else is wrong. Beyond that, the real design decision was splitting cache behaviors by path: static assets ( /* ) get standard caching, while  /api/*  gets caching disabled entirely and forwards all headers and cookies through, an API response cached like a static asset would serve stale task data to every subsequent visitor hitting the same edge location.

Phase 10: autoscaling, and the dependency EKS doesn't include by default

Cluster Autoscaler needed the underlying Auto Scaling Group tagged ( k8s.io/cluster-autoscaler/enabled , plus a cluster-specific tag) and its own IRSA role scoped to a handful of  autoscaling:*  and EC2 describe actions, the same pattern as every other IRSA role in this project by this point. The Horizontal Pod Autoscaler had a sharper edge: HPA has nothing to scale on without metrics-server, and EKS does not install it by default. It's an easy thing to forget, since the  kubectl autoscale  command itself succeeds immediately regardless. The HPA object gets created, and only sits silently at  <unknown>  for its current metrics, with no obvious error, until metrics-server is actually installed.

Phase 11: observability, two different ways

CloudWatch Container Insights and a self-managed Prometheus/Grafana stack (installed via the  kube-prometheus-stack  Helm chart) intentionally side by side, specifically to compare them rather than pick one on faith. CloudWatch required its own IRSA role with  CloudWatchAgentServerPolicy  attached, one more entry in a now-familiar pattern. Prometheus needed more assembly: a  ServiceMonitor  object to actually scrape the backend's custom  /metrics  endpoint (added via the  prom-client  package), distinct from the infrastructure-level metrics node-exporter and kube-state-metrics already provide. The genuinely useful comparison this phase produced: CloudWatch integrates with zero extra infrastructure to run, while Prometheus's Kubernetes-native metrics and dashboards are considerably richer, a tradeoff worth having actually felt, not just read about in a comparison table.

Phase 12: pulling the password out of a plain Secret

Two changes here, addressing two different attack surfaces. A  NetworkPolicy  restricting the backend to only accept traffic from the frontend pods, proven by attempting a request from a third, unrelated pod and confirming it timed out. And replacing the plain Kubernetes Secret from Phase 6 with the Secrets Store CSI Driver pulling the real credential from AWS Secrets Manager at runtime, meaning the database password no longer sits anywhere as a static, unrotatable value inside a Kubernetes manifest, and picks up rotation support for free if it's ever enabled on the Secrets Manager side.

Phase 13: tearing it all down, correctly

Cleanup isn't just "delete everything", order matters. CloudFront first (disabled, then deleted, only once fully stopped deploying), then the Ingress (letting the Load Balancer Controller remove the actual ALB itself, rather than deleting it directly and leaving the controller confused about a resource it thinks should still exist), then Helm releases, PVCs, the node group, the Fargate profile, the cluster, the OIDC provider, and finally RDS and the NAT Gateway. Midway through the actual project, I did a smaller-scale version of this teardown for a different reason entirely: EKS control plane has no stop/pause option, it's delete-or-nothing, so stopping overnight billing meant a real, full cluster deletion and rebuild the next day, while RDS (which does support up to a 7-day stop) was paused instead, preserving all its data and sidestepping most of the rebuild work. Rebuilding EKS after that meant a brand new OIDC provider ID, which meant updating both CSI drivers' trust policies to match, a real, if minor, cost of choosing manual infrastructure over something more declarative.

Bonus: making a taint actually repel a pod, on purpose

One exercise after the fact, specifically to see a Kubernetes concept work rather than just read about it: a second, Spot-instance node group, tainted  spot=true:NoSchedule  at creation. A test pod carrying the matching toleration landed on it correctly. A second, otherwise identical pod without the toleration landed on the original, untainted node group instead, never on the Spot nodes, confirming the taint's repelling effect directly rather than trusting the documentation's description of it.

What actually held up, and what I'd tell someone starting this

Every bug across Phases 0–8 resolved quickly once I stopped guessing and started reading the actual error message, log line, or  describe  output in full, no exception. The pattern holds constantly in infrastructure work: the fix is usually fast; finding the real cause is the entire task.
A few things worth carrying into any similar build:
  • A disposable pod is a legitimate debugging tool, not a workaround.  kubectl run --rm -it  reaching a private-only resource in one command, no lasting side effects.
  • IRSA is conceptually simple and operationally fragile. Trust the actual trust-policy JSON over what a console dropdown claims is selected, and remember credentials are injected at pod creation time, an annotation fix doesn't retroactively help pods that already exist.
  • A working app and a healthy infrastructure signal are separate claims. Verify both independently.
  • Read the release notes on what's "included by default." EKS add-ons, metrics-server, and cross-region certificate requirements all have quiet defaults that only announce themselves once you hit the edge they define.

Closing thought

Building this by hand, all thirteen phases, plus the bonus round, took considerably longer than a single  eksctl create cluster  command ever would have. That was the entire point. Every layer above is one I can now actually explain, including the parts that broke, which turned out to be the parts I understood best by the end.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article