loading...
Cover image for Kubernetes Patterns - The Batch Job Pattern

Kubernetes Patterns - The Batch Job Pattern

ahmedat71538826 profile image Ahmed Atef Originally published at magalix.com ・1 min read

Kubernetes Patterns (8 Part Series)

1) Kubernetes Patterns : The DaemonService Pattern 2) Kubernetes Patterns : The Stateful Service Pattern 3 ... 6 3) Kubernetes Patterns : The Stateful Service Pattern 4) Kubernetes Patterns : The Stateful Service Pattern 5) Kubernetes Patterns : The Cron Job Pattern 6) Kubernetes Patterns - The Batch Job Pattern 7) Kubernetes Patterns : The Reflection Pattern 8) Kubernetes Patterns : The Ambassador Pattern

Pods Common Pattern

A Pod may host one or more containers in which all of them are treated as one unit. There are several ways available to create Pods. For example:

Naked Pods: These are the Pods that you can create directly through a definition file. In general, this is not a recommended practice because a controller does not manage the created Pods. If the Pod is terminated or the node crashed, it will not restart or reschedule on a different node.
ReplicaSet: This controller is suitable for Pods that need to run continuously. It can restart when it fails. For example, web servers and APIs.
DaemonSets: This can be used to run Pods continuously. Also, it ensures that they run on every node of the cluster. A typical scenario for using DaemonSets is when you want to collect logs from the cluster nodes and send them to a log aggregator such as ElasticSearch.
As you can see, the typical pattern here is trying to have the Pod running at all times. This pattern is a common one: you always want your service to continue responding to requests. However, in some cases, you need the container to run once and then get terminated.

For More infomration about the Batch Job see: https://www.magalix.com/blog/kubernetes-patterns-the-batch-job-pattern

Kubernetes Patterns (8 Part Series)

1) Kubernetes Patterns : The DaemonService Pattern 2) Kubernetes Patterns : The Stateful Service Pattern 3 ... 6 3) Kubernetes Patterns : The Stateful Service Pattern 4) Kubernetes Patterns : The Stateful Service Pattern 5) Kubernetes Patterns : The Cron Job Pattern 6) Kubernetes Patterns - The Batch Job Pattern 7) Kubernetes Patterns : The Reflection Pattern 8) Kubernetes Patterns : The Ambassador Pattern

Posted on by:

Discussion

markdown guide