配置管理-kubernates的配置管理使用方式 、 config-map/ secret
配置管理-kubernates的配置管理使用方式 、 config-map/ secret
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586258025049.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586258028341.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586258036123.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586258039753.png)
配置实例
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586260501576.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586260504512.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586260507799.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586260510624.png)
单个key值引用,要获取的key的value是configmap中的。
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586260999995.png)
enter description here
![enter description here enter description here](./images/1586261001882.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586261004854.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586261008929.png)
整体引用
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586266250389.png)
enter description here
用作volume
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586266880865.png)
enter description here
用作volume的key挂载和subpath挂载..略
secret
Secret 不管是在格式上还是使用上都与 ConfigMap 非常类似。其共同点有:以 map 作为数据存储结构
可以以类似方式挂载到 env 和 volume 中
区别则主要是二者应用场景的不同:ConfigMap 适合存储普通的配置信息,Secret 适合存储敏感的信息,比如 password、token 等。关于在 env 注入以及 volume 挂载上因为与 configmap 相似,所以不再介绍。着重介绍 Secret 自己的一些独特的属性。
secret