Kubernetes Container Orchestration Cloud Native Patterns 3 — Questions and Answers
Question 1: What does the 'Health Endpoint Monitoring' pattern require an application to expose?
- Prometheus metrics at /metrics
- An HTTP endpoint that returns the application's current health status (Correct answer)
- A gRPC stream of heartbeat signals
- A log file accessible via a sidecar container
Correct answer: An HTTP endpoint that returns the application's current health status
The Health Endpoint Monitoring pattern requires services to expose a dedicated HTTP endpoint (like /healthz) that external systems can poll to check health.
Question 2: In Kubernetes, which probe type implements the 'Readiness' aspect of the Health Endpoint Monitoring pattern?
- livenessProbe
- startupProbe
- readinessProbe (Correct answer)
- healthProbe
Correct answer: readinessProbe
The readinessProbe tells Kubernetes when a container is ready to accept traffic, removing it from Service endpoints when it fails.
Question 3: The 'Retry' pattern with exponential backoff in a cloud native system is designed to handle:
- Permanent failures that require human intervention
- Transient faults that may resolve on their own after a short wait (Correct answer)
- Resource quota exhaustion in a namespace
- DNS resolution failures in service discovery
Correct answer: Transient faults that may resolve on their own after a short wait
The Retry pattern with exponential backoff handles transient faults by retrying failed operations with increasing delays between attempts.
Question 4: Which cloud native pattern prevents a service from repeatedly calling a failing dependency, allowing it time to recover?
- Retry
- Bulkhead
- Circuit Breaker (Correct answer)
- Throttling
Correct answer: Circuit Breaker
The Circuit Breaker pattern stops forwarding requests to a failing service after a threshold is exceeded, giving it time to recover before trying again.
Question 5: In Kubernetes, how is the 'Leader Election' pattern typically implemented for controllers?
- By using a StatefulSet with ordinal index 0 as the leader
- Via a Lease object in the coordination.k8s.io API group (Correct answer)
- Through a ConfigMap annotation updated by the active pod
- Using a headless Service that only resolves to the leader pod
Correct answer: Via a Lease object in the coordination.k8s.io API group
Kubernetes controllers use the Lease API (coordination.k8s.io/v1) to perform leader election, ensuring only one replica acts as the active controller.
Question 6: What problem does the 'Valet Key' pattern solve in cloud native applications?
- Securing inter-service mTLS certificate rotation
- Granting clients limited, time-bound direct access to storage resources without routing through the app (Correct answer)
- Managing Kubernetes ServiceAccount token expiration
- Encrypting secrets stored in etcd at rest
Correct answer: Granting clients limited, time-bound direct access to storage resources without routing through the app
The Valet Key pattern issues clients a token (like a presigned URL) that grants temporary, scoped direct access to a resource, reducing app server load.
Question 7: Which pattern describes decomposing a monolith by extracting bounded contexts into independent, separately deployable Kubernetes services?
- CQRS
- Saga
- Domain-Driven Decomposition (Correct answer)
- Event Sourcing
Correct answer: Domain-Driven Decomposition
Domain-Driven Decomposition uses bounded contexts from Domain-Driven Design to identify natural service boundaries when breaking apart a monolith.
What does the 'Health Endpoint Monitoring' pattern require an application to expose?