Рет қаралды 1,718
Kubernetes Jobs and types of Jobs
Kubernetes provides several controllers for managing pods. Like ReplicaSets, DaemonSets, StatefulSets, and Deployments. They ensure that their pods are always running. If a pod fails, the controller restarts it or reschedules it to another node to make sure the application the pods is hosting keeps running.
What if we do want the pod to terminate? Well, that is where Kubernetes Jobs come in
➤ Kubernetes Jobs
The main function of a job is to create one or more pods and tracks the success of pods. They ensure that the specified number of pods are completed successfully. When a specified number of successful runs of pods is completed, then the job is considered complete. Creating a Kubernetes Job, like other Kubernetes resources, is through a definition file
.
➤ Kubernetes CronJobs
CronJobs are for cluster tasks that need to be executed on a predefined schedule. They are useful for periodic and recurring tasks, like running backups, sending emails, or scheduling individual tasks for a specific time, such as when your cluster is likely to be idle.