Kubernetes
Deployment
apps/v1beta1
extensions/v1beta1
API versions

When I use Deployment in Kubernetes, what's the differences between apps/v1beta1 and extensions/v1beta1?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

extensions/v1beta1 and apps/v1beta1 were older Kubernetes Deployment APIs used before the stable apps/v1 version became standard. Today, both beta versions are deprecated and removed in modern clusters. Understanding the differences still matters when migrating legacy manifests and debugging old repositories.

Historical Context

Deployment resource history in simplified order:

  • early Deployment definitions in extensions/v1beta1
  • migration into apps API group as Kubernetes API domains matured
  • stabilization in apps/v1

From Kubernetes 1.16 onward, many beta APIs including these Deployment variants were removed from default availability. In practical terms, modern clusters should use only apps/v1 for Deployments.

Why Two Beta API Groups Existed

The extensions group originally hosted several evolving resources. As Kubernetes matured, resources were reorganized into purpose-specific groups. Deployment moved under the apps group to align with other workload controllers.

This shift was not only naming; it signaled API stabilization direction and clearer ownership of workload APIs.

Practical Difference for Migration

The most important migration concern is not choosing between two beta APIs today. It is moving from either beta API to apps/v1 correctly.

A critical apps/v1 requirement is explicit selector behavior:

  • spec.selector must be defined
  • selector labels must match pod template labels
  • mismatches cause validation errors or rollout issues

Legacy Manifest Example

Older style manifests could look like this:

yaml
1apiVersion: extensions/v1beta1
2kind: Deployment
3metadata:
4  name: web
5spec:
6  replicas: 2
7  template:
8    metadata:
9      labels:
10        app: web
11    spec:
12      containers:
13        - name: nginx
14          image: nginx:1.25

This may fail on modern clusters because apiVersion is obsolete.

Modern apps/v1 Manifest Example

yaml
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4  name: web
5spec:
6  replicas: 2
7  selector:
8    matchLabels:
9      app: web
10  template:
11    metadata:
12      labels:
13        app: web
14    spec:
15      containers:
16        - name: nginx
17          image: nginx:1.25

This is the expected format for current Kubernetes versions.

Migration Workflow

A safe migration checklist:

  1. update apiVersion to apps/v1
  2. add spec.selector.matchLabels
  3. ensure selector labels exactly match template labels
  4. validate with server-side dry run
  5. deploy to staging first

Validation command example:

bash
kubectl apply --dry-run=server -f deployment.yaml

Server dry run catches schema incompatibilities early.

Tooling Notes

If using Helm or Kustomize, ensure templates no longer render beta Deployment APIs. Old charts can still carry stale apiVersions even when cluster supports only stable APIs.

Also review CI linters and policy checks so deprecated APIs are blocked before merge.

Migration Validation Commands

After updating manifests, verify both schema and rollout behavior. Useful checks include:

bash
1kubectl apply --dry-run=server -f deployment.yaml
2kubectl diff -f deployment.yaml
3kubectl apply -f deployment.yaml
4kubectl rollout status deployment/web

This sequence confirms API compatibility, shows expected object changes, and validates that the updated Deployment reaches a healthy state.

Operational Impact of Staying on Old APIs

If you keep obsolete manifests in source control:

  • cluster upgrades can fail deployment pipelines suddenly
  • new team members may copy invalid examples
  • security and compliance scanning becomes noisier

Cleaning legacy apiVersions is a reliability task, not only style work.

Common Pitfalls

  • Treating apps/v1beta1 as valid on modern clusters.
  • Migrating apiVersion but forgetting explicit selector rules.
  • Having selector labels different from pod template labels.
  • Updating manifests manually without server-side validation.
  • Leaving old examples in docs and templates after migration.

Summary

  • Both extensions/v1beta1 and apps/v1beta1 are legacy Deployment APIs.
  • Modern Kubernetes should use apps/v1 for Deployments.
  • Migration success depends on correct selector and label alignment.
  • Validate manifests with server-side dry runs before rollout.
  • Remove stale beta examples from charts and repository templates.

Course illustration
Course illustration

All Rights Reserved.