CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
  • Week 1
    • 1.DevOps as an Operating Model: The Five Axes of CALMS and the Truth DORA Proved Through Measurement
    • 2.Well-Architected Framework: Rereading It Through the Six Lenses of DevOps
    • 3.The AWS DevOps Tool Map: The Code* Series and the Real Picture Beyond It
    • 4.Multi-Account Strategy: The Real Picture of Organizations, Control Tower, and IAM Identity Center
    • 5.Week 1 Wrap-Up: Cementing the DevOps Thinking Frame with Scenarios
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
  • Week 13
  • Week 14
  • Week 15
    • 1.Multi-Account Enterprise CI/CD: Governance and Platform Engineering Principles for 50+ Accounts
    • 2.Hybrid CI/CD: Bridging On-Premises and AWS into One Deployment Model
    • 3.Large-Scale ECS/EKS Operations: Scheduling, GitOps, Cost Principles for 100+ Microservices
    • 4.Serverless Large-Scale Incident Auto-Response: Recovery Without People, Safety Rails
    • 5.Week 15 Wrap-Up: The Art of Reading Clues Across Cases and Judging Trade-offs
  • Week 16
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← DOP-C02/Week 15/Day 3

Based on the DOP-C02 exam guide·Report an error

DOP-C02· ProWeek 15 · Day 3~34 min read

Day 3 - Large-Scale ECS/EKS Operations: Scheduling, GitOps, Cost Principles for 100+ Microservices

When container platforms grow from a dozen services to over a hundred, operational weight shifts. No longer "how do we run a container?" but "how do we consistently, cheaply, safely run hundreds?" Three pains strike simultaneously. Scheduling (when traffic surges, how fast and what instance type do we spin?), drift (who deployed what and does actual state match intent?), cost (peak-capacity nodes sit idle at night). Today: realistic org with 100+ microservices, 100k peak RPS, Seoul·Tokyo Active-Active, "20% cost cut YoY" pressure. Karpenter·GitOps·Pod Identity·Container Insights·Graviton/Spot solve all three, grounded in scheduling theory and declarative-system thinking.

In DOP exams: "spin diverse instances in seconds not minutes", "rollback manifest with one git revert", "give pod IAM without OIDC setup", "cut container costs 30-40%." Each hinges on Karpenter·GitOps·Pod Identity·Graviton/Spot understanding.

ECS Fargate vs EKS — Choosing Abstraction Level

Platform choice is fundamentally "how much operational burden to AWS, how much control to keep?" trade-off.

Workload traitChoiceWhy
Simple web/batch, minimal opsECS FargateNode-free, serverless containers
Custom scheduler, rich Service Mesh, ecosystemEKSKubernetes standard, strong control
Cost-sensitive large long-runningEKS + Karpenter + SpotFine-grained node cost optimization
Very short jobsLambda or FargatePer-invocation billing, zero idle cost

This org uses hybrid — meticulous control for billing (EKS), simple general (70%) on Fargate.

💡 Related theory: This choice is cost of abstraction. Fargate abstracts nodes, eliminating operational burden, but forfeits node-level optimization (instance pick, Spot fine control, kernel tuning). EKS hands all control, but levies ops tax (control plane upgrade, CNI, addons, node mgmt). "Abstraction costs — trade control for convenience." Mature orgs vary abstraction by workload: critical few get low abstraction (EKS+node control), many others get high (Fargate). One-tool-fits-all is anti-pattern.

Karpenter — Rethinking Scheduling

EKS's classic Cluster Autoscaler (CA) relies on ASG. Pods pending? CA bumps ASG desired capacity; ASG spins pre-defined instance types. Problems: (1) ASG middle layer = slow (minutes), (2) instance type locked in ASG = inflexible.

Karpenter (AWS open-source 2021) flips this. Bypass ASG; examine pending pods' real resource needs; call EC2 API directly to spin nodes. Real-time bin-packing (which instance mix fits and cheapest), dynamic mix of On-Demand·Spot·Graviton.

TraitCluster AutoscalerKarpenter
Node groupASG requiredEC2 direct, no ASG
SpeedMinutesSeconds
Instance choicePre-fixed (ASG)Dynamic (pod-need based)
Spot handlingPossibleMore flexible (interruptibility)
Empty node cleanupSlowAggressive consolidation

🔍 Deeper: Karpenter's core is bin-packing optimization. Classic CS NP-hard — "pack varied-size objects into min bins." Karpenter watches pending pods' CPU/memory/GPU, solves "what instance combo best fits and cheapest?" as a heuristic. Consolidation further: as time passes, defragment scattered nodes — if pod-set on two half-full nodes fits one, consolidate and kill the empty node (memory compaction analogy). CA is scalar control (resize ASG up/down); Karpenter is combinatorial (which node types, how many, where). Exam: "fast scale + varied instances + Spot flex" → Karpenter.

Combined with Pod Disruption Budget (limit concurrent pod kills) and Topology Spread Constraints (spread pods evenly across AZs/nodes) for resilience during Spot interruptions.

GitOps — Cluster State = Git Single Truth

