Inferensys

Glossary

Deployment

A Deployment is a Kubernetes resource object that provides declarative updates for Pods and ReplicaSets, managing the desired state for a replicated application.
DevOps engineer deploying LLM to production on laptop, Kubernetes dashboards visible, late night deployment session.
KUBERNETES RESOURCE

What is a Deployment?

In Kubernetes, a Deployment is a core resource object that provides declarative updates and lifecycle management for Pods and ReplicaSets.

A Deployment is a Kubernetes resource object that provides declarative updates for Pods and ReplicaSets, managing the desired state for a replicated application. It acts as a higher-level abstraction, automating the process of deploying, scaling, and updating containerized applications. By defining the desired state—such as the number of replicas and the container image version—the Deployment's controller continuously reconciles the actual cluster state to match this specification through a control loop.

The primary operational value of a Deployment is its management of update strategies, notably rolling updates and rollbacks. During a rolling update, it incrementally replaces old Pod instances with new ones, ensuring application availability and enabling automatic rollback if a failure is detected. This makes Deployments essential for implementing robust continuous delivery pipelines and maintaining the health of stateless services within a Kubernetes cluster.

KUBERNETES

Key Features of a Deployment

A Kubernetes Deployment is a declarative resource object that manages the desired state for a replicated application. It automates critical lifecycle operations for Pods and ReplicaSets.

01

Declarative State Management

A Deployment allows you to declare the desired state of your application—such as the number of replicas, container image, and resource limits—in a YAML manifest. The Kubernetes control plane continuously observes the cluster and executes a state reconciliation loop to ensure the actual state matches this declaration, automatically healing failed Pods.

02

Rolling Updates and Rollbacks

Deployments enable seamless application updates with zero downtime through rolling updates. The controller incrementally replaces old Pods with new ones, ensuring a subset of Pods remains available. If a new version fails health checks, the Deployment supports automated rollbacks to a previous, stable version, managed by its revision history.

  • Strategy Types: RollingUpdate (default) and Recreate.
  • Control Parameters: maxUnavailable, maxSurge.
03

Pod Template and Replica Management

The core of a Deployment is its Pod template, which defines the specification for the Pods it creates. The Deployment ensures a specified number of identical Pods (replicas) are running at all times by managing an underlying ReplicaSet. If a Pod crashes or is deleted, the ReplicaSet controller provisions a new one to satisfy the declared replica count.

04

Health Probes and Readiness Gates

Deployments rely on container health probes to determine Pod status during updates and rollbacks.

  • Liveness Probe: Determines if a container needs to be restarted.
  • Readiness Probe: Determines if a Pod is ready to receive traffic. A Pod that fails its readiness probe is removed from Service endpoints.

These probes are essential for the Horizontal Pod Autoscaler (HPA) to make accurate scaling decisions.

05

Resource Scaling and Autoscaling

Deployments are the primary resource targeted by Kubernetes autoscaling mechanisms. You can manually scale a Deployment by updating the replicas field. For automatic scaling, the Horizontal Pod Autoscaler (HPA) can be configured to adjust the replica count based on observed CPU/memory utilization or custom metrics, enabling elastic resource management.

06

Labels, Selectors, and Service Integration

Deployments use label selectors to identify the set of Pods they manage. This label system is fundamental for networking: a Kubernetes Service uses the same selector to create a stable network endpoint and load balance traffic across all Pods managed by the Deployment, providing a decoupled and resilient microservice architecture.

KUBERNETES

Deployment Update Strategies

A comparison of strategies for updating containerized applications in a Kubernetes deployment, focusing on their impact on availability, rollback capability, and operational complexity in edge AI environments.

StrategyDescriptionAvailability ImpactRollback SpeedResource OverheadEdge AI Suitability

Rolling Update

Incrementally replaces old Pods with new ones, controlled by maxUnavailable and maxSurge parameters.

Zero downtime (when configured correctly)

Fast (revert to previous ReplicaSet)

Low (no duplicate full-stack resources)

✅ Excellent (default, predictable, resource-efficient)

Recreate

Terminates all existing Pods before creating new ones.

Significant downtime during termination/recreation

Slow (requires full restart from previous image)

Low

❌ Poor (causes service interruption, unsuitable for continuous inference)

Blue/Green

Deploys a complete, parallel new environment (green) and switches traffic atomically from the old (blue).

Near-zero downtime during cutover

Instant (traffic switch back to blue)

High (requires 2x full-stack resources during deployment)

⚠️ Moderate (fast rollback is good; high resource cost is challenging for constrained edge nodes)

Canary

Deploys new version to a small subset of Pods/users, gradually increasing traffic based on metrics.

Minimal risk; impacts only canary subset

Fast (scale down canary, redirect traffic)

Moderate (requires traffic routing logic and monitoring)

✅ Excellent (ideal for testing new model versions with subset of edge devices)

A/B Testing

Similar to canary but splits traffic between versions for a longer period to compare business/user metrics.

None (both versions run concurrently)

N/A (strategic decision, not a technical rollback)

High (requires feature flagging and analytics)

⚠️ Moderate (useful for comparing model performance; adds significant orchestration complexity)

Shadow (Mirroring)

Deploys new version to receive a copy of live traffic without affecting responses; outputs are compared but not served.

None (live traffic unaffected)

