Command

Kubernetes Filter Pods by Label Command

The Kubernetes command to filter pods by label is kubectl get pods --selector=app=cassandra.

Quick Answer

Command
kubectl get pods --selector=app=cassandra
KubernetesCommand

Filter Pods by Label

Type this command
kubectl get pods --selector=app=cassandra

Lists pods carrying a matching label.

Learn More

How to filter pods by label in Kubernetes

  1. Open the terminal or command interface for Kubernetes.
  2. Type kubectl get pods --selector=app=cassandra, replace any placeholders, and run it.

Kubernetes Filter Pods by Label Command

Run kubectl get pods --selector=app=cassandra.

Related Commands

Frequently asked questions

What is the Kubernetes command to filter pods by label?

Run kubectl get pods --selector=app=cassandra.

Where do I type this Kubernetes command?

Type it in the terminal or command-line interface used by Kubernetes.

Does this Kubernetes command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify