I am trying to delete a configmap from a k8s namespace .. i created the configmap using the command below
kubectl -n namespacename create -f configmap.yaml
checking the k8s cheat sheet https://kubernetes.io/docs/reference/kubectl/cheatsheet/ i didn't find anything related .. kindly advise how to do that ?
Method to edit ConfigMaps in Kubernetes using kubectlYou can alter the file as per your work needs.
Where Are Kubernetes ConfigMaps Stored? Kubernetes stores API objects like ConfigMaps and Secrets within the etcd cluster.
You can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the kubectl delete command, and specify the StatefulSet either by file or by name. You may need to delete the associated headless service separately after the StatefulSet itself is deleted.
First, confirm the name of the node you want to remove using kubectl get nodes , and make sure that all of the pods on the node can be safely terminated without any special procedures. Next, use the kubectl drain command to evict all user pods from the node.
configmap
using configmap name:# kubectl delete configmap <configmap-name> -n <namespace-name>
$ kubectl delete configmap my-cofigmap -n namespacename
configmap
using configmap yaml file:# kubectl delete -f <file-directory> -n <namespace-name>
$ kubectl delete -f configmap.yaml -n namespacename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With