Kubernetes Jobs & Cronjobs | How it works
Вставка
- Опубліковано 7 вер 2024
- 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.
I have a question - Running 10 pods in parallel isn't going to help. What will help is running 10 pods where each Pod is processing a DIFFERENT batch/slice of data. How to do that?
Good and simple explanation
Very nice to explain and good guidance👍👏👏
Very Nice Explanation Sir
Good Explanation
Nicely explained
what if i want my pod should be terminated automatically and spin up when cron job starts
Here pod does not terminate and will re mail in completed state for some time and will be removed after some time. New pod will be created for next cron job trigger
@@techworldwithrajendra But in my case pod is being completed, we have cron job and what is happening, when job starts, will create a new pod, once it finish next day at 7 it is completed, again when cron starts, it will spin a new pod, technically it should terminate the previous one,
any suggestion on ttlsecondsafterfinished?