TwiceToldby Develoker
ConceptsSystem designLabsCheat sheetsAbout

Develoker makes free tools for learning to build software. TwiceTold explains each idea twice, as an everyday analogy and the real thing; CloudArch lets you design cloud systems and put load on them.

About ยท Labs ยท Cheat sheets ยท Learning paths

โ† Back to Amazon ECS, Fargate and EKS

๐Ÿš› Amazon ECS, Fargate and EKS: cheat sheet

๐ŸŽจ The analogyA port with working berths for containers: bring your own lorries or rent one by the trip.
๐ŸŽ“ The regular explanationRunning containers on AWS. ECS schedules tasks from versioned task definitions and keeps services at their desired count behind a load balancer, EKS runs a managed Kubernetes control plane, and both run on EC2 instances you manage or on Fargate, which bills per task for the CPU and memory it asks for.
From image to running taskStep 5 of 5
Loading sheetsr1key orders:1 (image 1.4, 0.5 vCPU, 1 GB): r1012๐Ÿง‘You๐Ÿฌ Container depotorders:1.4๐Ÿ‘ทYard foreman๐Ÿ“ฆLoad 1working
  1. You leave your packed orders box at the port's container depot, where it waits until someone needs it.
  2. You write loading sheet number 1. It says which box to take, how much room and power it gets, and which door pass it may use.
  3. You ask the yard foreman to start one load. The foreman reads sheet 1 first.
  4. The foreman picks a lorry, and the box is fetched from the depot and set down on it.
  5. The doors open and the workshop gets to work. The foreman notes that load 1 is running.
A service keeps the desired countStep 4 of 4
โš“ Loads on duty๐Ÿ‘ฅCustomers๐Ÿ›‚Gate desk๐Ÿ‘ทYard foremanrunning 3 of 3๐Ÿ“ฆLoad 1๐Ÿ“ฆLoad 3๐Ÿ“ฆLoad 4
  1. The standing order says keep 3 loads working. Customers come through the gate, and the gate desk sends each one to a load.
  2. Load 2 breaks down. When the gate desk checks on it, there's no answer, so it stops sending customers there.
  3. The foreman sees only 2 of the 3 loads working, so it closes load 2 and starts load 4 from the same sheet.
  4. The gate desk checks load 4 answers properly, then sends it customers. Three loads are working again.
A rolling deploymentStep 5 of 5
Loading sheetsr1key orders:1: r10r2key orders:2 (image 1.5): r212๐Ÿ‘ทYard foreman2 on sheet 2๐Ÿ›‚Gate desk๐Ÿ“ฆNew load 1healthy๐Ÿ“ฆNew load 2healthy
  1. Two loads from sheet 1 are working. You write sheet 2 and tell the foreman the standing order now uses it.
  2. The yard may hold up to 4 loads, so the foreman sets down 2 new loads beside the old ones. Customers still go to the old loads.
  3. The gate desk checks that both new loads answer properly before sending them any customers.
  4. Customers now go to the new loads. The old loads finish serving the people already inside, then close.
  5. The foreman drives the old loads away. Two loads from sheet 2 are working, and the workshop never closed.
Capacity on EC2 or FargateStep 4 of 4
๐Ÿš› Your own lorry2.5 vCPU idle, paid๐Ÿšš Rented lorry๐Ÿ‘ทYard foremanC done, no charge๐Ÿ“ฆLoad A๐Ÿ“ฆLoad B๐Ÿ“ฆLoad Dpay for 1 vCPU
  1. On your own lorry, the foreman fits loads A and B side by side. You keep the lorry fuelled and repaired.
  2. Half the lorry is empty, but it's your lorry, so you pay for all of it the whole time.
  3. With rented lorries, you just say each load's size. The port brings a lorry that size for load C, and another for load D.
  4. Load C finishes its job, and the port takes its lorry away. You stop paying for it at once.
Execution role and task roleStep 5 of 5
๐Ÿง‘โ€๐Ÿ”งPort porterpass: depot + logs๐Ÿฌ Container depot๐Ÿ“ฆOrders loadpass: warehouse๐Ÿญ Warehouse๐Ÿ—„๏ธ Records officedenied
  1. The porter shows the porter's pass at the depot and fetches your box.
  2. The porter starts the load. The loading sheet names the load's own pass, which says it may open the warehouse.
  3. The workshop asks the porter for today's copy of its pass. The copy runs out after a while, and fresh ones are handed out.
  4. The workshop shows its pass at the warehouse and drops off a receipt. The pass allows it, so in it goes.
  5. It tries the records office too. Its pass doesn't name that door, so it's turned away.
EKS runs the Kubernetes control planeStep 4 of 4
โš“ Run by the port๐Ÿš› Your lorry fleet๐Ÿšš Rented lorry๐Ÿง‘โ€๐Ÿ”งYour crew๐Ÿ›๏ธRule officehourly fee๐Ÿ“ฆLoad 1๐Ÿ“ฆLoad 2๐Ÿ“ฆReport loadone load per lorry
  1. Your crew fills in the standard form they'd use at any port that runs this system, and hands it to the rule office the port runs for you.
  2. The rule office puts the two loads on lorries from your own fleet, which the port helps you keep in shape.
  3. A one-off report load matches the rented-lorry rule, so the port brings a lorry just for it.
  4. Your crew checks on everything with the same tools they use at any other port.

๐Ÿงฉ Key questions

The standing order says keep 3 loads working, and one load breaks down. What happens?
The gate desk stops sending it customers, and the foreman starts a fresh load from the same sheet. The foreman always tops back up to the number on the standing order.
You rent lorries by the trip. What are you paying for?
The room and power each load asked for, for as long as it works. A rented lorry is sized to its load and leaves when the load is done.
Your orders workshop needs to drop receipts at the warehouse. Where should that permission go?
On the load's own pass, which says which doors the workshop may open. The porter's pass is only for the port's own jobs, and a hidden key works forever for anyone who finds it.
During a swap to sheet 2, the yard must keep at least 2 working loads and hold at most 4. When are the old loads closed?
After the new loads are set down and answer the gate desk's checks. Keeping at least 2 working means the new loads must be ready before any old one closes.
Your crew already uses the standard international yard system at other ports and wants the same forms here. Which should you pick?
The standard system the port runs for you, with your own fleet or rented lorries. The port's own rules are simpler, but they use their own sheets, not the standard forms.