100 services deploying via kubectl apply loses change history and drifts goal state. GitOps inverts this: Git repo is cluster goal state single truth. Agent (Argo CD/Flux) continuously reconciles cluster to that state.

GitHub (App Repo)            GitHub (Manifests Repo)
      │                              │
      │ CodePipeline/Actions         │ Argo CD watch + reconcile
      ▼                              ▼
  Build → Image to ECR ─► Manifest Image Tag bump ─► EKS auto-reflect

Core: build ≠ deploy. App build (CodePipeline/Actions) → image to ECR. Deployment is separate manifest repo; Argo reconciles. Rollback: one git revert — manifest back to prior commit, Argo auto-reverts cluster.

💡 Related theory: GitOps applies closed-loop control (feedback control) from control theory to deployment. Kubernetes core is reconciliation loop — "observe state, desired state, compute error, apply actions to converge error to zero." GitOps pulls desired state source up to Git. This is declarative vs imperative essence. Imperative ("kubectl apply", manual scripts) is humans managing procedure. Declarative ("this is what it should be") is system managing convergence. Result: (1) Git is audit log (who, when, what via PR), (2) drift auto-corrects (Argo reverts manual changes), (3) rollback is git revert.

ECS Fargate Deployment — Blue/Green + IaC

ECS Fargate's 70% uses different orchestration. Traffic shift is CodeDeploy Blue/Green + ALB Listener — new Task set (Green), ALB gradually shifts traffic, once safe, tear down Blue. Task Definition is CDK IaC'd, parameterized per environment; inter-service talk via App Mesh or lighter ECS Service Connect.

⚠️ Gotcha: ECS deployment controller types confuse easily. Default is Rolling Update (ECS native) — incrementally replace old Tasks. Simple but weak rollback and traffic shift. Blue/Green is CodeDeploy controller (deployment-controller type=CODE_DEPLOY), needs ALB's two Target Groups (Blue/Green) and Listener. Exam: "ECS Canary/Linear shift + fast rollback" → CodeDeploy Blue/Green, not Rolling.

Pod Identity — IRSA's Successor Standard

EKS pods calling AWS APIs (e.g., billing pod → DynamoDB) need pod-level IAM credentials. Long standard was IRSA (IAM Roles for Service Accounts) — cluster gets OIDC Provider, ServiceAccount annotated with IAM Role, pod assumes via OIDC token.

Problem: OIDC setup complexity per cluster, accumulated burden. EKS Pod Identity (2023) simplifies — no OIDC setup, just Pod Identity Agent add-on, direct create-pod-identity-association wiring namespace·ServiceAccount·Role.

aws eks create-pod-identity-association \
  --cluster-name prod \
  --namespace billing --service-account svc-billing \
  --role-arn arn:aws:iam::ACCT:role/BillingPodRole

💡 Related theory: IRSA → Pod Identity reflects credential ephemeral-ization + simplification, cloud identity's consistent direction (Roles Anywhere yesterday). IRSA is federation power but ops-heavy, per-cluster OIDC Provider in Role trust policy scales poorly. Pod Identity abstracts federation behind AWS-managed layer, same Role across many clusters (trust policy just pods.eks.amazonaws.com). Essence: "static node creds (all pods share) → pod-level ephemeral creds" granularity gain, Pod Identity achieves ops-free.

Container Observability — Three-Piece Suite

Hundreds of containers need consistent metric/log/trace collection. Standard trio:

  • Container Insights: ECS/EKS cluster/node/pod/task metrics auto-collected to CloudWatch.
  • ADOT Collector (AWS Distro for OpenTelemetry): DaemonSet-deployed, metrics/traces to CloudWatch·Managed Prometheus. OpenTelemetry standard → vendor-neutral.
  • FireLens (Fluent Bit): Sidecar container logs simultaneous fan-out (CloudWatch, Kinesis, S3, OpenSearch, etc.).

🔍 Deeper: This trio is observability's three pillars — metrics·logs·traces. Evolved from 1990s SNMP → 2010s Google Dapper (tracing)·Prometheus (metrics)·Twitter Zipkin → 2019 OpenTelemetry (unified SDK+wire format). ADOT uses OpenTelemetry standard — same instrumentation code, any backend (CloudWatch, Prometheus, Datadog, Grafana). FireLens uses Fluent Bit (lightweight) for fan-out routing (needed; metrics to different destinations for different purposes). "Metrics = what + how much, Logs = what event, Traces = where slow."

Cost Optimization — Graviton·Spot Are Core Levers

"20% cut" pressure: single highest lever is compute unit cost.

ItemActionEffect
NodesKarpenter + Spot + Graviton30-40% ↓ compute
Unused podsVPA right-sizingRemove over-allocation
Idle clustersNightly shrink (EventBridge→Lambda)Non-prod savings
ECR image pileLifecycle Policy auto-deleteStorage ↓
Fargate SpotNon-critical workloadsFargate unit↓
VisibilityKubecost / Cost CategoriesAccountability

