[k8s] Helm upgrade fail due to deprecated K8S APIs version after upgrading Kubernetes version
Our team use helm to manage K8S resources. Most of helm charts are using helm upgrade — install… to redeploy.
But sometime it failed after we upgraded our K8S version to the latest…

It is because some of K8S API are deprecated after upgarding Kubernetes version.
How to solve it?
The easiest way is uninstall your helm apps and reinstall them. But this way will clear all of updating history. So, if you want to keep them. You can:
- Follow this Helm official document “Deprecated Kubernetes APIs” to solve this issue.
- There is one article “helm upgrade fail after upgrade to Kubernetes 1.25 due to change in HorizontalPodAutoscaler API version” in stackoverflow also has some script can help you.
- Or you can choose Helm mapkubeapis Plugin. And do things below:
# 1. Install helm-mapkubeapis
helm plugin install https://github.com/helm/helm-mapkubeapis
# 2. Mapping K8S APIs
helm mapkubeapis <releasename>
# 3. Update API version of helm charts
# 4. Upgrade applications
helm upgrade --install <releasename>
Everything will back to normal.