k8s 中使用job
apiVersion: batch/v1
kind: Job
metadata:
annotations:
batch.kubernetes.io/job-tracking: ""
labels:
job-name: jobcurl
name: jobcurl
namespace: application
spec:
backoffLimit: 2
completions: 500
parallelism: 20
activeDeadlineSeconds : 10
selector:
matchLabels:
job-name: jobcurl
template:
metadata:
labels:
job-name: jobcurl
spec:
containers:
- command:
- /bin/sh
args:
- -c
- curl web/httpbin/get
image: radial/busyboxplus:curl
imagePullPolicy: IfNotPresent
name: curl
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30