Skip to main content

k8s | See Pods | Basic

An article on a simple k8s to see pods using kubectl.

Updated 1 min readMarkdown
Part of seriesDevOps

TL;DR

Sometimes during diagnosing the issues in the deployment in various pods might result in failure, at that point of time we need to triage the cause. This small article shows some basic commands to get started with pods.

# List pods in the current namespace, with status, restarts, and age
kubectl get pods

# List pods in all namespaces
kubectl get pods -A

# List pods in a specific namespace
kubectl get pods -n <ns>

# Add node name and pod IP
kubectl get pods -o wide

# Watch for changes live
kubectl get pods -w

# Filter by label
kubectl get pods -l app=web

# Show each pod鈥檚 labels
kubectl get pods --show-labels

These are very basic commands nothing too complex or advanced just added to write my understanding of my k8s pods learnings.

Thanks for reading till here ! 馃檹

5 views

馃憤