K8S中的job和CronJob

Job

介绍

Kubernetes jobs主要是针对短时和批量的工作负载。它是为了结束而运行的,而不是像deployment、replicasets、replication controllers和DaemonSets等其他对象那样持续运行。

示例

apiVersion: batch/v1
kind: Job
metadata:
  name: pi

spec:

  template:
    spec:
      restartPolicy: Never
      containers:
        - name: pi
          image: perl
          command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]

          

你可能感兴趣的:(Kubernetes,kubernetes,容器,云原生)