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

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
主站蜘蛛池模板: 营山县| 乡宁县| 南川市| 兴隆县| 法库县| 鄄城县| 古田县| 祁门县| 南雄市| 黎川县| 临安市| 木兰县| 平遥县| 玉田县| 西畴县| 肥城市| 明水县| 确山县| 建昌县| 观塘区| 阳山县| 龙川县| 大埔区| 河北区| 麻江县| 绥芬河市| 徐闻县| 永宁县| 烟台市| 邛崃市| 抚宁县| 东港市| 化隆| 闽侯县| 海丰县| 吉安县| 黎川县| 黑龙江省| 滁州市| 安国市| 怀柔区|