How to list all deployments using given ConfigMap in Kubernetes cluster

Viewed 52

Is there an easy way to query for all deployments that use given ConfigMap as valueFrom: configMapKeyRef.

I need to know which deployments use my config map in order to be able to restart them after the config map changes.

I'm looking for something like:

kubectl get deployments --with-config-map my-config-map

1 Answers

There is no way to do it as easily as you want. However you can still get the data you want in one command by using jsonpath as the output of your kubectl command.

Related