Kubernetes Container Orchestration Cloud Native Patterns 2 — Questions and Answers
Question 1: Which cloud native pattern involves running a secondary container alongside the main container to provide supporting functionality like logging or monitoring?
- Ambassador
- Sidecar (Correct answer)
- Adapter
- Init Container
Correct answer: Sidecar
The Sidecar pattern attaches a helper container to the main application container within the same Pod, sharing its network and storage.
Question 2: In the Ambassador pattern, what is the primary role of the ambassador container?
- Logging application output to external systems
- Proxying network traffic on behalf of the main container (Correct answer)
- Transforming data formats between services
- Running initialization scripts before the main app starts
Correct answer: Proxying network traffic on behalf of the main container
The Ambassador container acts as a proxy, handling outbound connections from the main container to external services.
Question 3: Which pattern is used when multiple heterogeneous services need to present a unified interface to a consumer?
- Sidecar
- Strangler Fig
- Adapter (Correct answer)
- Circuit Breaker
Correct answer: Adapter
The Adapter pattern normalizes the output of different containers into a standard interface that consumers can uniformly interact with.
Question 4: The Strangler Fig pattern in cloud native migration is best described as:
- Rewriting the entire legacy application at once before deploying
- Incrementally replacing legacy functionality with new services while keeping the old system running (Correct answer)
- Strangling resource usage by limiting container CPU and memory
- Running multiple versions of a service simultaneously for A/B testing
Correct answer: Incrementally replacing legacy functionality with new services while keeping the old system running
The Strangler Fig pattern gradually migrates a legacy system by routing new functionality to new services while the old system continues to operate.
Question 5: In a cloud native architecture, what does the 'bulkhead' pattern primarily protect against?
- Unauthorized access to container registries
- Cascading failures by isolating resource pools between services (Correct answer)
- Data corruption in persistent volumes
- Network latency between microservices
Correct answer: Cascading failures by isolating resource pools between services
The Bulkhead pattern isolates elements into pools so that if one fails, the others continue to function, preventing cascading failures.
Question 6: Which Kubernetes resource is most aligned with implementing the 'Queue-Based Load Leveling' cloud native pattern?
- HorizontalPodAutoscaler
- Job with parallelism (Correct answer)
- PodDisruptionBudget
- LimitRange
Correct answer: Job with parallelism
A Kubernetes Job with parallelism settings processes items from a queue, leveling the load by controlling how many workers run concurrently.
Question 7: What is the primary benefit of the 'Competing Consumers' pattern in Kubernetes?
- Ensuring only one pod processes each message exactly once
- Scaling processing throughput by having multiple pods consume from a shared queue (Correct answer)
- Prioritizing high-value messages over low-value ones
- Preventing duplicate message delivery across services
Correct answer: Scaling processing throughput by having multiple pods consume from a shared queue
Competing Consumers allows multiple pod replicas to pull from the same queue simultaneously, increasing throughput and resilience.
Which cloud native pattern involves running a secondary container alongside the main container to provide supporting functionality like logging or monitoring?