Reading Mode
CH 14·Lesson 9
Phase 9 — Docker, Kubernetes & AWS — Checkpoint Answer Guide
This is a grading guide, not a script to memorize. Equivalent designs earn credit when their assumptions and evidence are correct.
advanced9 min read
Learning Objectives
- Docker
- Kubernetes Fundamentals
- Kubernetes Advanced
- AWS Deep Dive
- CAPSTONE: CI/CD + Full Observability
This is a grading guide, not a script to memorize. Equivalent designs earn credit when their assumptions and evidence are correct.
Docker
- Dockerfile & multi-stage builds: A Dockerfile creates immutable image layers; a multi-stage build copies only required artifacts into the runtime image. A strong answer also explains that each instruction produces cache metadata and usually a filesystem layer. ENTRYPOINT defines the executable contract; CMD supplies defaults. A container starts one process in isolated namespaces and cgroups. The main warning is: Alpine is not automatically smaller after native build dependencies and may introduce musl compatibility issues.
- Docker Compose: Compose declares a local multi-container application, its networks, volumes, configuration, and health dependencies. A strong answer also explains that service names become DNS records on a Compose network. Named volumes outlive containers; bind mounts expose host paths. Health-aware dependency ordering does not guarantee application migrations are complete. The main warning is:
depends_onis not a distributed readiness protocol. - Networking, storage & sizing: Docker network drivers choose a container's connectivity model: bridge provides host-local virtual networking, host shares the host stack, none removes normal networking, overlay spans compatible nodes, and macvlan gives link-layer identities. A strong answer also explains that docker creates namespaces, virtual interfaces, routes, DNS/service records, and firewall/NAT rules according to the driver. Published ports forward from a host interface; container ports alone do not publish externally. The main warning is: Host networking removes port namespace isolation, overlay adds control-plane requirements, and publishing databases on all interfaces can expose them beyond the project.
Kubernetes Fundamentals
- Core workload objects: Kubernetes workload objects declare pod templates and lifecycle guarantees; controllers create or replace Pods until observed state matches the specification. A strong answer also explains that deployments manage ReplicaSets and rolling updates; DaemonSets target nodes; StatefulSets provide ordered identities and volume claims. Readiness gates traffic; liveness restarts a stuck container. The main warning is: A liveness probe that depends on a downstream database can restart every healthy pod during a database outage.
- Services, ConfigMaps & Secrets: Services provide stable virtual addressing over changing Pods; ConfigMaps and Secrets inject environment-independent configuration. A strong answer also explains that endpointSlices track ready backends and kube-proxy or dataplane rules route traffic. Secret values are encoded, not necessarily encrypted, unless cluster storage encryption is configured. The main warning is: Environment variables do not update in running processes and base64 is not encryption.
- kubectl essentials: kubectl submits declarative objects and exposes read-only and imperative debugging operations against the API server. A strong answer also explains that apply performs a patch based on field ownership; rollout history references controller revisions; logs and exec target a particular container and pod instance. The main warning is: Manual edits drift from Git and disappear during reconciliation.
- Namespaces & policy: A Kubernetes Namespace scopes names and many policies/RBAC rules, but it is not by itself a strong security, network, resource, or node-isolation boundary. A strong answer also explains that namespaced API objects share cluster control plane and often nodes. ResourceQuota, LimitRange, NetworkPolicy, RBAC, admission policy, and workload identity add separate controls; some resources remain cluster-scoped. The main warning is: Assuming a namespace blocks network traffic or privileged workloads allows cross-namespace access through shared cluster facilities.
Kubernetes Advanced
- Ingress, HPA & KEDA: Ingress and certificate controllers expose routed TLS traffic, while HPA and KEDA reconcile replica count from resource, custom, or event-pressure metrics and PDB limits voluntary disruption. A strong answer also explains that controllers observe objects and metrics, calculate desired replicas, and update workload state; KEDA activates or scales from sources such as Kafka lag or queue depth; a PDB constrains eviction rather than guaranteeing capacity. The main warning is: Kafka lag here is a scaling signal, not the SQL LAG window function; autoscaling cannot repair an exhausted database.
- Helm charts: A Helm chart packages parameterized Kubernetes manifests, release metadata, validation, hooks, and upgrade or rollback operations. A strong answer also explains that go templates render chart files with supplied values; Helm submits the resulting objects and stores release revisions; lifecycle hooks can run separately ordered Jobs such as backward-compatible database migrations. The main warning is: A Helm migration hook is not a Django migration explanation, and rolling manifests back cannot undo arbitrary data changes.
- RBAC & PersistentVolumes: Kubernetes RBAC authorizes API operations for users or ServiceAccounts, while PV, PVC, StorageClass, and access modes define durable storage provisioning and attachment contracts. A strong answer also explains that the API server evaluates Role or ClusterRole bindings; ServiceAccount tokens identify workloads; claims bind to volumes statically or through a provisioner and retain lifecycle according to reclaim policy. The main warning is: Kubernetes RBAC is not JWT application authorization, and deleting a claim can delete data under some reclaim policies.
- Storage & pod security details: Persistent-volume access modes describe supported node/pod attachment patterns, not ordinary filesystem read/write permissions inside a mounted volume. A strong answer also explains that the CSI driver and scheduler use requested modes during binding and attachment. RWO allows read-write mounting from one node, RWOP narrows to one pod where supported, while ROX/RWX require storage capable of those patterns. The main warning is: RWO can still permit several pods on the same node, and requesting RWX from unsupported block storage leaves claims pending.
AWS Deep Dive
- Core services: AWS core design combines identity policies, routed network segments, compute, object storage, and managed relational databases. A strong answer also explains that a route table selects a target, security groups filter statefully, IAM evaluates identity/resource policies and explicit denies, S3 authorizes each request, and RDS separates primary availability from read scaling. The main warning is: A public subnet is defined by routing, not by its name; a read replica is not the same as a synchronous standby.
- Serverless: Context distributes a value through a subtree; useReducer centralizes deterministic state transitions. A strong answer also explains that provider value identity causes consuming components to render; a reducer receives current state and an action and must return the next state without mutation. The main warning is: One giant frequently changing context causes broad re-renders.
- SQS, SNS & data services: Queues buffer work, topics fan out notifications, and access-pattern databases require keys designed before code. A strong answer also explains that sQS hides a received message for the visibility interval until deletion; SNS copies a publish to subscriptions; DynamoDB hashes partition keys and maintains secondary indexes asynchronously with base writes. The main warning is: FIFO ordering is per message group and does not remove duplicate-delivery handling.
- Cognito & Step Functions: Token authentication proves possession of a signed credential; authorization separately decides whether that identity may perform an action. A strong answer also explains that a server validates signature, issuer, audience, expiry, and claims. Short-lived access tokens limit exposure; rotating refresh tokens require server-side reuse detection or revocation state. The main warning is: Decoding is not validation, and a valid token does not grant every resource.
- Additional backend services: AWS security groups are stateful allow rules attached to elastic network interfaces, while network ACLs are stateless ordered allow-and-deny rules applied at subnet boundaries. A strong answer also explains that return traffic is automatically recognized by a security group's connection state; a network ACL evaluates inbound and outbound traffic separately in rule-number order, including ephemeral ports. The main warning is: The letters ACL in NACL do not make this a Kafka ACL, and a permissive outbound or ephemeral-port rule can invalidate an apparently restrictive design.
CAPSTONE: CI/CD + Full Observability
- GitHub Actions pipeline: A GitHub Actions pipeline turns a commit into reproducibly tested artifacts and controlled deployments through an explicit job dependency graph. A strong answer also explains that isolated runners execute lint, type checking, tests, scans, image builds, registry pushes, and deployment jobs; matrices expand supported versions; caches reuse verified inputs; secrets are injected only into authorized steps. The main warning is: Coverage is one gate rather than the definition of CI/CD, and GitHub secrets are not Kubernetes Secret objects.
- Observability: Prometheus + Grafana: Metrics aggregate numeric behavior; Prometheus scrapes labeled time series, Grafana visualizes them, and Alertmanager groups and routes actionable conditions. A strong answer also explains that counters increase, gauges move in either direction, and histograms bucket observations for aggregatable quantiles. Labels multiply series cardinality. The main warning is: User IDs, URLs, and trace IDs as metric labels can exhaust memory.
- Distributed tracing & logging: Logging emits structured, leveled operational events to one or more destinations. A strong answer also explains that a logger creates a record; filters and handlers decide routing; formatters serialize it. Correlation identifiers connect events belonging to one request or workflow. The main warning is: Do not use logs as the only audit store or interpolate expensive messages before level checks.
- Nginx production config: A production Nginx edge terminates TLS, proxies and load-balances traffic, upgrades WebSockets, applies shared rate limits, compresses suitable responses, and emits defense-in-depth headers. A strong answer also explains that location matching selects an upstream; proxy buffers and timeouts shape backpressure; shared-memory zones coordinate rate counters across workers; forwarded headers preserve client and scheme data only when trusted proxies are configured correctly. The main warning is: Gzip here is an edge response feature rather than application middleware; compressing secrets beside attacker-controlled text can introduce side channels.
Professional standard
A complete response identifies the boundary, guarantee, state owner, lifecycle, failure, and proof. Award less credit to answers that name tools without explaining why their guarantees fit the requirement.
Mastery check
How well can you recall this?
Finished this lesson?