API maturity

StageStability
AlphaMay break anytime
BetaLikely stable, may change
GA (v1)Stable

kubectl

TaskCommand
List all API versionskubectl api-versions
List all resource types + versionskubectl api-resources
Check resource API versionkubectl explain deployment | head -5
Check nested fieldkubectl explain deployment.spec.strategy
Convert old manifest (plugin)kubectl convert -f old.yaml --output-version apps/v1
Validate against server APIkubectl apply -f manifest.yaml --dry-run=server

Common migrations

Old (Deprecated)Current
extensions/v1beta1 Deploymentapps/v1
apps/v1beta1 Deploymentapps/v1
extensions/v1beta1 Ingressnetworking.k8s.io/v1
networking.k8s.io/v1beta1 Ingressnetworking.k8s.io/v1
rbac.authorization.k8s.io/v1beta1rbac.authorization.k8s.io/v1
autoscaling/v2beta2 HPAautoscaling/v2
batch/v1beta1 CronJobbatch/v1

Before / after examples

Ingress: extensions/v1beta1networking.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/v2beta2autoscaling/v2

Only apiVersion changes; spec structure stays the same.

Exam gotchas

  • kubectl explain shows 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)