Skip to main content
Course/Advanced/API Deprecations β€” Staying Current Across Upgrades
8/830 min
Advanced

API Deprecations β€” Staying Current Across Upgrades

Detect deprecated Kubernetes APIs in manifests and Helm charts, understand the deprecation policy, and migrate before upgrades break things.

intermediate30 minRead β†’ Lab β†’ Quiz β†’ Practice
🧠 Brain Warm-Up
🧠 Brain Warm-Up: You upgrade your cluster from 1.28 to 1.32. Half your kubectl apply commands start failing with "no kind is registered for the version." What happened, and how would you have caught this before the upgrade? Think before reading.

Kubernetes Deprecation Policy

Kubernetes evolves quickly. Old API versions are deprecated and eventually removed. The policy guarantees a window:

API maturityDeprecation windowNotes
GA (v1)β‰₯ 12 months and β‰₯ 3 releasesMost stable; long window
Beta (v1beta1, v2beta1)β‰₯ 9 months and β‰₯ 3 releasesReasonably stable
Alpha (v1alpha1)No guarantee β€” can be removed next releaseNever use in production

A deprecated API still works during the window. After removal, requests using that apiVersion get a 404 or "no kind registered" error.

Real Deprecation Examples

Old apiVersionRemoved inNew apiVersion
extensions/v1beta1 Ingress1.22networking.k8s.io/v1
apps/v1beta1 Deployment1.16apps/v1
networking.k8s.io/v1beta1 Ingress1.22networking.k8s.io/v1
policy/v1beta1 PodDisruptionBudget1.25policy/v1
batch/v1beta1 CronJob1.25batch/v1

Detecting Deprecated APIs

1. kubectl warnings (built-in)

kubectl prints deprecation warnings to stderr automatically:

$ kubectl apply -f old-ingress.yaml
Warning: networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+;
         use networking.k8s.io/v1 Ingress
ingress.networking.k8s.io/my-ingress created

2. kubectl api-versions

List all API groups and versions currently available in the cluster:

kubectl api-versions
# apps/v1
# batch/v1
# networking.k8s.io/v1
# ...

If an apiVersion from your manifest is NOT in this list, it has been removed.

3. Pluto β€” automated scanning

Pluto scans directories of manifests or Helm chart outputs for deprecated and removed APIs:

# Install
brew install FairwindsOps/tap/pluto     # macOS
# or download from github.com/FairwindsOps/pluto/releases

# Scan a directory
pluto detect-files -d ./manifests

# Scan a Helm release
helm template my-release ./my-chart | pluto detect --stdin

Output:

NAME         KIND      VERSION                         REPLACEMENT              REMOVED   DEPRECATED
my-ingress   Ingress   networking.k8s.io/v1beta1       networking.k8s.io/v1     true      true

4. kubectl convert (plugin)

kubectl convert migrates manifests between API versions:

# Install via krew
kubectl krew install convert

# Convert a single file
kubectl convert -f old-ingress.yaml --output-version networking.k8s.io/v1

# Convert all files in a directory
kubectl convert -f ./manifests/ --output-version networking.k8s.io/v1 -o yaml

Pre-Upgrade Checklist

Before upgrading your cluster:

  1. Check the release notes for the target version β€” look for "Removed APIs" section
  2. Run Pluto against all manifests and Helm releases
  3. Fix deprecated apiVersions in manifests
  4. Test with --dry-run=server against a cluster running the new version