Black Friday · 27 Nov 2026

Up to 90% off selected certifications.

One time only offer for a very precious career goal. Limited coupons, waitlist first.

Free lesson · CKAD Prep Program · Module 4: Observability and maintenance

Migrate Off Deprecated APIs

APIs deprecate on a schedule and disappear on a stricter one. Migrating early is a calm rewrite; migrating at removal time is an incident. This lesson makes the conversion mechanical.

10 min reading

Objectives

  • Find deprecated apiVersions in your manifests before the cluster does
  • Convert a definition to its replacement version field by field
  • Verify the converted object behaves identically after apply
  • Say what breaks at removal time if you postpone the migration

Why this matters

Every Kubernetes minor release retires API versions, and clusters eventually refuse the old ones outright. Manifests copied from old guides carry versions that no longer serve, and the failure arrives as a flat rejection at the worst moment: during an upgrade, a restore, or an exam task with a clock running.

Concepts

Deprecation warns, removal refuses: the API server prints warnings for deprecated versions while still serving them, then later versions drop them entirely. kubectl apply --dry-run=server surfaces warnings against your actual cluster. Release notes list removals per minor version; the exam expects you to know the famous ones (batch v1 for Jobs and CronJobs, autoscaling v2, policy v1 for PodDisruptionBudgets) and to convert the rest by reading schema.

Conversion is mechanical: change apiVersion, adjust renamed or restructured fields per kubectl explain on the new version, dry-run, diff, apply. Storage migration (the cluster rewriting stored objects) happens separately during upgrades and is the administrators' concern; your manifests just need to speak a served version.

Worked example

An old CronJob speaking a retired batch version, converted calmly:

# find it
grep -rn "batch/v1beta1" manifests/     # the suspect
# read the replacement shape from the cluster itself
kubectl explain cronjob.spec --api-version=batch/v1 | head -30
# convert: apiVersion batch/v1, jobTemplate unchanged in shape,
# schedule untouched, then validate the new file
kubectl apply --dry-run=server -f cronjob.yaml
kubectl diff -f cronjob.yaml || true
kubectl apply -f cronjob.yaml
kubectl get cronjob nightly-report -o yaml | grep apiVersion

The cluster's own explain output is the migration guide: fields that exist in the new version are legal, fields that do not are the rewrite list.

Exam notes

Serving warnings appear on stderr and in audit logs, not as apply failures: silence is not approval. Different clusters serve different versions, so the same manifest migrates on one cluster and breaks on another: always validate against the target. And CRDs version independently of built-ins: check the operator's docs, not the Kubernetes release notes, for those.

Quick check

A 4-question self-check. Your answers stay on your device, are never stored or sent. Only a passing score (for example 3 of 4) is saved, and only to unlock lesson progress: at least 3 correct is required before a lesson counts as complete. It never counts toward any certification assessment.

Lesson feedback

No published feedback yet.

Log in and complete the lesson to leave feedback.

Exercise

Find one deprecated apiVersion in a fictional manifest set, convert it field by field to the served version, and show the dry-run plus diff output that proves the conversion is behavior-preserving before applying.

Pass criteria

Deprecated version named with its replacement; converted manifest valid per dry-run; diff shows only version-level changes with no behavioral delta.

Sources

Log in to track progressFree account: stores only your lesson progress and quiz results.