升级Prometheus Helm Chart时遇PodDisruptionBudget验证错误求解决
解决Helm升级Prometheus时的PodDisruptionBudget字段错误
问题根源
Kubernetes的io.k8s.api.policy.v1.PodDisruptionBudgetSpec结构中不存在enabled字段,你在Helm values配置里错误地将enabled放在了podDisruptionBudget.spec层级下,触发了API验证失败。
解决方案
修正values.yaml配置
把enabled字段移到podDisruptionBudget的顶层,而非spec内部:
错误配置示例:podDisruptionBudget: spec: enabled: true minAvailable: 1正确配置示例:
podDisruptionBudget: enabled: true spec: minAvailable: 1升级Prometheus Helm Chart
若使用的是旧版Chart,可能存在配置映射bug。更新到最新稳定版的Prometheus社区Chart即可修复这类字段映射问题:helm repo update prometheus-community helm upgrade prometheus prometheus-community/prometheus -f your-values.yaml临时应急方案(不推荐)
若需紧急完成升级,可临时跳过K8s API验证,但后续必须修正配置:helm upgrade prometheus prometheus-community/prometheus -f your-values.yaml --validate=false注意:跳过验证可能引入其他配置风险,仅作为临时手段。
内容的提问来源于stack exchange,提问作者Himanshu Gude
相关产品推荐
相关产品推荐

