helm3 upgrade 更新时,annotations的values无法处理"."

473 阅读1分钟

helm3 upgrade --set service.annotations.'service.beta.kubernetes.io/azure-load-balancer-internal'="true"

Error: UPGRADE FAILED: failed to create resource: Service "impact" is invalid: [metadata.annotations: Invalid value: "'\''service.beta.kubernetes.io/azure-load-balancer-internal'\''": prefix part a DNS-1123 subdomain must consist of lower case alphanumeric characters, '\''-'\'' or '\''.'\'', and must start and end with an alphanumeric character (e.g. '\''example.com'\'', regex used for validation is '\''[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'\''), metadata.annotations: Invalid value: "'\''service.beta.kubernetes.io/azure-load-balancer-internal'\''": name part must consist of alphanumeric characters, '\''-'\'', '\''_'\'' or '\''.'\'', and must start and end with an alphanumeric character (e.g. '\''MyName'\'',  or '\''my.name'\'',  or '\''123-abc'\'', regex used for validation is '\''([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]'\'')]'

正确格式应该是

helm3 upgrade --set service.annotations.'service\.beta\.kubernetes\.io/azure-load-balancer-internal'="true"

参考url

github.com/cetic/helm-…