Member-only story
Kubernetes kgpo command
5 min readOct 30, 2024
When you run the command kgpo --show-labels
, you're using an alias for kubectl get pods --show-labels
. This command will list all the Pods in the current namespace along with their associated labels.
Here’s a breakdown of what this command does:
kgpo
: This is an alias forkubectl get pods
. It displays all the Pods in the current namespace.--show-labels
: This flag adds an additional column to the output, showing the labels assigned to each Pod.
Example Output:
NAME READY STATUS RESTARTS AGE LABELS
nginx-deployment-abc12 1/1 Running 0 5m app=nginx,tier=frontend
nginx-deployment-def34 1/1 Running 0 5m app=nginx,tier=frontend
redis-pod-xyz56 1/1 Running 0 8m app=redis,tier=backend
In this example:
NAME
: The name of each Pod.READY
: Indicates the readiness of containers within the Pod.STATUS
: The current status of the Pod (e.g., Running, Pending, etc.).RESTARTS
: The number of times the containers in the Pod have restarted.AGE
: How long the Pod has been running.LABELS
: This column lists all the labels associated with each…