Kubernetes Container Orchestration Cloud Native Patterns 5 — Questions and Answers
Question 1: Which cloud native pattern describes deploying a new version alongside the old version and gradually shifting traffic from old to new?
- Blue-Green Deployment
- Canary Release (Correct answer)
- Rolling Update
- Recreate Strategy
Correct answer: Canary Release
A Canary Release routes a small percentage of traffic to the new version first, allowing validation before full rollout.
Question 2: In a Blue-Green deployment on Kubernetes, how is traffic switched from the old (blue) version to the new (green) version?
- By scaling down the blue Deployment and scaling up the green Deployment
- By updating the Service selector to point to the green Deployment's pods (Correct answer)
- By changing the Ingress weight annotations to route 100% to green
- By deleting blue pods so Kubernetes reschedules them on new nodes running green
Correct answer: By updating the Service selector to point to the green Deployment's pods
Switching the Kubernetes Service's label selector from blue pods to green pods instantly redirects all traffic to the new version.
Question 3: What Kubernetes feature enables the 'Anti-Affinity' cloud native pattern to improve resilience?
- PodDisruptionBudgets that limit simultaneous evictions
- podAntiAffinity rules that spread replicas across nodes or zones (Correct answer)
- TopologySpreadConstraints replacing legacy zone labels
- NodeSelector requiring pods to avoid tainted nodes
Correct answer: podAntiAffinity rules that spread replicas across nodes or zones
podAntiAffinity rules instruct the scheduler to place pod replicas on different nodes or zones, preventing a single failure from taking down all replicas.
Question 4: The 'Twelve-Factor App' methodology's 'Config' factor states that configuration should be stored in:
- Hardcoded constants within the application source code
- Environment variables injected at runtime, not in the codebase (Correct answer)
- Version-controlled YAML files committed alongside application code
- A centralized database table read at application startup
Correct answer: Environment variables injected at runtime, not in the codebase
Factor III of the Twelve-Factor App requires config to be separated from code and injected via environment variables, enabling the same build to run in any environment.
Question 5: Which cloud native pattern ensures that an operation produces the same result whether applied once or multiple times?
- Idempotency (Correct answer)
- Immutability
- Compensating Transaction
- At-Least-Once Delivery
Correct answer: Idempotency
Idempotency guarantees that repeating the same operation has no additional effect beyond the first application, which is critical for safe retries in distributed systems.
Question 6: In cloud native architecture, the 'Backends for Frontends' (BFF) pattern addresses which problem?
- Routing backend database queries through a frontend proxy for security
- Creating separate backend APIs tailored to the specific needs of each client type (web, mobile) (Correct answer)
- Offloading static asset serving from backend services to a CDN
- Caching backend API responses in the browser's service worker
Correct answer: Creating separate backend APIs tailored to the specific needs of each client type (web, mobile)
The BFF pattern creates a dedicated backend for each frontend client (e.g., mobile BFF, web BFF), letting each be optimized for its client's specific data needs.
Question 7: Which pattern should be used when you need to aggregate data from multiple microservices into a single response for a client?
- Sidecar
- API Gateway with aggregation / API Composition (Correct answer)
- Adapter
- Bulkhead
Correct answer: API Gateway with aggregation / API Composition
API Composition (often implemented in an API Gateway) calls multiple downstream services and merges their results into a single response for the client.
Which cloud native pattern describes deploying a new version alongside the old version and gradually shifting traffic from old to new?