-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcronjob.yml
37 lines (36 loc) · 832 Bytes
/
cronjob.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
apiVersion: batch/v1
kind: CronJob
metadata:
name: vpn
namespace: vpn
labels:
app: vpn
spec:
schedule: "0 * * * *"
successfulJobsHistoryLimit: 0
failedJobsHistoryLimit: 1
jobTemplate:
metadata:
labels:
app: vpn
spec:
template:
metadata:
labels:
app: vpn
spec:
nodeSelector:
kubernetes.io/os: linux
containers:
- name: cleanup
image: curlimages/curl
imagePullPolicy: IfNotPresent
command:
- curl
- -s
- http://vpn/cleanup
restartPolicy: OnFailure
# kubectl create job --from=cronjob/vpn vpn-manual-001
# kubectl get po -l job-name=vpn-manual-001
# kubectl logs -l job-name=vpn-manual-001
# kubectl delete job vpn-manual-001