Minikube Application Deployment Patterns: Production-Ready Manifests for Four Common Workloads

Choosing the Right Workload Type#

Every application fits one of four deployment patterns. Choosing the wrong one creates problems that are hard to fix later – a database deployed as a Deployment loses data on reschedule, a batch job deployed as a Deployment wastes resources running 24/7.

Pattern Kubernetes Resource Use When
Stateless web app Deployment + Service + Ingress HTTP APIs, frontends, microservices
Stateful app StatefulSet + Headless Service + PVC Databases, caches with persistence, message brokers
Background worker Deployment (no Service) Queue consumers, event processors, stream readers
Batch processing CronJob Scheduled reports, data cleanup, periodic syncs

Pattern 1: Stateless Web App#

A web API that can be scaled horizontally with no persistent state. Any pod can handle any request.

Choosing Kubernetes Workload Types: Deployment vs StatefulSet vs DaemonSet vs Job

Choosing Kubernetes Workload Types#

Kubernetes provides several workload controllers, each designed for a specific class of application behavior. Choosing the wrong one leads to data loss, unnecessary complexity, or workloads that fight the platform instead of leveraging it. This guide walks through the decision criteria and tradeoffs for each type.

The Workload Types at a Glance#

Workload Type Lifecycle Pod Identity Scaling Model Storage Model Typical Use
Deployment Long-running Interchangeable Horizontal replicas Shared or none Web servers, APIs, stateless microservices
StatefulSet Long-running Stable, ordered Ordered horizontal Per-pod persistent Databases, message queues, distributed consensus
DaemonSet Long-running One per node Tied to node count Node-local Log collectors, monitoring agents, network plugins
Job Run to completion Disposable Parallel completions Ephemeral Batch processing, migrations, one-time tasks
CronJob Scheduled Disposable Per-schedule run Ephemeral Periodic backups, cleanup, scheduled reports
ReplicaSet Long-running Interchangeable Horizontal replicas Shared or none Almost never used directly

Decision Criteria#

The choice comes down to four questions: