⒈DaemonSet介紹,什麼是DaemonSet數據庫
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: deamonset-example
labels:
app: daemonset
spec:
selector:
matchLabels:
name: deamonset-example
template:
metadata:
1abels:
name: deamonset-example
spec:
containers:
- name: daemonset-example
image: fanqisoft/myapp:v1
⒊Job介紹,什麼是Jobapi
apiVersion: batch/v1
kind: Job
metadata:
name:pi
spec:
template:
metadata:
name:pi
spec:
containers:
- name: pi
image: perl
command: ["per1","-Mbignum=bpi","-wle","print bpi(2000)"]
restartPolicy: Never
⒌CronJob併發
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: he11o
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
args:
- /bin/sh
- -c
- date;echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
⒏Cronjob自己的一些限制app
建立Job操做應該是冪等的spa
CronJob並不太好去判斷任務是否成功,CronJob經過建立Job去完成任務,Job成功與否能夠判斷,但CronJob沒法連接到Job去獲取成功與否,Cron只會按期的去建立Job,僅此而已。代理