Problems / Kubernetes and containers, easy

Pods with nowhere to run

The autoscaler may run up to 30 pods, but the cluster has 2 nodes and no node autoscaling. A pod requests 1 vCPU and 1 GB. Traffic climbs steadily to 4× over four minutes.

Unlock it once for 10 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.

Your goals

Keep success at 99% or more as traffic climbs.

Test cases

Like a coding problem, a solution has to pass every case, not just the one it was built for. Submit in the lab runs all 4; 1 of them are hidden until then.

  1. As given. The problem’s own traffic, scheduled failures and seed.
  2. Peak hour. 25% more traffic than the problem states, with the same failures.
  3. A slow dependency. The main data store or model answers twice as slowly for part of the run.

The traffic

100 requests a second, ramping to 4× for 240 seconds: 100% api (reads).

The system

What each component does in this design, and what calls it. The simulator mimics each one from these settings.

ComponentIts job hereSettings
Load balancerLoad balancerTraffic enters here.Calls API (pods).Layer 4 balancers route by IP and port; layer 7 balancers read HTTP and can route by path or header.–
API (pods)Container platformLoad balancer forwards to it.Calls Postgres.Kubernetes places pods on nodes by their CPU and memory requests, and only replaces a lost node's pods after about 5 minutes.20 slots
PostgresSQL databaseAPI (pods) calls it.Postgres runs one process per connection, which is why poolers like PgBouncer sit in front of busy databases.32 vCPU · 300 connections

More kubernetes and containers problems