Submitting Jobs to Kubernetes

In general, the application is designed to be long-lived in the same way as the daemon process. A typical long-lived application opens the network port and keeps it running. It is required to keep running the application. If it fails, you will need to restart to recover the state. Therefore, using Kubernetes deployment is the best option for the long-lived application.

On the other hand, some applications are designed to be short-lived, such as a command script. It is expected to exit the application even if it is successful in order to finish the tasks. Therefore, a Kubernetes deployment is not the right choice, because a deployment tries to keep the process running.

No worries; Kubernetes also supports short-lived applications. You can submit a container as a Job or Scheduled Job, and Kubernetes will dispatch it to an appropriate node and execute your container. 

Kubernetes supports several types of Jobs:

  • Single Job
  • Repeatable Job
  • Parallel Job
  • Scheduled Job

The last one is also called a CronJob. Kubernetes supports these different types of Jobs that are used differently to pods to utilize your resources.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset