In Kubernetes, a workload is an abstract model representing a group of pods (a group of containers). It can refer to any of the service entities, such as Deployment, StatefulSet, DaemonSet, Job, and CronJob. A workload is also known as a pod controller, which ensures that an expected number of pods of the desired type are running. Volcengine Kubernetes Engine (VKE) is built on native Kubernetes capabilities and supports full lifecycle management of container workloads.
Pods and workloads
A pod is the smallest deployable computing unit in Kubernetes. A pod encapsulates one or more containers, storage resources (volume), an independent network IP address, and policies for managing and controlling how containers run.
A workload is used for managing pods. A workload can manage one or more pods, and supports multi-version management, rolling updates, and automatic recovery capabilities. You can use workloads and pod templates to create pods that meet your business requirements.
Deployments
A Deployment can contain one or more pod replicas, each with the same role. The system automatically distributes requests among the multiple pod replicas in the Deployment.
A Deployment integrates the functionalities of deployment, rolling updates, replica creation, and rollback and enables unattended operations. This significantly reduces the complexity and operational risks during the deployment process. A Deployment is commonly used to deploy stateless applications. Compared to stateful applications, Deployments can enable automated and flexible scaling.
StatefulSets
Similar to Deployments, StatefulSets manage application deployment and scaling. Additionally, StatefulSets provide persistent storage and stable network identifiers for pods, enabling the deployment of stateful services such as databases, caches, and similar applications.
DaemonSets
A DaemonSet ensures that all (or some) Nodes run a copy of a pod. When nodes are added to the cluster, pods are added to them. When nodes are removed from the cluster, those pods will be reclaimed. Deleting a DaemonSet will delete all pods that it created. DaemonSets are node-specific. If a node becomes unavailable, the pods are not recreated on other nodes.
DaemonSet is applicable to foundational system-level applications such as log collection and resource monitoring. These applications need to run on every node and do not require many instances.
Jobs and CronJobs
Jobs and CronJobs manage batch processing of short-lived one-off tasks, executing them only once. They ensure the successful completion of one or more pods in batch jobs. Jobs and CronJobs are applicable to one-off tasks, such as those in continuous integration.
- Job: Controls batch jobs. Pods managed by a Job will automatically exit (and the pods will be deleted automatically) once they successfully complete the task as per the specified settings.
- CronJob: A CronJob is a time-based Job, similar to a Crontab expression on a Linux system, that runs the specified Job at the specified intervals.
Workload lifecycle description