How to patch a ConfigMap in Kubernetes

后端 未结 4 1079
北海茫月
北海茫月 2021-01-01 23:34

Kubernetes ships with a ConfigMap called coredns that lets you specify DNS settings. I want to modify or patch a small piece of this configuration

4条回答
  •  执笔经年
    2021-01-02 00:21

    This will apply the same patch to that single field:

    kubectl patch configmap/coredns \
      -n kube-system \
      --type merge \
      -p '{"data":{"upstreamNameservers":"[\"1.1.1.1\", \"1.0.0.1\"]"}}'
    

提交回复
热议问题