|NO.Z.00172|——————————|CloudNative|——|KuberNetes&配置管理.V03|——|configmap.v03|从文件值创建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
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
浙公网安备 33010602011771号