You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Percona PMM Helm升级失败:YAML转JSON解析错误求助

解决Percona PMM Helm Chart Ingress配置的YAML解析错误

问题根源

错误提示指向模板第14行,但实际问题出在你的配置文件/命令行参数的YAML结构不合法,导致Helm渲染时无法正确转换为JSON。

具体修复方案

1. 修复values.yaml配置

你的values.yaml中annotations: {}后的注释缩进错误,YAML解析器会把缩进的注释当成annotations的子项,但{}已经闭合了该键的定义,从而引发结构错误。修正后的values.yaml:

ingress:
  enabled: true
  nginxInc: true
  annotations: {}
# Add specific annotations here if needed(注释与annotations同层级)
  community:
    annotations: {}
# Add annotations for community-managed ingress here if needed(同样修正注释缩进)
  ingressClassName: "testprivate"
  hosts:
    - host: pmm-tst-test.test-hos.com
      paths: []
  pathType: Prefix
  tls:
    - secretName: pmm-certificates

2. 修复命令行--set参数

命令行中ingress.hosts[0].paths={}使用了字典语法,但paths是数组类型,应该用数组语法[]:

helm upgrade pmm percona/pmm \
  --set ingress.enabled=true \
  --set ingress.nginxInc=true \
  --set ingress.ingressClassName=testprivate \
  --set ingress.hosts[0].host=pmm-tst-test.test-private.com \
  --set ingress.hosts[0].paths=[] \
  --set ingress.tls[0].secretName=pmm-certificate 

验证逻辑

模板第14行的{{- if or .Values.ingress.annotations .Values.ingress.nginxInc }}本身语法合法,当nginxInc=true时条件成立,会渲染annotations块。但如果你的配置YAML结构无效,Helm在渲染前就会解析失败,错误提示会指向模板行,但实际问题在配置本身。

内容的提问来源于stack exchange,提问作者Vetements

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 19:28:26