Creating Your First AI Model Deployment
You'll learn: How to write a Kubernetes deployment manifest that runs your containerized AI model serving application in a production-ready way.
What Is a Deployment Manifest?
A Kubernetes deployment manifest is a YAML file that tells Kubernetes exactly how to run your containerized model. Think of it as a recipe card: it specifies which container image to use, how many copies (replicas) to run, what resources each needs, and how to keep them healthy.
While you've learned about Pods (single containers) and Services (networking), a Deployment manages multiple identical Pods automatically—restarting failed ones, scaling up or down, and performing rolling updates.
A Basic AI Model Deployment
Here's a minimal deployment manifest for a containerized model server:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-model-serving
spec:
replicas: 2
selector:
matchLabels:
app: model-server
template:
metadata:
labels:
app: model-server
spec:
containers:
- name: model-container
image: myregistry/my-model:v1.0
ports:
- containerPort: 8080
resources:
requests:
memory: "4Gi"
cpu: "1000m"
limits:
memory: "8Gi"
cpu: "2000m"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 10
This manifest creates 2 replicas of your model server, requests specific CPU/memory, and uses the health check endpoint you built into your container.
Why This Matters
Deployments handle the operational complexity: if a Pod crashes, Kubernetes automatically replaces it. When you update the image tag, it performs a rolling update—starting new Pods before stopping old ones, ensuring zero downtime.
Key Takeaway: A Kubernetes deployment manifest transforms your containerized model into a self-healing, scalable service that Kubernetes manages automatically, using declarative YAML to specify desired state rather than imperative commands.