from above suppose there is configmap file i want to put value namespace in data checkpod.json which is in json part through command line without enter into yaml file,is there any way to do it
We don’t have K8s command to do it but you can use commands like sed to search and replace values on the file. Let’s say your ConfigMap is on a file named myConfig.yml.
So you can just try the following command :
sed 's/"namespace":.*/"namespace":"kube-system"/g' myConfig.yml > myConfig.yml
or
sed 's/""/"kube-system"/g' myConfig.yml > myConfig.yml