Sometimes you may need to retrieve pods with
kubectl using an attribute that isn't available as a label or filter, such as an annotation. You can due this by getting all pods and filtering using
1kubectl get pods --chunk-size=0 -o json | \2 jq -r '.items | select(.metadata.annotations.myAnnotation == "myValue") | .metadata.name'
Now you have a list of all of the pod names that have
Note that if you have thousands and thousands of pods, this isn't going to be the fastest thing in the world, but it is still going to work.