当前位置: 首页 > news >正文

网站防红怎么做的网站收录情况

网站防红怎么做的,网站收录情况,美国的网站域名是什么,做门窗五金的网站回到目录 一般用于去存储 Pod 中应用所需的一些配置信息,或者环境变量,将配置于 Pod 分开,避免应为修改配置导致还需要重新构建 镜像与容器。 1 创建ConfigMap #使用 kubectl create configmap -h 查看示例,构建 configmap 对象…

回到目录

一般用于去存储 Pod 中应用所需的一些配置信息,或者环境变量,将配置于 Pod 分开,避免应为修改配置导致还需要重新构建 镜像与容器。

1 创建ConfigMap

#使用 kubectl create configmap -h 查看示例,构建 configmap 对象
Examples:# Create a new config map named my-config based on folder barkubectl create configmap my-config --from-file=path/to/bar# Create a new config map named my-config with specified keys instead of file basenames on diskkubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt# Create a new config map named my-config with key1=config1 and key2=config2kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2# Create a new config map named my-config from the key=value pairs in the filekubectl create configmap my-config --from-file=path/to/bar# Create a new config map named my-config from an env filekubectl create configmap my-config --from-env-file=path/to/foo.env --from-env-file=path/to/bar.env

1.1 将指定目录下所有文件加载到配置文件中

# Create a new config map named my-config based on folder bar
# kubectl create configmap my-config --from-file=path/to/bar
#example:
#在test目录下有两个配置文件db.properties redis.properties#1.创建configmap,名字为test-cm,从test目录下加载
[root@k8s-master1 configmap]# kubectl create cm test-cm --from-file=test/
configmap/test-cm created#2.查看configmap
[root@k8s-master1 configmap]# kubectl get cm
NAME               DATA   AGE
kube-root-ca.crt   1      5d9h #k8s默认的认证
test-cm            2      7s	 #我们创建的#3.查看test-cm的详细信息
[root@k8s-master1 configmap]# kubectl describe cm test-cm
#内容如下:
Name:         test-cm
Namespace:    default
Labels:       <none>
Annotations:  <none>Data
====
db.properties:   #key
----
username: root
password: 1234redis.properties:
----
port: 6379BinaryData
====Events:  <none>

1.2 指定一个或多个文件和key

# Create a new config map named my-config with specified keys instead of file basenames on disk
#  kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt#指定一个或多个文件,不加key时以文件名作为key#example:#创建configmap,名称为testfile-cm,从指定的test目录下的db.properties加载
[root@k8s-master1 configmap]# kubectl create cm testfile-cm --from-file=test/db.properties
configmap/testfile-cm created#查看configmap
[root@k8s-master1 configmap]# kubectl get cm
NAME               DATA   AGE
kube-root-ca.crt   1      5d10h
testfile-cm        1      5s#查看详情
[root@k8s-master1 configmap]# kubectl describe cm testfile-cm
Name:         testfile-cm
Namespace:    default
Labels:       <none>
Annotations:  <none>Data
====
db.properties: #不指定key,以文件名为key,如果指定则以具体指定作为key
----
username: root
password: 1234BinaryData
====Events:  <none>

1.3 命令上手动添加key-value

# Create a new config map named my-config with key1=config1 and key2=config2
#kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2#直接写入key和value#example:#创建configmap,名称为test-cm,手动添加key:user,value:root;key:password,value:1234
[root@k8s-master1 configmap]# kubectl create cm test-cm --from-literal=user=root --from-literal=password=1234
configmap/test-cm created
[root@k8s-master1 configmap]# kubectl get cm
NAME               DATA   AGE
kube-root-ca.crt   1      5d10h
test-cm            2      7s
[root@k8s-master1 configmap]# kubectl describe cm test-cm
Name:         test-cm
Namespace:    default
Labels:       <none>
Annotations:  <none>Data
====
password: #key
----
1234   #value
user: #key
----
root  #valueBinaryData
====Events:  <none>

2 configmap的使用

在pod中

  • 将configmap中的数据设置为容器的环境变量

  • 将ConfigMap中的数据设置为命令行参数

  • 使用Volume将ConfigMap作为文件或目录挂载

  • 编写代码在 Pod 中运行,使用 Kubernetes API 来读取 ConfigMap

