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.
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.
Found it. in PS:
kubectl get pods | Select-String '^j'
in bash:
kubectl get pods | grep ^j
Filter without grep (unfortunately requires full name):
kubectl get pods --field-selector metadata.name=<your_pod_name>
this works for me. Of course you have to precise the namespace if not set in the current-context