# 错误：升级失败：解码失败：无法找到 'networking.k8s.io/v1beta1/Ingress' 的 API 版本。该 Chart 可能与集群版本不兼容。

- **ID:** `cicd/helm-deploy-failed-no-api-versions`
- **领域:** cicd
- **类别:** config_error
- **错误码:** `HELM_API_VERSION_MISMATCH`
- **验证级别:** ai_generated
- **修复率:** 87%

## 根因

Helm Chart 引用了已弃用的 Kubernetes API 版本（例如 networking.k8s.io/v1beta1），该版本在目标集群中不再可用（例如 Kubernetes 1.22+），导致部署失败。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Helm 3.12 | active | — | — |
| Helm 3.13 | active | — | — |
| Kubernetes 1.22 | active | — | — |
| Kubernetes 1.24 | active | — | — |
| Kubernetes 1.27 | active | — | — |

## 解决方案

1. ```
   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.
   ```
2. ```
   Use the 'helm mapkubeapis' plugin to automatically migrate deprecated API versions in the chart before deployment.
   ```
3. ```
   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.
   ```

## 无效尝试

- **** — --force only replaces resources; it does not change the API version requirements. (85% 失败率)
- **** — The Helm client only sends the manifest; the cluster rejects unknown API versions. (80% 失败率)
- **** — The same chart manifest is used, so the same API version error will occur. (90% 失败率)
