Google Cloud Certified Associate Cloud Engineer Practice

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the Google Cloud Certified Associate Cloud Engineer Exam with flashcards and multiple choice questions. Each question includes hints and explanations to help you study effectively. Get ready to pass your certification exam!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


You've seen some errors in the logs for a specific Deployment. Your engineers have identified the Pod named "ad-generator" as the source of the errors. What steps should be taken to run commands against the container of the pod?

  1. Use the kubectl exec -it ad-generator -- /bin/bash command to run a shell on that container.

  2. Use the kubectl exec -it -- /bin/bash command to run a shell on that container.

  3. Use the kubectl run command to run a shell on that container.

  4. Use the kubectl run ad-generator /bin/bash command to run a shell on that container.

The correct answer is: Use the kubectl exec -it ad-generator -- /bin/bash command to run a shell on that container.

The command "kubectl exec -it <pod-name> -- /bin/bash" allows you to run a shell on a specific container within a pod. In this case, the pod name is "ad-generator", which was identified as the source of the errors. Therefore, using this command will give you access to the container of the "ad-generator" pod and you can run commands to troubleshoot and fix the errors. Option B is incorrect because it is missing the pod name that needs to be specified after the "exec -it" command. Without the pod name, the command will not know which pod to access and run commands on. Option C is incorrect because the "kubectl run" command is used to create a new deployment, not to access and run commands on an existing deployment or pod. Option D is incorrect because it is missing the "--" before "/bin/bash", which is necessary for the command to know that the arguments following it are meant for the container that it is accessing. Without this, the command will not know what to do.