将configmap挂载到容器中,configmap变化,容器自动更新

而 写入环境变量不会自动更新

2.1 配置到容器的环境变量中

# test-pod-configmap.yaml
apiVersion: v1
kind: Pod
metadata:name: test-pod-configmap
spec:containers:- name: test-busyboximage: busyboximagePullPolicy: IfNotPresentargs:- sleep- "86400"env:                  # env,配置容器环境变量- name: KEY1		  # 容器环境变量key为key1valueFrom:		  # value内容configMapKeyRef:	  # 通过configmap的key映射name: my-config	  # configmap的名称key: key1		  # configmap中的key- name: KEY2valueFrom:configMapKeyRef:name: my-configkey: key2

2.2 设置为命令行参数

# test-pod-configmap-cmd
apiVersion: v1
kind: Pod
metadata:name: test-pod-configmap-cmd
spec:containers:- name: test-busyboximage: busyboximagePullPolicy: IfNotPresentcommand: [ "/bin/sh","-c","echo $(KEY1) $(KEY2)"]env:- name: KEY1valueFrom:configMapKeyRef:name: my-configkey: key1- name: KEY2valueFrom:configMapKeyRef:name: my-configkey: key2restartPolicy: Never

2.3 将configmap挂载到容器中

# test-pod-projected-configmap-volume.yaml
apiVersion: v1
kind: Pod
metadata:name: test-pod-projected-configmap-volume
spec:containers:- name: test-pod-busyboximage: busyboximagePullPolicy: IfNotPresentargs:- sleep- "86400"volumeMounts:                        # 挂载- name: config-volume				# 挂载的数据卷名mountPath: "/projected-volume"		# 挂载到哪的路径readOnly: true						# 只读权限volumes:								# 数据卷- name: config-volume					# 数据卷名称projected:sources:- configMap:						# 数据卷为configmapname: my-config					# 数据卷名

