本文作者:丁辉
挂载Configmap配置文件
解决Kubernetes ConfigMap挂载导致容器目录覆盖的问题
- 创建 Configmap - 1 - kubectl create configmap demo-config --from-file=./config.js 
- 编辑 POD 容器 - 1 
 2
 3
 4
 5
 6
 7
 8- volumeMounts: 
 - name: file
 mountPath: /opt/config.js #挂载到容器内的路径
 subPath: config.js #目录内其他内容不会被清理掉
 volumes:
 - name: file
 configMap:
 name: demo-config
I'm so cute. Please give me money.
- 本文链接: https://blog.offends.cn/Kubernetes/使用文档/挂载Configmap配置文件.html
- 版权声明: 本博客所有文章除特别声明外,均默认采用 CC BY-NC-SA 4.0 许可协议。
 
    
    
         
    
    
    
     
                     
                    