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.

PatternKubernetes ResourceUse When
Stateless web appDeployment + Service + IngressHTTP APIs, frontends, microservices
Stateful appStatefulSet + Headless Service + PVCDatabases, caches with persistence, message brokers
Background workerDeployment (no Service)Queue consumers, event processors, stream readers
Batch processingCronJobScheduled 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 TypeLifecyclePod IdentityScaling ModelStorage ModelTypical Use
DeploymentLong-runningInterchangeableHorizontal replicasShared or noneWeb servers, APIs, stateless microservices
StatefulSetLong-runningStable, orderedOrdered horizontalPer-pod persistentDatabases, message queues, distributed consensus
DaemonSetLong-runningOne per nodeTied to node countNode-localLog collectors, monitoring agents, network plugins
JobRun to completionDisposableParallel completionsEphemeralBatch processing, migrations, one-time tasks
CronJobScheduledDisposablePer-schedule runEphemeralPeriodic backups, cleanup, scheduled reports
ReplicaSetLong-runningInterchangeableHorizontal replicasShared or noneAlmost never used directly

Decision Criteria#

The choice comes down to four questions: