Case studies

kubernetes

An EKS cluster for tens of thousands of pods, upgraded without downtime

We built an Amazon EKS cluster where Karpenter matches EC2 nodes to the load and data lives on EFS and S3. We run tens of thousands of pods on hundreds of nodes there and upgrade the cluster regularly without interrupting the applications.

Illustration: a Kubernetes cluster as a honeycomb of nodes with pods

20 000+

Pods at peak load

200+

Nodes managed by Karpenter

Multi-AZ

Cluster and data across availability zones

From this case study you will learn

  • where to run Karpenter so it does not depend on the nodes it manages
  • where to keep shared data and where to keep objects and backups
  • how to scale to tens of thousands of pods without adding nodes by hand
  • how to upgrade Kubernetes without interrupting the applications

The client needed an environment for applications that run around the clock and have to cope with large swings in load. Losing one AWS availability zone could not stop the services, and upgrades could not require maintenance windows. We designed, built and now operate an Amazon EKS cluster that meets those conditions.

Requirements

The application is made of many services with different CPU and memory needs. Some of them share files, others write large numbers of objects. Load rises and falls during the day, so a fixed number of servers would mean either overpaying or running out of capacity at the peak.

We agreed on four conditions: running across several availability zones, automatic scaling, durable data independent of pods, and upgrades without downtime.

Architecture

Diagram: an EKS cluster across three zones, Karpenter EC2 nodes, the controller on Fargate, EFS and S3
Applications run on EC2 nodes launched by Karpenter, and the Karpenter controller runs on Fargate. Shared data is on EFS, objects and backups in S3.

The cluster runs across several availability zones in one region. All applications run on EC2 nodes managed by Karpenter. Karpenter does not manage Fargate, so Fargate has one job here: it runs the Karpenter controller itself. The controller runs outside the nodes it replaces and shuts down, so changes to those nodes do not stop it.

Karpenter picks the instance type and size to match pod requirements, and a load balancer takes internet traffic and spreads it across all zones.

Data on EFS and S3

Files used at the same time by many pods in different zones live on Amazon EFS. A pod can move to another node or another zone and still see the same data.

Objects, exports and backups go to Amazon S3. Lifecycle rules move older data to cheaper storage classes. Only the services that need data have access to it.

Scaling with Karpenter

Dashboard: pods and nodes over 24 hours
The node count follows the pod count: it grows at the peak and drops when traffic falls. Illustrative view.

Karpenter watches pods waiting for resources and launches nodes that fit them. When load drops, it packs pods onto fewer nodes and shuts down the rest. At the peak the cluster runs tens of thousands of pods on hundreds of nodes.

Pods are spread across zones, and Pod Disruption Budgets make sure the required number of replicas of each service keeps running while nodes are replaced.

Upgrades without downtime

Kubernetes ships new versions several times a year. A version that leaves standard EKS support moves to paid Extended Support, so we upgrade the cluster regularly.

Before every upgrade we check that applications do not use deprecated APIs and test the change in a staging environment. Then we upgrade the control plane, the cluster add-ons and the nodes. Karpenter replaces nodes gradually, and disruption budgets keep the applications running.

Business continuity

The cluster, nodes, pods and data are monitored with alerts. We see pods waiting for resources, application errors and the state of every zone. The client does not add servers by hand or plan maintenance windows, and the infrastructure grows with the traffic. We build similar environments as part of our Cloud service.

Write to us
Other

Other case studies

A media CDN for Magento: private S3 and CloudFront without moving the shop

A Magento shop with several domains kept product images, manuals and editor files on the application disk. The disk grew to hundreds of gigabytes and blocked scaling. We moved pub/media to a private S3 bucket and served media through CloudFront. The shop itself stayed on its existing server.

The S3 bill dropped from $20,000 to $1,500 a month

The client was overpaying for AWS: data in an expensive S3 class, oversized instances, an EKS cluster on paid Extended Support and data transfers for partners at its own cost. We went through the bill line by line, removed the causes and set up a daily cost view in Grafana.

A Magento shop lost its server together with its only backup

A large Magento shop served around one million customers. Backups ran every day, but they were written to the same server as the shop. When access to the server was lost, the shop and every backup became unavailable at the same time. We describe how we restored the shop and how backups now work in two independent places.

A 1 TB copy and a restore that took several days

The copy was 1 TB. After an outage the team restored the whole disk, while the service only needed a few files to run. Transfer, verification and bringing the machine up took several days. In this case study we describe how we split a start restore from the full image, so the service returns to traffic without waiting for the whole set.

A production database in a container without a persistent volume

The production database ran in a container. A restart, a node drain or a new image left an empty data directory. The application came up. The data did not. In this case study we show why database state cannot live in the image writable layer, and how we arranged a volume, a copy and a restore exercise.

AWS without a landing zone and without cost control

The AWS account grew without a landing zone, without a list of instance types and without a cost trail during the week. The bill arrived only with the invoice, at the end of the month. In this case study we describe how daily reports, threshold alerts and instance-type order went in, and what that did to the bill.