From 4e617db7b573f207698e3d10ccc2907271e900de Mon Sep 17 00:00:00 2001 From: chestack Date: Mon, 19 Nov 2018 17:45:46 +0800 Subject: [PATCH] Fix yaml file and bash command add known issue about ConfigMap updates --- concepts/configmap-hot-update.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/concepts/configmap-hot-update.md b/concepts/configmap-hot-update.md index 599570d9f..fdede09ac 100644 --- a/concepts/configmap-hot-update.md +++ b/concepts/configmap-hot-update.md @@ -320,9 +320,9 @@ spec: image: harbor-001.jimmysong.io/library/nginx:1.9 ports: - containerPort: 80 - volumeMounts: - - name: config-volume - mountPath: /etc/config + volumeMounts: + - name: config-volume + mountPath: /etc/config volumes: - name: config-volume configMap: @@ -338,7 +338,7 @@ data: ``` ```bash -$ kubectl exec `kubectl get pods -l run=my-nginx -o=name|cut -d "/" -f2` cat /tmp/log_level +$ kubectl exec `kubectl get pods -l run=my-nginx -o=name|cut -d "/" -f2` cat /etc/config/log_level INFO ``` @@ -359,6 +359,10 @@ DEBUG 我们可以看到使用 ConfigMap 方式挂载的 Volume 的文件中的内容已经变成了 `DEBUG`。 +Known Issue: +如果使用ConfigMap的**subPath**挂载为Container的Volume,Kubernetes不会做自动热更新: +https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#mounted-configmaps-are-updated-automatically + ## ConfigMap 更新后滚动更新 Pod 更新 ConfigMap 目前并不会触发相关 Pod 的滚动更新,可以通过修改 pod annotations 的方式强制触发滚动更新。