tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Container Management > Kubernetes > How to delete Kubernetes ConfigMap

How to delete Kubernetes ConfigMap

Author: Venkata Sudhakar

The below example shows how to delete a Kubernetes ConfigMap.

01$ kubectl get configmaps example-configmap -o yaml
02apiVersion: v1
03data:
04  connection.url: jdbc:mysql://localhost:3306/bethecoder
05  database: mysql
06  keys: "aws.access.key=AAAAAAAAAA \naws.secret.key=BBBBBBBBBB\n"
07  username: abcd
08kind: ConfigMap
09metadata:
10  annotations:
11    kubectl.kubernetes.io/last-applied-configuration: |
12      {"apiVersion":"v1","data":{"connection.url":"jdbc:mysql://localhost:3306/bethecoder","database":"mysql","keys":"aws.access.key=AAAAAAAAAA \naws.secret.key=BBBBBBBBBB\n","username":"abcd"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"example-configmap","namespace":"default"}}
13  creationTimestamp: "2021-03-06T20:46:54Z"
14  name: example-configmap
15  namespace: default
16  resourceVersion: "2378"
17  selfLink: /api/v1/namespaces/default/configmaps/example-configmap
18  uid: c354a51b-b4ca-4d3c-83b7-a62bdecb99b8
19 
20$ kubectl get configmaps example-configmap
21NAME                DATA   AGE
22example-configmap   4      7m18s
23 
24$ kubectl delete configmap example-configmap
25configmap "example-configmap" deleted
26 
27$ kubectl get configmaps example-configmap
28Error from server (NotFound): configmaps "example-configmap" not found

 
  


  
bl  br