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

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
主站蜘蛛池模板: 丽江市| 白水县| 凤台县| 赣榆县| 缙云县| 盐亭县| 咸宁市| 浪卡子县| 托克托县| 封丘县| 河津市| 朝阳县| 东乡县| 黔江区| 定结县| 蒲城县| 沿河| 大冶市| 长岛县| 延川县| 措勤县| 丹棱县| 苍溪县| 阳春市| 石台县| 运城市| 绿春县| 昌邑市| 井陉县| 碌曲县| 潼南县| 利辛县| 澎湖县| 遂宁市| 三台县| 阳泉市| 宜州市| 平阴县| 合水县| 吴江市| 萨迦县|