Google Professional Cloud Developer Question 295
Select 3Google Cloud PlatformYour team has implemented a microservices architecture on Google Kubernetes Engine (GKE). To ensure the resilience of your system, you want to conduct chaos engineering by simulating pod failures and verifying that your system can recover automatically. Which of the following approaches would be most effective for implementing failure testing in this environment?
- A
Use a chaos engineering tool like Chaos Monkey or LitmusChaos to randomly terminate pods in your cluster and observe system behavior.
- B
Manually delete pods using the
kubectl delete podcommand to test how the system reacts to failures. - C
Implement a readiness probe and liveness probe for each microservice, ensuring failed pods are automatically restarted by Kubernetes.
- D
Disable auto-scaling in the cluster to observe the effects of high traffic and failure scenarios without additional resources being added.
- E
Simulate a network partition between services using a chaos engineering tool to test system behavior under degraded network conditions.
Show answer and explanation
Correct answers: A, C, E
Explanation
Chaos engineering is about proactively testing system resilience by introducing controlled failure scenarios. Using tools like Chaos Monkey or LitmusChaos (Option 1) allows for automated and repeatable tests. Readiness and liveness probes (Option 3) ensure Kubernetes can manage pod health effectively, which is critical during simulated failures. Simulating network partitions (Option 5) tests your system's ability to handle degraded communication, a common failure scenario in distributed systems. Manual interventions (Option 2) and disabling auto-scaling (Option 4) are less effective or unrelated to the core goals of chaos engineering.
- A. Correct.
This is a correct approach. Tools like Chaos Monkey or LitmusChaos are designed for chaos engineering and can automate failure scenarios such as pod terminations, allowing you to test system resilience under realistic conditions.
- B. Incorrect.
While manually deleting pods can simulate failure, it is not scalable or repeatable for comprehensive chaos engineering tests, making it less effective compared to automated tools.
- C. Correct.
This is a correct approach. Readiness and liveness probes are critical in failure testing as they ensure Kubernetes can detect and manage unhealthy pods, restarting them when necessary.
- D. Incorrect.
Disabling auto-scaling is not a recommended approach for chaos engineering. It does not directly test failure recovery mechanisms and can introduce other issues unrelated to resilience testing.
- E. Correct.
This is a correct approach. Simulating network partitions is a key aspect of chaos engineering that helps identify how services handle degraded network conditions or connectivity failures.