Files
kuboard-press/learning/k8s-intermediate/config-map.md
huanqing.shao 0937daa97a 推荐
2019-08-29 08:16:08 +08:00

41 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
description: Kubernetes ConfigMap 可以将配置信息和容器镜像解耦,以使得容器化的应用程序可移植。本文提供了一系列的实例,解释如何通过 Kuboard 创建 ConfigMap 以及如何使用 ConfigMap 中的数据配置 Pod容器组
---
# 使用 ConfigMap 配置您的应用程序
本文参考了 Kubernetes 官网 [Configure a Pod to Use a ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap),并有所改写
Kubernetes ConfigMap 可以将配置信息和容器镜像解耦,以使得容器化的应用程序可移植。本文提供了一系列的实例,解释如何通过 Kuboard 创建 ConfigMap 以及如何使用 ConfigMap 中的数据配置 Pod容器组
## 前提条件
您已经安装了 Kubernetes 集群,并且已经在集群中安装了 Kuboard如果尚未安装请参考
* [安装 Kubernetes 单Master节点](/install/install-k8s.html)
* [安装 Kuboard](/install/install-dashboard.html)
## 创建 ConfigMap
::: tip 提示
Kubernetes 官网描述了多种 ConfigMap 的创建方法,本文不再复述,请自行参考文档 [Configure a Pod to Use a ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap)
:::
* 打开 Kuboard 界面,并点击进入您想要创建 ConfigMap 的 **名称空间**
如下图所示:
![image-20190829060842558](./config-map.assets/image-20190829060842558.png)
* 点击 **配置** --> **创建** 按钮
并填写表单,如下图所示:
![image-20190829061750251](./config-map.assets/image-20190829061750251.png)
* 点击 **保存**
ConfigMap 创建成功
*