首页 > 其他分享> > |NO.Z.00172|——————————|CloudNative|——|KuberNetes&配置管理.V03|------------------------------------------
|NO.Z.00172|——————————|CloudNative|——|KuberNetes&配置管理.V03|------------------------------------------
作者:互联网
[CloudNative:KuberNetes&配置管理.V03] [Applications.KuberNetes][|DevOps|k8s|配置管理|k8s配置管理ConfigMap|]
一、从文件值创建configmap
### --- 根据文件值创建configmap
~~~ 可以将kubectl create configmap其与--from-literal参数一起使用,
~~~ 以从命令行定义文字值
[root@k8s-master01 configmap]# kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type=charm
configmap/special-config created
### --- 查看创建的special-config.yaml配置文件
[root@k8s-master01 configmap]# kubectl get cm special-config -oyaml
apiVersion: v1
data:
special.how: very
special.type: charm
kind: ConfigMap
metadata:
creationTimestamp: "2021-04-24T10:24:11Z"
managedFields:
- apiVersion: v1
manager: kubectl-create
operation: Update
time: "2021-04-24T10:24:11Z"
name: special-config
namespace: default
resourceVersion: "643220"
uid: 70931d23-acd6-41df-806d-b9902db94e33
===============================END===============================
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart ——W.S.Landor
来自为知笔记(Wiz)
标签:configmap,KuberNetes,kubectl,配置管理,k8s,config,special 来源: https://www.cnblogs.com/yanqivip/p/16076576.html