Skip to content

Commit fbdb394

Browse files
Update 8.Jobs.txt
1 parent edc45f6 commit fbdb394

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Kubernetes/Kubernetes Demo Files/8.Jobs.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,25 @@ kubectl get po
4949

5050

5151
*************************************************************************************************************************************************
52+
**************Cron Job***********************
53+
#cronjob.yaml
54+
apiVersion: batch/v1beta1
55+
kind: CronJob
56+
metadata:
57+
name: cronjob
58+
spec:
59+
schedule: "* * * * *"
60+
successfulJobsHistoryLimit: 2
61+
failedJobsHistoryLimit: 1
62+
suspend: true
63+
jobTemplate:
64+
spec:
65+
template:
66+
spec:
67+
containers:
68+
- name: busybox
69+
image: busybox
70+
command: ["echo", "Hello world"]
71+
restartPolicy: Never
5272

73+
kubectl create -f cronjob.yaml

0 commit comments

Comments
 (0)