Update k8s ConfigMap or Secret without deleting the existing one

后端 未结 5 945
梦如初夏
梦如初夏 2020-12-07 11:39

I\'ve been using K8S ConfigMap and Secret to manage our properties. My design is pretty simple, that keeps properties files in a git repo and use build server such as Though

5条回答
  •  心在旅途
    2020-12-07 12:04

    You can get YAML from the kubectl create configmap command and pipe it to kubectl replace, like this:

    kubectl create configmap foo --from-file foo.properties -o yaml --dry-run | kubectl replace -f -
    

提交回复
热议问题