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

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
主站蜘蛛池模板: 宜州市| 东山县| 玉环县| 乌审旗| 巴彦淖尔市| 舞阳县| 宁晋县| 德化县| 壶关县| 连州市| 阿拉善盟| 弥勒县| 新平| 会理县| 阿瓦提县| 石泉县| 玉龙| 青龙| 乐平市| 新兴县| 衡阳县| 高州市| 青海省| 仁怀市| 余干县| 新巴尔虎左旗| 讷河市| 普格县| 岳西县| 鲁甸县| 同江市| 阜南县| 卫辉市| 泰来县| 如东县| 盘山县| 攀枝花市| 枞阳县| 平阴县| 灵宝市| 德令哈市|