Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete key from configmap in Kubernetes

Is there a nice way to delete a specific key from a Kubernetes configmap, using kubectl?

Right now I run:

$ kubectl edit configmap myconfigmap

and then I delete the entry but I would like a solution that can be run as a script.

like image 332
rvabdn Avatar asked Sep 13 '18 20:09

rvabdn


1 Answers

This works but I wonder if there is a simpler way

$ kubectl patch configmap myconfigmap --type=json -p='[{"op": "remove", "path": "/data/mykey"}]'
like image 193
rvabdn Avatar answered Nov 18 '22 07:11

rvabdn