Lesson 04
Workload types
~3 min read
In Kubernetes, a workload is an application or service that you want to run on your cluster. Kubernetes provides several workload types that you can use to deploy and manage your applications:
Deployment
A Deployment is a workload type that manages a set of identical pods, ensuring that they are available and updated as needed. Deployments are commonly used for stateless applications, such as web servers, that can be scaled horizontally by adding or removing pods.
StatefulSet
A StatefulSet is a workload type that manages a set of pods that have a stable, unique identity and persistent storage. StatefulSets are similar to deployments but unlike deployments, a StatefulSet maintains a sticky identity for each of its Pods. StatefulSets are commonly used for stateful applications, such as databases, that require stable persistent storage.
DaemonSet
A DaemonSet is a workload type that ensures that a set of pods runs on each node in the cluster. DaemonSets are commonly used for system-level daemons, such as log collectors or monitoring agents, that need to run on every node.
Job
A Job is a workload type that manages a set of pods that perform a specific task and then terminate. Jobs are commonly used for batch processing, such as running data analysis or machine learning jobs.
CronJob
A CronJob is a workload type that creates Jobs on a recurring schedule, similar to the cron utility in Unix. CronJobs are commonly used for periodic tasks such as database backups, report generation, or sending scheduled emails.
Each workload type has its own set of configuration options that you can use to customize its behavior and performance. By using the appropriate workload type for your application, you can ensure that it runs reliably and efficiently on your Kubernetes cluster.