File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff 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
342342INFO
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 的方式强制触发滚动更新。
You can’t perform that action at this time.
0 commit comments