Published on

Handling Deprecated Kubernetes APIs in AKS

Authors
  • avatar
    Name
    Alexander Arana Escobedo
    Twitter

When attempting to upgrade your AKS cluster to a major update that contains breaking changes, you might encounter the following error:

deprecated-apis

This indicates that your cluster is using a deprecated Kubernetes API version, which is not supported in the new major version. This means you need to identify the Kubernetes resources in your cluster that are using a deprecated version.

For example, you can use a kubectl command to check the API version running on a specific Kubernetes resource. It could also be a Helm release that is using the outdated API version.

kubectl get <K8S_RESOURCE> --all-namespaces -o=jsonpath="{range .items[*]}{.apiVersion}`t{.kind}`t{.metadata.name}`n{end}"

#Example
kubectl get hpa --all-namespaces -o=jsonpath="{range .items[*]}{.apiVersion}`t{.kind}`t{.metadata.name}`n{end}"

Seems like a hassle, right? You can instead get help from the Diagnose and solve problems tab found in your AKS resource in the Azure portal."

deprecated-apis

Click on Create, Upgrade, Delete and Scale

deprecated-apis

Pick Kubernetes API Deprecations

deprecated-apis

You will be presented with a list of resources that are using the outdated API version! 😎

I hope this guide helps you out! If you have any questions, don’t hesitate to reach out.

Alexander Arana.E