Again, from my ever-generous colleague: -
Get all the pods that are using specific configmap. Change the configmap name according to your requirement in @.spec.volumes[*].configMap.name=="test-config"
which worked for me using the coredns configMap.
First I queried for configMaps on my cluster: -
kubectl get configmaps -A
NAMESPACE NAME DATA AGE
default kube-root-ca.crt 1 57d
kube-node-lease kube-root-ca.crt 1 57d
kube-public cluster-info 1 57d
kube-public kube-root-ca.crt 1 57d
kube-system calico-config 4 57d
kube-system coredns 1 57d
kube-system extension-apiserver-authentication 6 57d
kube-system kube-proxy 2 57d
kube-system kube-root-ca.crt 1 57d
kube-system kubeadm-config 2 57d
kube-system kubelet-config-1.21 1 57d
and then for Pods using that particular configMap: -
kubectl get pods --all-namespaces -o jsonpath='{range $.items[?(@.spec.volumes[*].configMap.name=="coredns")]}{.metadata.name}{"\t"}{.spec.volumes[*].configMap.name}{"\n"}{end}'
coredns-558bd4d5db-dmnnccoredns
coredns-558bd4d5db-t8xnmcoredns
Note that I'm including --all-namespaces to catch all Pods, especially as I'm not running much in the default namespace.
Two bits of additional insight from the K8s documentation: -