
Table of Contents
Workload Planning
Before you deploy to GKE, identify which workload type best fits your application requirements:Stateless vs. Stateful
Stateless applications can scale horizontally without preserving local state.Stateful workloads require stable network identities and persistent storage.
Batch Jobs
Batch workloads run to completion, ideal for data processing or scheduled tasks.Use
CronJob for recurring batch tasks, e.g., nightly backups or ETL pipelines.DaemonSets
DaemonSets ensure one pod per node (or per subset of nodes), perfect for logging agents and metrics collectors.Node Taints and Tolerations
Taints and tolerations let you control which pods can schedule onto which nodes, improving resource utilization and workload isolation.
- Taint: Applied to a node to repel pods
- Toleration: Added to pod specs to allow scheduling onto tainted nodes
A pod without a matching toleration won’t schedule on a tainted node. Double-check your keys and effects.
Rolling Updates in GKE
Rolling updates ensure zero-downtime deployments by gradually replacing old pods with new versions.maxUnavailable: Pods that can be down during the updatemaxSurge: Additional pods to spin up above the desired replicas