Kubernetes 替换头盔图表中标签的命令

Kubernetes 替换头盔图表中标签的命令,kubernetes,kubernetes-helm,go-templates,helmfile,Kubernetes,Kubernetes Helm,Go Templates,Helmfile,我经常在helm图表中看到以下片段: labels: app: {{ template "app.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} 为什么需要更换?+符号是否不正确?根据本文档,标签的值不能有加号+字符 The name segment is required and must be 63 characters or less, beginning and e

我经常在helm图表中看到以下片段:

  labels:
    app: {{ template "app.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
为什么需要更换?+符号是否不正确?

根据本文档,标签的值不能有加号+字符

The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
根据本文档,标签的值中不能有加号+字符

The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.
替换-脚本和图表功能 Replace在将输入字符串中给定子字符串的所有匹配项替换为另一个子字符串后返回一个字符串。该函数是非递归的,从左到右运行

语法:

替换文本,从\u str到\u str 返回数据类型:string

pod配置文件中的有效标签值必须小于等于63个字符,并且必须为空,或者以字母数字字符[a-z0-9A-Z]开头和结尾,中间带破折号、下划线、圆点和字母数字

替换+\用下划线替换加号字符。这就是我们避免失败的方法

您可以在此处找到更多信息:,。

替换-脚本和图表功能 Replace在将输入字符串中给定子字符串的所有匹配项替换为另一个子字符串后返回一个字符串。该函数是非递归的,从左到右运行

语法:

替换文本,从\u str到\u str 返回数据类型:string

pod配置文件中的有效标签值必须小于等于63个字符,并且必须为空,或者以字母数字字符[a-z0-9A-Z]开头和结尾,中间带破折号、下划线、圆点和字母数字

替换+\用下划线替换加号字符。这就是我们避免失败的方法

您可以在此处找到更多信息: