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.

КОМЕНТАРІ • 9

  • @adityahpatel
    @adityahpatel 6 місяців тому +1

    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?

  • @niteshb4832
    @niteshb4832 10 місяців тому

    Good and simple explanation

  • @dipalibadadhe8930
    @dipalibadadhe8930 10 місяців тому

    Very nice to explain and good guidance👍👏👏

  • @deepakranjanmishra5641
    @deepakranjanmishra5641 10 місяців тому

    Very Nice Explanation Sir

  • @dadasahebkale880
    @dadasahebkale880 10 місяців тому

    Good Explanation

  • @jac6963
    @jac6963 10 місяців тому

    Nicely explained

  • @AbhayAR
    @AbhayAR 8 місяців тому

    what if i want my pod should be terminated automatically and spin up when cron job starts

    • @techworldwithrajendra
      @techworldwithrajendra  8 місяців тому

      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

    • @AbhayAR
      @AbhayAR 8 місяців тому

      @@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?