1、job特性api
apiVersion: batch/v1併發
kind: Jobapp
medatada:spa
name: test-jobrest
spec:日誌
completions: 5 #須要運行的pod數量it
parallelism: 2 #容許併發運行的pod數量io
activeDeadlineSeconds: 360s #pod運行的超時時間 test
template:並行
medatada:
labels:
app: test-job
spec:
restartPolicy: OnFailure
containers:
- name: test-job
image: luksa/batch-job
3、cronjob定時計劃任務
apiVersion: batch/v1beta1
kind: Cronjob
medatada:
name: test-cronjob
spec:
schedule: "30 * * * *" #參考定時計劃任務(分時日月周)
startingDeadlineSeconds: 15 #pod必須在規定時間後的15秒內開始執行,若超過該時間未執行,則任務將不運行,且標記失敗
jobtemplate:
spec:
template:
labels:
app: test-cronjob
spec:
restartPolicy: OnFailure
containers:
- name: test-job
image: luksa/batch-job