官术网_书友最值得收藏!

Job Pattern

The general use case of pods in Kubernetes is that they are used for long-running processes that are always up. To this aim, Kubernetes provides higher-level resources such as replication sets or deployments. These high-level resources manage the life cycles of pods by creating replicas, checking for health statuses, and controlling update mechanisms. On the other hand, there is a need for microservices that do one job and successfully exit upon completion. For instance, database initializations, backups, or converting a video should run once and exit without consuming any extra resources. For this requirement, Kubernetes provides a higher-level resource named Job. Kubernetes jobs represent an isolated work run until completion and are ideal for use cases that are required to only run once.

The most important difference between jobs and replication-controlled pods is the restartPolicy field:
  • For always running pods, the restartPolicy is set to Always
  • For jobs, the restartPolicy could be set as OnFailure or Never
主站蜘蛛池模板: 沁阳市| SHOW| 新绛县| 鹿泉市| 大洼县| 芷江| 乐陵市| 三穗县| 通海县| 天峨县| 六安市| 万安县| 兰西县| 凌海市| 神池县| 贵阳市| 绥芬河市| 延川县| 金门县| 绥德县| 锦屏县| 镇安县| 灵璧县| 紫金县| 温泉县| 安图县| 长岛县| 越西县| 拜城县| 葫芦岛市| 南通市| 来凤县| 台山市| 彰武县| 合水县| 炎陵县| 永安市| 万州区| 丽江市| 恩施市| 牡丹江市|