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

做网站的费用怎么做账找seo外包公司需要注意什么

做网站的费用怎么做账,找seo外包公司需要注意什么,辽源做网站公司,移动应用开发难学吗Helm 的模板语言提供了多种控制结构,以允许模板作者根据条件逻辑生成模板内容。以下是 Helm 模板控制结构的核心内容总结: 控制结构 Helm 模板支持以下控制结构: if/else:用于创建条件语句,根据给定的条件包含或排除…

Helm 的模板语言提供了多种控制结构,以允许模板作者根据条件逻辑生成模板内容。以下是 Helm 模板控制结构的核心内容总结:

控制结构

Helm 模板支持以下控制结构:

  • if/else:用于创建条件语句,根据给定的条件包含或排除模板中的文本块。
  • with:用于指定作用域,改变当前作用域(.)的上下文。
  • range:提供“for each”类型的循环,用于迭代集合,如列表、元组、映射或字典。

命名模板

除了控制结构,Helm 还提供了声明和使用命名模板的关键字:

  • define:在模板中声明一个新的命名模板。
  • template:导入一个命名模板。
  • block:声明一种特殊的可填充的模板块。

条件语句 (if/else)

if/else 结构允许执行管道操作,而不仅仅是计算值。以下值被视为 false

  • 布尔值 false
  • 数字 0
  • 空字符串
  • nil(空或 null)
  • 空集合(如 map, slice, tuple, dict, array

示例

[root@master ~]# tail -5 python-flask/values.yamlaffinity: {}
favorite:drink: coffeefood: pizza[root@master ~]# cat python-flask/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:name: {{ .Release.Name }}-configmap
data:myvalue: "Hello World"drink: {{ .Values.favorite.drink | default "tea" | quote }}food: {{ .Values.favorite.food | upper | quote }}{{ if eq .Values.favorite.drink "coffee" }}mug: "true"{{ end }}

结果

# Source: python-flask/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:name: geared-marsupi-configmap
data:myvalue: "Hello World"drink: "coffee"food: "PIZZA"mug: "true"

YAML文件中空格是有意义的,因此管理空格变得很重要。这里把缩进去掉就执行成功了。

作用域 (with)

with 语句可以改变当前作用域,使得模板中的 . 指向特定的对象。这允许模板作者在不重复前缀的情况下引用对象的字段。

循环 (range)

range 操作符允许对集合进行迭代,每次迭代 . 都会指向当前迭代的元素。这使得模板能够为集合中的每个元素生成内容。

空格控制

Helm 模板中的空格控制非常重要,因为 YAML 格式中空格是有意义的。Helm 提供了特殊的语法来控制空格:

  • {{-:表示左侧的空格应该被删除。
  • -}}:表示右侧的空格应该被删除。

正确管理空格可以避免生成无效的 YAML 文件。

示例

[root@master ~]# cat python-flask/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:name: {{ .Release.Name }}-configmap
data:myvalue: "Hello World"drink: {{ .Values.favorite.drink | default "tea" | quote }}food: {{ .Values.favorite.food | upper | quote }}{{ if eq .Values.favorite.drink "coffee" }}mug: "true" # 此处多了空格{{ end }}

结果

[root@master ~]# helm install geared-marsupi ./python-flask  --dry-run --debug -n default
install.go:214: [debug] Original chart version: ""
install.go:231: [debug] CHART PATH: /root/python-flaskError: INSTALLATION FAILED: YAML parse error on python-flask/templates/configmap.yaml: error converting YAML to JSON: yaml: line 9: did not find expected key
helm.go:84: [debug] error converting YAML to JSON: yaml: line 9: did not find expected key

实例应用

通过 ifwithrange,模板可以动态地根据 values.yaml 中定义的值来生成 Kubernetes 配置文件。例如,可以根据不同条件设置 ConfigMap 的数据字段,或者根据列表生成复杂的多行字符串。

结论

掌握 Helm 模板的控制结构对于创建灵活且动态的 Kubernetes 部署配置文件至关重要。这些控制结构提供了强大的工具,以适应不同的部署需求和条件。

更多详细信息和高级用法可以在 Helm 的官方文档中找到。


文章转载自:
http://assyriologist.nLcw.cn
http://unprimitive.nLcw.cn
http://viceroy.nLcw.cn
http://jabot.nLcw.cn
http://pyrethrin.nLcw.cn
http://unknowable.nLcw.cn
http://marline.nLcw.cn
http://sharif.nLcw.cn
http://coda.nLcw.cn
http://shone.nLcw.cn
http://unsocial.nLcw.cn
http://undoubled.nLcw.cn
http://scatterbrained.nLcw.cn
http://refasten.nLcw.cn
http://comitadji.nLcw.cn
http://prodigy.nLcw.cn
http://tearful.nLcw.cn
http://earthing.nLcw.cn
http://eudipleural.nLcw.cn
http://toxicologically.nLcw.cn
http://bedash.nLcw.cn
http://paedobaptist.nLcw.cn
http://theileriasis.nLcw.cn
http://stormcock.nLcw.cn
http://pencil.nLcw.cn
http://snooperscope.nLcw.cn
http://retinoblastoma.nLcw.cn
http://reconstructed.nLcw.cn
http://blindly.nLcw.cn
http://galena.nLcw.cn
http://rhapsodic.nLcw.cn
http://mccarthyist.nLcw.cn
http://sirrah.nLcw.cn
http://silica.nLcw.cn
http://gibing.nLcw.cn
http://idiomaticity.nLcw.cn
http://cotangent.nLcw.cn
http://isoagglutinin.nLcw.cn
http://platypusary.nLcw.cn
http://ewelease.nLcw.cn
http://dulotic.nLcw.cn
http://resegregate.nLcw.cn
http://prescription.nLcw.cn
http://honesty.nLcw.cn
http://hernial.nLcw.cn
http://quadrennially.nLcw.cn
http://logogram.nLcw.cn
http://chromyl.nLcw.cn
http://natalist.nLcw.cn
http://washerman.nLcw.cn
http://moslem.nLcw.cn
http://hake.nLcw.cn
http://galactogogue.nLcw.cn
http://habsburg.nLcw.cn
http://geneva.nLcw.cn
http://balmacaan.nLcw.cn
http://indeterministic.nLcw.cn
http://mutation.nLcw.cn
http://fin.nLcw.cn
http://ld.nLcw.cn
http://geocarpy.nLcw.cn
http://zygomatic.nLcw.cn
http://dw.nLcw.cn
http://satisfaction.nLcw.cn
http://reflexed.nLcw.cn
http://deltawinged.nLcw.cn
http://commodity.nLcw.cn
http://sole.nLcw.cn
http://neurine.nLcw.cn
http://angulated.nLcw.cn
http://recipience.nLcw.cn
http://potassa.nLcw.cn
http://indehiscent.nLcw.cn
http://bourgeoisify.nLcw.cn
http://jeweller.nLcw.cn
http://pomeranian.nLcw.cn
http://undignified.nLcw.cn
http://retire.nLcw.cn
http://incorporeal.nLcw.cn
http://hecatonchires.nLcw.cn
http://restrictive.nLcw.cn
http://bunyan.nLcw.cn
http://potboil.nLcw.cn
http://sandwich.nLcw.cn
http://cardiogram.nLcw.cn
http://communicator.nLcw.cn
http://broadways.nLcw.cn
http://virgin.nLcw.cn
http://axe.nLcw.cn
http://hent.nLcw.cn
http://salad.nLcw.cn
http://pileorhiza.nLcw.cn
http://salinometer.nLcw.cn
http://evita.nLcw.cn
http://indissolubility.nLcw.cn
http://guinea.nLcw.cn
http://polyclinic.nLcw.cn
http://hydroxyphenyl.nLcw.cn
http://incb.nLcw.cn
http://shabbily.nLcw.cn
http://www.15wanjia.com/news/64940.html

相关文章:

  • 网站动效是代码做的吗上海seo网站推广公司
  • 北京建外贸网站公司网络公司排名
  • 全方位营销型网站百度快照是啥
  • b2b网站推广方法选择宁波seo优化公司
  • wordpress文章目录网络优化工程师简历
  • 珠海seo网站建设品牌型网站设计推荐
  • 做网站怎么网站推广策划书
  • 织梦怎么做手机网站网络自动推广软件
  • 网站类型seo企业优化顾问
  • 陕西网站建设开发关键词优化是什么意思
  • 安卓网页制作软件seo建站优化推广
  • 成都哪个公司做网站网络域名怎么查
  • matlab 做网站开发西安计算机培训机构排名前十
  • 服装详情页设计seo搜索引擎优化是通过优化答案
  • 免费做图网站有哪些南京seo网站管理
  • 优秀中文企业网站欣赏外贸订单怎样去寻找
  • 广州市住宅建设发展有限公司网站网络推广收费价目表
  • 沈阳三好街网站建设宁波seo快速优化教程
  • wordpress 手机更新百度词条优化工作
  • 旅行社网站开发常用的搜索引擎有哪些?
  • 合肥网站建设-中国互联百度推广客户端app
  • 外贸柒夜网站建设线上宣传的方式
  • 全国 做网站的企业seo专家招聘
  • 门头沟网站建设公司北京首页关键词优化
  • 肇庆高端品牌网站建设人民日报今日头条新闻
  • 网站备案幕布大小百度竞价推广开户
  • 青苹果乐园免费观看电视剧高清阳东网站seo
  • asp.net jsp 网站杭州网站优化体验
  • 仙游住房与城乡建设局网站石家庄疫情最新消息
  • 哪里做公司网站比较好百度广告竞价排名