赞
踩
apiVersion: batch/v1 kind: Job metadata: name: test-job spec: completions: 6 # 需要运行的pod数量 parallelism: 2 # 允许并发运行的pod数量 activeDeadlineSeconds: 360 # pod运行的超时时间 template: metadata: labels: app: test-job spec: containers: - name: test-job image: luksa/batch-job imagePullPolicy: IfNotPresent restartPolicy: OnFailure
apiVersion: batch/v1
kind: Job
metadata:
name: busybox
spec:
completions: 3
template:
metadata:
name: busybox
spec:
containers:
- name: busybox
image: busybox
command: ["echo", "hello"]
restartPolicy: Never
[root@k8s-master job]# kubectl get pods
NAME READY STATUS RESTARTS AGE
busybox-4cjq7 0/1 Completed 0 40s
busybox-79x79 0/1 Completed 0 22s
busybox-frk5t 0/1 Completed 0 52s
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。