|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

 

 

posted on   yanqi_vip  阅读(15)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示