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

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
主站蜘蛛池模板: 荥经县| 曲周县| 格尔木市| 集贤县| 普洱| 新密市| 高要市| 新巴尔虎右旗| 方正县| 呼图壁县| 花莲县| 平顶山市| 岳普湖县| 宣汉县| 常山县| 诏安县| 陈巴尔虎旗| 连州市| 田东县| 米林县| 拉孜县| 磐安县| 饶平县| 汉中市| 惠州市| 绥阳县| 天祝| 嵊泗县| 郑州市| 天等县| 秦皇岛市| 太白县| 徐水县| 南通市| 德保县| 蓝山县| 固安县| 衡阳县| 安达市| 万山特区| 枞阳县|