错误:升级失败:解码失败:无法找到 'networking.k8s.io/v1beta1/Ingress' 的 API 版本。该 Chart 可能与集群版本不兼容。
Error: UPGRADE FAILED: failed to decode: unable to find api-versions for 'networking.k8s.io/v1beta1/Ingress'. The chart may be incompatible with the cluster version.
ID: cicd/helm-deploy-failed-no-api-versions
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Helm 3.12 | active | — | — | — |
| Helm 3.13 | active | — | — | — |
| Kubernetes 1.22 | active | — | — | — |
| Kubernetes 1.24 | active | — | — | — |
| Kubernetes 1.27 | active | — | — | — |
根因分析
Helm Chart 引用了已弃用的 Kubernetes API 版本(例如 networking.k8s.io/v1beta1),该版本在目标集群中不再可用(例如 Kubernetes 1.22+),导致部署失败。
English
A Helm chart references a deprecated Kubernetes API version (e.g., networking.k8s.io/v1beta1) that is no longer available in the target cluster (e.g., Kubernetes 1.22+), causing the deployment to fail.
官方文档
https://helm.sh/docs/topics/kubernetes_apis/解决方案
-
Update the chart to use the equivalent stable API version: replace 'networking.k8s.io/v1beta1' with 'networking.k8s.io/v1' for Ingress, or use 'apps/v1' for Deployments.
-
Use the 'helm mapkubeapis' plugin to automatically migrate deprecated API versions in the chart before deployment.
-
Pin the chart to a version that supports the target cluster's API versions by specifying a chart version in the Helm command or requirements.yaml.
无效尝试
常见但无效的做法:
-
85% 失败
--force only replaces resources; it does not change the API version requirements.
-
80% 失败
The Helm client only sends the manifest; the cluster rejects unknown API versions.
-
90% 失败
The same chart manifest is used, so the same API version error will occur.