Skip to content

purpose

help me find out all configmap in the cluster that contain a specific string. i just need to know where the string is located, later i i will manually change it

where will the script be ran

a linux vm with kube config properly set up

implementation spec

  • it should take a cli arg as the specific string to search for
  • it should use something like kubectl get cm -n $namespace -o jsonpath={.data} and then use grep to find whether the string exists
  • generate a output file that clearly lists out the namespace, name of configmap where the string exists
  • have good logging and error handling