how to list the Kubernetes pod which has CharDevice in it ?
I could able to get the pod with CharDevice, but need to print the pod name only
kubectl get pod -o jsonpath='{spec.volumes.hostPath.type=="CharDevice"}'
You can get json first and use jq
to get desired result :
kubectl get pod -o json |
jq -r '.items[]|select(any(.spec.volumes[];.hostPath.type=="CharDevice")).metadata.name'