- Deprecated → warning, object still created
- Removed → error, object not created
- Fix: update
apiVersionper Deprecated API Migration Guide
API maturity
| Stage | Stability |
|---|---|
| Alpha | May break anytime |
| Beta | Likely stable, may change |
GA (v1) | Stable |
kubectl
| Task | Command |
|---|---|
| List all API versions | kubectl api-versions |
| List all resource types + versions | kubectl api-resources |
| Check resource API version | kubectl explain deployment | head -5 |
| Check nested field | kubectl explain deployment.spec.strategy |
| Convert old manifest (plugin) | kubectl convert -f old.yaml --output-version apps/v1 |
| Validate against server API | kubectl apply -f manifest.yaml --dry-run=server |
Common migrations
| Old (Deprecated) | Current |
|---|---|
extensions/v1beta1 Deployment | apps/v1 |
apps/v1beta1 Deployment | apps/v1 |
extensions/v1beta1 Ingress | networking.k8s.io/v1 |
networking.k8s.io/v1beta1 Ingress | networking.k8s.io/v1 |
rbac.authorization.k8s.io/v1beta1 | rbac.authorization.k8s.io/v1 |
autoscaling/v2beta2 HPA | autoscaling/v2 |
batch/v1beta1 CronJob | batch/v1 |
Before / after examples
Ingress: extensions/v1beta1 → networking.k8s.io/v1
# BEFORE (removed in k8s 1.22)
apiVersion: extensions/v1beta1
kind: Ingress
spec:
rules:
- http:
paths:
- path: /api
backend:
serviceName: api-svc # old field
servicePort: 80 # old field
# AFTER (current)
apiVersion: networking.k8s.io/v1
kind: Ingress
spec:
rules:
- http:
paths:
- path: /api
pathType: Prefix # NEW required field
backend:
service:
name: api-svc # restructured
port:
number: 80
HPA: autoscaling/v2beta2 → autoscaling/v2
Only apiVersion changes; spec structure stays the same.
Exam gotchas
kubectl explainshows exact apiVersion and field structure: use in-exam to verify- Warning on apply → still works but fix before upgrade
- Error on apply → API removed: must change version + sometimes field names (see Ingress above)