CloudNatix logo

User Guide

Checking Kubernetes Deprecated APIs

Overview

CloudNatix supports deprecated API detection for objects deployed with Helm or kubectl apply command.

Kubernetes APIs are periodically upgraded. As new APIs are introduced, old APIs are deprecated and eventually removed. Until then, manifests that use the deprecated APIs need to be updated. CloudNatix can help you to find these manifests.

Checking with CloudNatix CLI

To check deprecated APIs with CLI, type the following command:

cnatix k8s deprecated-api

The CLI outputs two tables. The first represents objects deployed with kubectl and the second with Helm. Below is an example output.

Deployed by kubectl
+--------------+-------------+--------------------------+---------+-----------+-----------+------------+-----------------+
| CLUSTER NAME |    GROUP    |         RESOURCE         | VERSION | NAMESPACE |   NAME    |  INSTANCE  | DELETED VERSION |
+--------------+-------------+--------------------------+---------+-----------+-----------+------------+-----------------+
| my-cluster   | autoscaling | horizontalpodautoscalers | v2beta1 | my-ns     | my-app    | dev-my-app | v1.25           |
| my-cluster   | policy      | podsecuritypolicies      | v1beta1 |           | my-policy | dev-my-app | v1.25           |
+--------------+-------------+--------------------------+---------+-----------+-----------+------------+-----------------+
Deployed by Helm
+--------------+--------+---------------------+---------+-----------+--------+---------+---------------+-----------------+
| CLUSTER NAME | GROUP  |      RESOURCE       | VERSION | NAMESPACE |  NAME  | RELEASE |     CHART     | DELETED VERSION |
+--------------+--------+---------------------+---------+-----------+--------+---------+---------------+-----------------+
| my-cluster   | policy | podsecuritypolicies | v1beta1 |           | myapp2 | myapp2  | myapp2-0.1.13 | v1.25           |
+--------------+--------+---------------------+---------+-----------+--------+---------+---------------+-----------------+

Columns common to both tables are the namespace and name of the object, the cluster name to which the object belongs, deprecated API information (group, version, and resource), and the Kubernetes version from which the API will be removed.

The kubectl table has a column for object instance names. See Instance Label Keys for more information. The Helm table contains columns for Helm release name and chart information.

Instance Label Keys

These label keys are used to identify the instance name. If an object is assigned more than one of the following label keys, the value of the first key found is used.

  • argocd.argoproj.io/instance: This key is often used to indicate the instance name of the object deployed via Argo CD.
  • app.kubernetes.io/instance: This key is one of the well-known labels in Kubernetes and is used to identify instance names.

Limitations

Unable to detect API deprecation for objects deployed by methods other than Helm or kubectl apply command (e.g., kubectl create command).

Previous
Secure Session and RBAC Management
Next
Administration Guide