Skip to content

Commit 5d46f49

Browse files
authored
Merge pull request #312 from chestack/master
Fix yaml file and bash command
2 parents deca627 + 4e617db commit 5d46f49

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

concepts/configmap-hot-update.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,9 @@ spec:
320320
image: harbor-001.jimmysong.io/library/nginx:1.9
321321
ports:
322322
- containerPort: 80
323-
volumeMounts:
324-
- name: config-volume
325-
mountPath: /etc/config
323+
volumeMounts:
324+
- name: config-volume
325+
mountPath: /etc/config
326326
volumes:
327327
- name: config-volume
328328
configMap:
@@ -338,7 +338,7 @@ data:
338338
```
339339
340340
```bash
341-
$ kubectl exec `kubectl get pods -l run=my-nginx -o=name|cut -d "/" -f2` cat /tmp/log_level
341+
$ kubectl exec `kubectl get pods -l run=my-nginx -o=name|cut -d "/" -f2` cat /etc/config/log_level
342342
INFO
343343
```
344344
@@ -359,6 +359,10 @@ DEBUG
359359
360360
我们可以看到使用 ConfigMap 方式挂载的 Volume 的文件中的内容已经变成了 `DEBUG`
361361
362+
Known Issue:
363+
如果使用ConfigMap的**subPath**挂载为Container的Volume,Kubernetes不会做自动热更新:
364+
https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#mounted-configmaps-are-updated-automatically
365+
362366
## ConfigMap 更新后滚动更新 Pod
363367
364368
更新 ConfigMap 目前并不会触发相关 Pod 的滚动更新,可以通过修改 pod annotations 的方式强制触发滚动更新。

0 commit comments

Comments
 (0)