Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to patch configmap in json file with kustomize?

How to patch "db.password" in the following cm with kustomize?

comfigmap:

apiVersion: v1
data:
  dbp.conf: |-
    {
      "db_properties": {
        "db.driver": "com.mysql.jdbc.Driver",
        "db.password": "123456",
        "db.user": "root"
      }
    }

kind: ConfigMap
metadata:
  labels: {}
  name: dbcm
like image 607
Lior Avatar asked Nov 12 '19 03:11

Lior


1 Answers

you can create new file with updated values and use command replace along wih create

kubectl create configmap NAME --from-file file.name -o yaml --dry-run | kubectl replace -f -
like image 89
Harsh Manvar Avatar answered Oct 19 '22 21:10

Harsh Manvar