In this video, you will learn how API deprecation works in Kubernetes and how CKAD tests this concept with practical tasks.
You will also see how to install and use kubectl convert to migrate old manifests to supported apiVersions using a realistic exam-style example.
Kubernetes evolves quickly, so older API versions (like extensions/v1beta1 or apps/v1beta1) are marked as deprecated and later removed.
When a deprecated API is finally removed in newer cluster versions, manifests using that API will fail to apply, which can break workloads and deployments.
In the CKAD exam, you may receive a YAML manifest using a deprecated apiVersion and be asked to migrate it to a supported version and create the resource successfully.
Typical examples include Deployments, Ingress, or CronJobs that use beta or legacy APIs that must be converted to their GA counterparts like apps/v1 or batch/v1.
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
kubectl version --client
The Kubernetes documentation provides equivalent commands for macOS and Windows, including package managers like brew, chocolatey, or winget.
From Kubernetes 1.20+, kubectl convert is distributed as a separate plugin under the krew plugin ecosystem or as a standalone binary.
kubectl krew install convert
kubectl convert --help
Download the kubectl-convert binary matching your OS and architecture from the official Kubernetes release artifacts and place it in your PATH.
“An existing application uses a Deployment manifest stored at /opt/CKAD/deprecated/deploy-nginx.yaml that relies on a deprecated API version.
Update the manifest to use a supported API version and successfully create the Deployment in the ckad namespace.”
This mirrors real exam scenarios where only the apiVersion and related fields need updates, not a full redesign of the resource.
cd /opt/CKAD/deprecated
cat deploy-nginx.yaml
kubectl convert -f deploy-nginx.yaml --output-version=apps/v1 -o yaml > deploy-nginx-v1.yaml
- -f deploy-nginx.yaml: Input file.
- --output-version=apps/v1: Target API version.
- -o yaml > deploy-nginx-v1.yaml: Save the converted YAML to a new file.
The convert tool updates fields that have changed between versions, such as spec.selector or pod template labels for Deployments.
cat deploy-nginx-v1.yaml
Emphasize that in CKAD, verifying labels and selectors is important to avoid subtle mistakes that make the Deployment not manage the Pods correctly.
kubectl create namespace ckad
kubectl apply -f deploy-nginx-v1.yaml -n ckad
kubectl get deploy -n ckad
kubectl get pods -n ckad -o wide
bash
cat /path/to/deprecated.yaml
kubectl convert -f /path/to/deprecated.yaml --output-version=apps/v1 -o yaml > /path/to/new.yaml
kubectl create namespace ckad
kubectl apply -f /path/to/new.yaml -n ckad
kubectl get all -n ckad