ExamGecko
Question list
Search
Search

Question 34 - 5V0-23.20 discussion

Report
Export

Which kubectl command is used to list al pods in the current active namespace?

A.
kubectl get nodes
Answers
A.
kubectl get nodes
B.
kubectl get pods
Answers
B.
kubectl get pods
C.
kubectl get services
Answers
C.
kubectl get services
D.
kubectl list pods
Answers
D.
kubectl list pods
Suggested answer: B

Explanation:

Fetch all Pods in all namespaces using kubectl get pods --all-namespaces

Pods

Shortcode = po

List one or more pods

kubectl get pod

Delete a pod

kubectl delete pod <pod_name>

Display the detailed state of a pods

kubectl describe pod <pod_name>

Create a pod

kubectl create pod <pod_name>

Execute a command against a container in a pod

kubectl exec <pod_name> -c <container_name> <command>

Get interactive shell on a a single-container pod

kubectl exec -it <pod_name> /bin/sh

Display Resource usage (CPU/Memory/Storage) for pods

kubectl top pod

Add or update the annotations of a pod

kubectl annotate pod <pod_name> <annotation>

Add or update the label of a pod

kubectl label pod <pod_name>

asked 16/09/2024
Carolina Velayos
49 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first