Instant (simply terminate shadow pods)

High (2x compute for inference during test)

✅ Good (excellent for validating new model accuracy on real-world edge data without risk)

Progressive Delivery

An umbrella term combining canary deployments with automated, metric-driven promotion gates (e.g., using Flagger).

Minimal risk

Fast (automated rollback on metric violation)

High (requires sophisticated monitoring and service mesh)

⚠️ Moderate (powerful but complex; may be overkill for simple edge clusters)

KUBERNETES RESOURCE

Deployment in Edge AI Orchestration

A Deployment is a core Kubernetes API object that provides declarative updates for Pods and ReplicaSets, managing the desired state for a replicated application. In Edge AI, it orchestrates the lifecycle of model inference containers across a distributed fleet of devices.

01

Declarative Desired State

A Deployment's primary function is to declare the desired state of an application, such as the container image, number of replicas, and resource limits. The Kubernetes control plane's state reconciliation loop continuously works to match the actual cluster state to this declared specification. This is foundational to GitOps workflows, where the Deployment manifest in a Git repository serves as the single source of truth.

  • Key Fields: spec.replicas, spec.template (Pod spec), spec.selector.
  • Example: A Deployment manifest declares 10 replicas of an object detection model; Kubernetes schedules and maintains 10 Pods, restarting any that fail.
02

Rolling Updates and Rollbacks

Deployments enable sophisticated, automated update strategies crucial for zero-downtime model version upgrades on edge fleets. The rolling update strategy incrementally replaces old Pods with new ones, controlled by parameters like maxUnavailable and maxSurge. If a new version fails health checks, an automatic rollback to the previous stable version can be triggered.

  • Update Triggers: Changes to the Pod template (e.g., a new model image tag).
  • Versioned History: Kubernetes maintains a revision history of the Deployment, enabling rollback to any previous revision.
  • Edge Consideration: Updates must be staged and validated across heterogeneous device groups using canary deployments.
03

Integration with Edge AI Lifecycle

In Edge AI orchestration, a Deployment is rarely a standalone object. It integrates with other Kubernetes resources to manage the full model lifecycle:

  • ConfigMaps & Secrets: Inject model configuration, feature flags, and secure API keys into the inference Pod.
  • Horizontal Pod Autoscaler (HPA): Automatically scale the number of inference Pod replicas based on custom metrics like request latency or queue depth.
  • Service: Provides a stable network endpoint and load balancing for the dynamic set of inference Pods, both within the cluster and for external access.
  • Resource Limits: Critical for edge devices; Deployments define CPU/memory requests/limits to prevent resource starvation.
04

Node Selection & Topology Constraints

Edge environments consist of heterogeneous hardware (CPU, GPU, NPU). Deployments use node affinity/anti-affinity rules and tolerations to ensure inference Pods are scheduled on appropriate devices.

  • Node Affinity: requiredDuringSchedulingIgnoredDuringExecution rules force Pods onto nodes with specific labels (e.g., accelerator: nvidia-jetson).
  • Taints and Tolerations: A master node or a node reserved for system workloads may have a taint. Inference Pods must have a matching toleration to be scheduled there.
  • Pod Topology Spread Constraints: Used to spread Pods across failure domains (e.g., different physical edge locations) for high availability.
05

The Operator Pattern for Complex Workloads

For stateful, complex Edge AI applications (e.g., managing an on-device training pipeline), the basic Deployment may be insufficient. The Operator Pattern extends Kubernetes using Custom Resource Definitions (CRDs) and custom controllers. An "InferenceEngine" CRD, managed by a custom controller, can use Deployments as building blocks while adding domain-specific logic for model warming, hardware-specific compilation, and health checks beyond simple process liveliness.

  • Controller Logic: Watches for custom objects and creates/manages standard Kubernetes resources (like Deployments) in response.
  • Example: The Kubeflow Training Operator manages distributed training jobs, which are more complex than stateless inference.
06

Deployment vs. Other Workload Resources

Understanding when to use a Deployment versus other Kubernetes workload controllers is key to effective orchestration:

  • Deployment: Manages stateless, replicated applications. Provides rolling updates. Ideal for scalable model inference servers.
  • StatefulSet: For stateful applications requiring stable, unique network identifiers, persistent storage, and ordered deployment/scaling (e.g., a distributed vector database for edge agents).
  • DaemonSet: Ensures a copy of a Pod runs on all (or some) Nodes. Ideal for node-level monitoring agents, log collectors, or storage drivers on an edge fleet.
  • Job/CronJob: For finite, batch-execution tasks like one-time model batch inference or scheduled dataset cleanup.
DEPLOYMENT

Frequently Asked Questions

Essential questions about deploying and managing AI workloads on Kubernetes, focusing on declarative state management, scaling, and update strategies for production edge environments.

A Deployment is a Kubernetes resource object that provides declarative updates for Pods and ReplicaSets, managing the desired state for a replicated application. It works by defining a template for the Pods you want to run and the number of replicas. The Deployment controller continuously observes the cluster state and performs state reconciliation, taking actions like creating or terminating Pods to match the declared specification. It supports automated strategies for updating applications, such as rolling updates and canary deployments, and can roll back to a previous version if a deployment fails. This abstraction is fundamental for managing stateless applications, ensuring high availability and simplifying operational complexity in edge AI orchestration.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.