What is a Deployment in AKS (Azure Kubernetes Service)?

A Deployment in AKS (or in Kubernetes in general) is a controller that manages the lifecycle of your application pods. It ensures that a defined number of replicas of your application are running at all times.

Why We Use a Deployment in AKS:

PurposeDescription
ScalingEasily scale your app up/down using kubectl scale or autoscaling.
Self-healingIf a pod crashes, the Deployment will automatically create a new one.
Rolling updatesYou can update your app without downtime using rolling updates.
Version controlSupports rollback to previous versions of your app.
Declarative configYou define your app state in YAML — Kubernetes ensures it stays that way.

Example Deployment YAML:

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: myregistry.azurecr.io/my-app:v1
ports:
- containerPort: 80

🔄 How It’s Better Than Just Running a Pod

FeaturePod (standalone)Deployment
Self-healing❌ No✅ Yes
Scaling❌ Manual (tedious)✅ Simple
Rolling update❌ Not supported✅ Built-in
Rollback❌ Not possible✅ Easy
Replica management❌ You create each manually✅ Managed automatically

💡 In Simple Terms:

A Deployment is like a manager in AKS that keeps your application healthy, updated, and always running exactly how you define it — no matter what happens behind the scenes.

Leave a Comment

Your email address will not be published. Required fields are marked *