💡 Related theory: Graviton (AWS ARM64) cost-power win flows from ISA philosophy. ARM is RISC (Reduced Instruction Set) — simple uniform instructions, high transistor-per-watt efficiency. Originally mobile (battery life), translates datacenter to per-watt performance and cost. AWS designs in-house (2018 Graviton1 → 2020 Graviton2 → 3·4), margin cut, price drop. 30-40% gain roots here. Gotcha: ARM64 ≠ x86 binary-compatible, multi-arch image build (docker buildx) needed; some native deps might not have ARM support. Spot is different — AWS spare capacity rented 90% off, 2min eviction notice. Pair with PDB·Topology Spread·Karpenter interruption handling for safety.

🎯 Scenario: "100+ microservices, peak 100k RPS, 20% YoY cut. Billing: precise control needed; general: simple. Want: ①seconds-scale diverse instance spin + Spot ②git revert rollback ③new EKS, pod IAM no OIDC ④compute 30%+ cut." → ① EKS Karpenter + Spot/Graviton/On-Demand mix (billing: On-Demand keep), PDB·Topology Spread. ② Manifest repo + Argo CD, rollback = git revert. ③ EKS Pod Identity. ④ Graviton arm64 nodes + Spot + Fargate Spot (non-critical), VPA right-size, ECR Lifecycle. General 70% = ECS Fargate + CodeDeploy Blue/Green. Observability = Container Insights + ADOT + FireLens.

Summary

Today covered five. First, ECS Fargate vs EKS is abstraction trade-off, hybrid per-workload is mature. Second, Karpenter = no ASG + EC2 direct + bin-packing + consolidation = seconds scale, diverse instances, dynamic. Third, GitOps = Git single truth + closed-loop reconcile = drift auto-fix + git revert rollback (build/deploy split). Fourth, Pod Identity = IRSA post-standard, ECS Blue/Green = CodeDeploy controller. Fifth, Container Insights·ADOT·FireLens = observability trio (metrics/logs/traces, OpenTelemetry standard), Graviton + Spot = 30-40% cost cut (RISC efficiency, spare capacity hire).

Next: system running well; when it breaks, serverless incident auto-response at scale.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

In EKS, how can you respond to traffic swings in seconds rather than minutes, dynamically launch a variety of instances matching pod requirements instead of fixed types in an ASG, and use Spot flexibly?

Question 2

Which statement MOST accurately describes the core operating principle of GitOps (Argo CD/Flux)?

Question 3

In a new EKS cluster, what is the currently recommended standard for granting per-pod IAM credentials without setting up an OIDC Provider?

Question 4

How can you perform a Blue/Green deployment on ECS Fargate that requires Canary/Linear traffic shifting and immediate rollback?

Question 5

How can you route container logs simultaneously to multiple destinations such as CloudWatch, Kinesis, S3, and OpenSearch (fan-out)?

Question 6

Under pressure to "cut costs 20% year over year," what is the single best action to reduce container compute costs by 30-40%, and what is its pitfall?

Question 7

What is the fundamental reason that choosing ECS Fargate and EKS differently per workload (a mix) is better than covering everything with a single tool?

📌 Today's Summary

There are five key takeaways today. First, ECS Fargate vs EKS is a choice of level of abstraction (convenience vs control), and a per-workload mix is a mature pattern. Second, Karpenter achieves second-level response, dynamic instance selection, and flexible Spot use by launching EC2 directly without an ASG, with bin-packing optimization and consolidation. Third, GitOps is closed-loop control (reconciliation) with Git as the single source of truth, providing automatic drift correction and git revert rollback while separating build and deployment. Fourth, EKS Pod Identity is the successor standard for identity simplification that removes IRSA's OIDC setup burden, and ECS Blue/Green requires the CodeDeploy controller. Fifth, Container Insights, ADOT, and FireLens are the three pillars of observability (metrics, logs, traces; the OpenTelemetry standard), and Graviton (RISC power efficiency) + Spot is the key lever for a 30-40% cost reduction (watch out for buildx and PDBs).

PreviousHybrid CI/CD: Bridging On-Premises and AWS into One Deployment ModelWeek 15 · Day 2Next Serverless Large-Scale Incident Auto-Response: Recovery Without People, Safety RailsWeek 15 · Day 4

Official references

  • DOP-C02 official exam page(opens in a new tab)
  • Amazon ECS · Fargate documentation(opens in a new tab)
  • Amazon EKS documentation(opens in a new tab)
  • Amazon EC2 Auto Scaling documentation(opens in a new tab)
  • AWS IAM documentation(opens in a new tab)
  • AWS CodeDeploy documentation(opens in a new tab)

On this page

  • ECS Fargate vs EKS — Choosing Abstraction Level
  • Karpenter — Rethinking Scheduling
  • GitOps — Cluster State = Git Single Truth
  • ECS Fargate Deployment — Blue/Green + IaC
  • Pod Identity — IRSA's Successor Standard
  • Container Observability — Three-Piece Suite
  • Cost Optimization — Graviton·Spot Are Core Levers
  • Summary
  • Practice Questions
  • Today's Summary