Site icon Exam4Training

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

Which kubectl command is used to list al pods in the current active namespace?
A . kubectl get nodes
B. kubectl get pods
C. kubectl get services
D. kubectl list pods

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>

Latest 5V0-23.20 Dumps Valid Version with 62 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Exit mobile version