How did I fix my api-deprecation in Kubernetes
Kubernetes version 1.16 and higher are removing deprecated API
Overview
As the Kubernetes API evolves, APIs are periodically reorganized or upgraded. When APIs evolve, the old API is deprecated and eventually removed.
To have deal with that situation, we need to have continuous plan to detect and fix the issue. In this article, I would go over how to detect it and fix the API in the deployment/release before upgrading the Kubernetes Version.
When deprecated you will find error below when you install the application e.g. helm install — name my-nginx stable/nginx-ingress — version 0.9.0
Error: validation failed: unable to recognize “”: no matches for kind “Deployment” in version “extensions/v1beta1”
Detection
There are couple of ways, to verify the availability of API e.g. extensions/v1beta1 api for deployment —
kubectl api-resources | grep extensions
In Kubernetes 1.16 it will be like below

In Kubernetes 1.15 it will be available,

To detect whether a particular API is deprecated, there is nice tool called kubent (Kube No Trouble), running of which ./kubent, shows the following result in Kubernetes 1.15 cluster.

Although kubent works great, there is another tool called pluto which provides further information, regarding which version it is deprecated, when it will be removed along with replacement API. Additionally it allows to check helm template e.g. helm template e2e/tests/assets/helm3chart | pluto detect -
Reference of these tools are in the link.
Remediation
Now detection is good, we need to fix the issue by updating with new API.
Although kubectl provides convert command for manifest as given example below, it is now deprecated as well.
kubectl convert -f ./deployment.yaml — output-version apps/v1
Better option regarding the above is to use, kubectl get command e.g. kubectl get deployment.apps/my-nginx-nginx-ingress-controller -o yaml which will give the updated API version -
What about for helm? Helm also has released mapkubeapis plugin to fix the release in-place.
You can check with command e.g.
helm mapkubeapis my-nginx --dry-run --namespace kube-system --v2
When it is fixed, it will be like below -

Now it is fixed, which can be validated using ./kubent which I ran on the same cluster running Kubernets version 1.15.

Conclusion
I believe this article will remove lot of worries when doing Kubernetes version update and a smooth transition to the new version.