| Workload Type | Use Case | Kubernetes Object |
|---|---|---|
| Stateless | Web front-ends, application servers | Deployment |
| Stateful | Databases, distributed coordination | StatefulSet |
| Batch Jobs | Data processing, notification emails | Job |
| Daemons | Logging, monitoring, background agents | DaemonSet |
kubectl or via the Kubernetes API.


Stateless Applications
Stateless applications do not persist data internally; all session state is managed by clients or external services. They’re ideal for horizontal scaling and rolling updates.- Examples:
- NGINX
- Apache Tomcat
- Other web servers
- Primary object: Deployment
Stateful Applications
Stateful applications require persistent storage to retain data across restarts and replicas. Use PersistentVolumes and PersistentVolumeClaims for durable storage.- Examples:
- MongoDB
- Apache ZooKeeper
- Primary object: StatefulSet
StatefulSet guarantees that each pod is assigned the same name and storage on every restart, ensuring data consistency.


Batch Jobs
Batch jobs run to completion and are well suited for parallel, finite tasks.- Examples:
- Sending notification emails
- Video rendering
- Complex numerical computations
- Primary object: Job

Daemons
Daemon workloads run continuously on selected nodes to provide cluster-wide services.- Examples:
- Fluentd (log collection)
- Monitoring agents
- Primary object: DaemonSet
Imperative vs. Declarative Management
GKE offers both imperative and declarative methods for managing workload objects:-
Imperative Commands
Use one-offkubectl run,kubectl create, orkubectl deletecommands for quick changes and immediate feedback. -
Declarative Object Configuration
Store complete resource definitions in YAML and apply them withkubectl apply. Keep these files in version control for an audit trail. -
Directory-Based Declarative Configuration
Organize YAML files in directories and runkubectl apply --recursiveto apply updates across many resources. This scales well for large projects.
