Medium1 markMultiple Choice
Domain 4.2: Managing GKE resourcesGKETroubleshootingkubectl

GCP ACE · Question 33 · Domain 4.2: Managing GKE resources

You deployed a new container to your GKE cluster, but the application is not responding. You run kubectl get pods and see that the Pod status is 'CrashLoopBackOff'.

What is the MOST appropriate next command to diagnose why the container is crashing?

Answer options:

A.

kubectl describe pod [POD_NAME]

B.

kubectl logs [POD_NAME]

C.

kubectl exec -it [POD_NAME] -- /bin/bash

D.

gcloud container clusters describe [CLUSTER_NAME]

How to approach this question

Identify the kubectl command used to view application standard output.

Full Answer

B.kubectl logs [POD_NAME]✓ Correct
kubectl logs [POD_NAME]
When a Pod is in `CrashLoopBackOff`, it means the container starts, crashes, and Kubernetes restarts it. To find out *why* the application code is crashing, you need to view the application's standard output and standard error using `kubectl logs`.

Common mistakes

Trying to `kubectl exec` into a crashing pod. The shell will immediately disconnect when the container crashes.

Practice the full GCP Associate Cloud Engineer Practice Exam 2

50 questions · hints · full answers · grading

More questions from this exam