Search code examples
kuberneteskubectl

Kubectl get pods - How to filter pods by partial name


The command kubectl get pods <POD NAME> will return the specific pod with that name. I wonder if there is a way that I can use part of the name, for instance, a command that returns all pods that start with j.


Solution

  • In Linux Bash:

    kubectl get pods | grep ^j
    

    In Windows PowerShell:

    kubectl get pods | Select-String '^j'