Kubernetes API Deprecations

Rodolfo M 5 Reputation points
2023-06-19T15:09:06.4766667+00:00

Hi all,

I had a warning in the "Diagnose and solve problems" issue in the Azure portal because my cluster was out of date, and I was a deployment with the autoscaling/v2beta2 api.

Last week, I updated my cluster to 1.25.6 Kubernetes version + agents and migrated my deployment to autoscaling/v2.

Both (AKS and HPA) are working fine without issues, but yesterday I got the same warning saying "Detected the use of APIs that have a deprecation warning for a previous, current, or future Kubernetes version" in "Diagnose and solve problems."

Does anyone face the same issue?

Thanks!

Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,447 questions
{count} vote

4 answers

Sort by: Most helpful
  1. Mutaz Nassar 2,361 Reputation points Microsoft Employee
    2023-06-19T15:56:33.9733333+00:00

    Hi @Rodolfo M

    Make sure to select the time rage for the last 1 hour to verify if you still see the warning.

    Also you can verify directly on your AKS cluster using this command:
    kubectl get --raw /metrics | grep apiserver_requested_deprecated_apis

    Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.


  2. Sedat SALMAN 14,180 Reputation points MVP
    2023-06-20T09:32:06.6433333+00:00

    https://stackoverflow.com/questions/76391104/detected-the-use-of-apis-that-have-a-deprecation-warning-for-a-previous-current

    https://kubernetes.io/docs/reference/using-api/deprecation-guide/

    https://learn.microsoft.com/en-us/answers/questions/1311962/kubernetes-api-deprecations

    in addition to mutaz comment as per above refs

    With the 1.25.6 update, the API versions batch/v1beta1 for CronJob and discovery.k8s.io/v1beta1 for EndpointSlice are no longer served, and the objects using these APIs should be migrated to their new versions: batch/v1 and discovery.k8s.io/v1 respectively

    0 comments No comments

  3. Cristian Gatjens 716 Reputation points Microsoft Employee
    2023-06-26T16:02:43.9+00:00

    Hello Rodolfo,

    Best link to check deprecated API's is the following:

    https://kubernetes.io/docs/reference/using-api/deprecation-guide/#horizontalpodautoscaler-v126

    I pointed the specific API that you mentioned but therae are others that you need to manually check, if you are using any depcreated APIs then it is expected that you see the warning.

    In addition, we recently released a feature that prevents a cluster upgrade if the target cluster introduces API breaking changes:

    https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster?tabs=azure-cli#stop-cluster-upgrades-automatically-on-api-breaking-changes-preview

    Thanks!

    0 comments No comments

  4. Rodolfo M 5 Reputation points
    2023-07-03T06:43:54.1766667+00:00

    Hi @Everybody

    The problem was "metrics-server" deployment was using the deprecated API.

    Thanks all for the help.

    Regards!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.