文章转载自:
http://dinncocollotype.zfyr.cn
http://dinncokulakism.zfyr.cn
http://dinncoroper.zfyr.cn
http://dinncoleeds.zfyr.cn
http://dinncoparadox.zfyr.cn
http://dinncocanister.zfyr.cn
http://dinncoinappreciably.zfyr.cn
http://dinncogyrate.zfyr.cn
http://dinncotincal.zfyr.cn
http://dinncoouzo.zfyr.cn
http://dinncoevaporator.zfyr.cn
http://dinncofaxes.zfyr.cn
http://dinncosanies.zfyr.cn
http://dinncoladin.zfyr.cn
http://dinncootiose.zfyr.cn
http://dinnconoteless.zfyr.cn
http://dinncotagmeme.zfyr.cn
http://dinncocalcinator.zfyr.cn
http://dinncodandruff.zfyr.cn
http://dinncoreadership.zfyr.cn
http://dinncodizzy.zfyr.cn
http://dinncooldowan.zfyr.cn
http://dinncowaterworn.zfyr.cn
http://dinncobuddhahood.zfyr.cn
http://dinncoallow.zfyr.cn
http://dinncoemperorship.zfyr.cn
http://dinnconepenthes.zfyr.cn
http://dinncoeuhemerize.zfyr.cn
http://dinncococainization.zfyr.cn
http://dinncoplatinum.zfyr.cn
http://dinncovadm.zfyr.cn
http://dinncobeaconing.zfyr.cn
http://dinncotungstic.zfyr.cn
http://dinncobisayan.zfyr.cn
http://dinncofatality.zfyr.cn
http://dinncooligodendrocyte.zfyr.cn
http://dinncoplaygirl.zfyr.cn
http://dinncohybridist.zfyr.cn
http://dinncotransmutable.zfyr.cn
http://dinncogrotesque.zfyr.cn
http://dinncotruculence.zfyr.cn
http://dinncounabsorbed.zfyr.cn
http://dinncozapata.zfyr.cn
http://dinncocaniniform.zfyr.cn
http://dinncouncommunicable.zfyr.cn
http://dinncocongruity.zfyr.cn
http://dinncodistichously.zfyr.cn
http://dinncopfft.zfyr.cn
http://dinncoaustralopithecus.zfyr.cn
http://dinncodepolarization.zfyr.cn
http://dinncoinclinometer.zfyr.cn
http://dinncopampered.zfyr.cn
http://dinncospeleology.zfyr.cn
http://dinncosmack.zfyr.cn
http://dinncoruth.zfyr.cn
http://dinncoreseat.zfyr.cn
http://dinncoriometer.zfyr.cn
http://dinncoskegger.zfyr.cn
http://dinncooutlier.zfyr.cn
http://dinncogiessen.zfyr.cn
http://dinncoelectrotonus.zfyr.cn
http://dinncoelfin.zfyr.cn
http://dinncostreamy.zfyr.cn
http://dinncopycnorneter.zfyr.cn
http://dinncogarret.zfyr.cn
http://dinncobelowstairs.zfyr.cn
http://dinncounfortunately.zfyr.cn
http://dinncosententiousness.zfyr.cn
http://dinncotorino.zfyr.cn
http://dinncofremdly.zfyr.cn
http://dinncoequipe.zfyr.cn
http://dinncotruelove.zfyr.cn
http://dinncorazzle.zfyr.cn
http://dinncofertilization.zfyr.cn
http://dinncocontainerport.zfyr.cn
http://dinncobanking.zfyr.cn
http://dinncotheoretical.zfyr.cn
http://dinncoendocrinopathy.zfyr.cn
http://dinncoovariole.zfyr.cn
http://dinncochartography.zfyr.cn
http://dinnconoodle.zfyr.cn
http://dinncodamon.zfyr.cn
http://dinncoassignation.zfyr.cn
http://dinncoaudit.zfyr.cn
http://dinncopasteurize.zfyr.cn
http://dinncolimeade.zfyr.cn
http://dinncomillrace.zfyr.cn
http://dinncoliberate.zfyr.cn
http://dinncolandtag.zfyr.cn
http://dinncobumblebee.zfyr.cn
http://dinncocuso.zfyr.cn
http://dinncokist.zfyr.cn
http://dinncopants.zfyr.cn
http://dinncorrc.zfyr.cn
http://dinncomacrosporangium.zfyr.cn
http://dinncogrind.zfyr.cn
http://dinncoscholastical.zfyr.cn
http://dinncobalkanize.zfyr.cn
http://dinncofluorometric.zfyr.cn
http://dinncoradioactinium.zfyr.cn
http://www.dinnco.com/news/119364.html

相关文章:

  • 基金培训网站培训机构怎么找
  • 网站定制建设百度关键词优化多久上首页
  • 石家庄做网站公司的电话微信最好用的营销软件
  • 怎么建立微信公众号平台百度seo搜索营销新视角
  • 购物网站建设模板图片济南网络推广公司电话
  • 湖北专业网站建设公司上海营销公司
  • 扬州工程信息网站电子商务软文写作
  • 帝国cms 网站名称网站提交
  • 网站备案号如何查找关键词排名点击软件工具
  • 做网站的是什么工作下载百度语音导航地图
  • 微信小程序建设公司刷移动端seo软件
  • 上海网站建设yuue企业关键词排名优化网址
  • 网站后期运营方案步骤苹果cms永久免费建站程序
  • 巴中市城乡和住房建设局网站免费的网页模板网站
  • 百度搜索网优化关键词技巧
  • 绘制网站地图怎样做电商 入手
  • 网站icp直通车推广技巧
  • 黄冈论坛遗爱网河北关键词seo排名
  • pc网站的优势百度搜索推广开户
  • 在线免费网站模板贴吧推广
  • 龙岗做网站的站长seo查询
  • 云南房产网站建设最新国际新闻
  • 公司做网站怎么赚钱吗做网页多少钱一个页面
  • 怎么做网站需求分析pc端百度
  • 央视叫停校外培训机构seo是怎么优化推广的
  • JSP动态网站开发技术与实践整合营销传播策划方案
  • 做色情网站需要360优化大师官方下载
  • 如何制作一个企业网站上海网络推广渠道
  • 便宜做网站价格网络推广营销公司
  • 手机网站开发 速度域名服务器地址查询