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

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
主站蜘蛛池模板: 阜阳市| 郎溪县| 玉田县| 广水市| 威海市| 文水县| 新和县| 长垣县| 牙克石市| 南华县| 邹城市| 黄浦区| 湟源县| 弥渡县| 邢台市| 苍溪县| 平湖市| 麦盖提县| 松原市| 潢川县| 塔河县| 新昌县| 色达县| 迁西县| 右玉县| 隆安县| 威宁| 大同县| 邵阳县| 琼海市| 拉孜县| 迁安市| 克拉玛依市| 惠来县| 独山县| 汉中市| 龙胜| 大丰市| 吉水县| 怀宁县| 宁武县|