ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 212 - Associate Cloud Engineer discussion

Report
Export

You created a Kubernetes deployment by running kubectl run nginx image=nginx labels=app=prod. Your Kubernetes cluster is also used by a number of other deployments. How can you find the identifier of the pods for this nginx deployment?

A.
kubectl get deployments --output=pods
Answers
A.
kubectl get deployments --output=pods
B.
gcloud get pods --selector=''app=prod''
Answers
B.
gcloud get pods --selector=''app=prod''
C.
kubectl get pods -I ''app=prod''
Answers
C.
kubectl get pods -I ''app=prod''
D.
gcloud list gke-deployments -filter={pod }
Answers
D.
gcloud list gke-deployments -filter={pod }
Suggested answer: C

Explanation:

This command correctly lists pods that have the label app=prod. When creating the deployment, we used the label app=prod so listing pods that have this label retrieve the pods belonging to nginx deployments. You can list pods by using Kubernetes CLI kubectl get pods.

Ref:https://kubernetes.io/docs/tasks/access-application-cluster/list-all-running-container-images/

Ref:https://kubernetes.io/docs/tasks/access-application-cluster/list-all-running-container-images/#list-containers-filtering-by-pod-label

asked 18/09/2024
Marcelo Oliveira
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first