Member-only story

Kubernetes kgpo command

Luca Berton
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 for kubectl 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…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet