Medium1 markMultiple Choice
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?
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
Q01Your company is migrating to Google Cloud and needs to establish a resource hierarchy. You have t...EasyQ02You are managing access to a GCP project. You need to grant 15 developers the ability to view Com...MediumQ03You have created a new GCP project using the Cloud Console. You want to deploy a Cloud Function u...EasyQ04Your startup has a strict monthly cloud budget of $500. You want to be notified immediately if yo...EasyQ05Your finance team wants to perform complex SQL analysis on your GCP billing data to understand co...Medium
Expert