Kevin_306

38 k8s-20.K8s基础篇-配置管理1.2 基于文件创建

1.2 基于文件创建

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
01.[root@k8s-master01 configmap]# vim conf/redis.conf
password redis123       (#随便输入的内容)
02.[root@k8s-master01 configmap]# ls conf/
game2.conf game.conf redis.conf
03.[root@k8s-master01 configmap]# kubectl create cm cmfromfile --from-file=conf/redis.conf
configmap/cmfromfile created
04.[root@k8s-master01 configmap]# kubectl get cm
05.[root@k8s-master01 configmap]# kubectl get cm cmfromfile -o yaml
apiVersion: v1
data:
  redis.conf: |
    password redis123
kind: ConfigMap
metadata:
  creationTimestamp: "2022-02-23T07:56:21Z"
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:data:
        .: {}
        f:redis.conf: {}
    manager: kubectl-create
    operation: Update
    time: "2022-02-23T07:56:21Z"
  name: cmfromfile
  namespace: default
  resourceVersion: "692472"
  uid: 9413516f-dab3-4ee8-aaa7-48a3d86ce3bd

 

 

posted on   熊猫小虾  阅读(50)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
< 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

导航

统计

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