Google Professional Cloud DevOps Engineer Question 254
Select 3Google Cloud PlatformYour team has deployed a new microservices-based application on Google Kubernetes Engine (GKE). Users are reporting intermittent connectivity issues with one of the services. Upon investigation, you notice that the pod hosting the service is being repeatedly restarted. What steps should you take to troubleshoot and resolve the issue?
- A
Check the pod logs using
kubectl logsto identify any errors or stack traces causing the restarts. - B
Verify the pod's resource limits and requests in its configuration to determine if it is running out of memory or CPU.
- C
Manually scale up the number of pods for the service to handle increased traffic.
- D
Inspect the events for the pod using
kubectl describe podto check for issues such as liveness or readiness probe failures. - E
Delete the pod and let the GKE cluster automatically recreate it to resolve the issue.
Show answer and explanation
Correct answers: A, B, D
Explanation
To troubleshoot and resolve pod restarts in GKE, you need to gather relevant information about the issue. Checking logs, verifying resource allocations, and inspecting pod events are standard practices for diagnosing problems. Scaling or deleting pods may provide temporary relief but do not address the underlying cause, making them unsuitable as primary troubleshooting steps.
- A. Correct.
Checking the pod logs using
kubectl logsis a critical step to identify the root cause of the pod restarts. Logs can reveal application-level errors or misconfigurations. - B. Correct.
Verifying resource limits and requests is essential because resource exhaustion (e.g., CPU or memory) can lead to pod evictions or restarts. This step ensures proper resource allocation.
- C. Incorrect.
Manually scaling up the number of pods does not address the root cause of the issue. Intermittent connectivity issues and pod restarts must first be resolved before considering scaling.
- D. Correct.
Inspecting the pod events using
kubectl describe podhelps identify issues like health check failures, which can trigger restarts. This step is important for diagnosing the problem. - E. Incorrect.
Deleting the pod and letting it recreate may temporarily resolve the issue, but it does not address the root cause. The problem may persist unless diagnosed and fixed properly.