make it a cronjob
This commit is contained in:
parent
d6cac42438
commit
0137bb1953
1 changed files with 24 additions and 19 deletions
|
|
@ -1,22 +1,27 @@
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1beta1
|
||||||
kind: Job
|
kind: CronJob
|
||||||
metadata:
|
metadata:
|
||||||
name: timestamp-job
|
name: timestamp-cronjob
|
||||||
spec:
|
spec:
|
||||||
|
schedule: "*/1 * * * *"
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: timestamp-job
|
labels:
|
||||||
|
app: timestamp-job
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: timestamp-container
|
- name: timestamp-container
|
||||||
image: busybox
|
image: busybox
|
||||||
command: ["sh", "-c", "while true; do date >> /logs/runs.log; sleep 60; done"]
|
command: ["sh", "-c", "date >> /logs/runs.log"]
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: logs-volume
|
||||||
mountPath: /logs
|
mountPath: /logs
|
||||||
subPath: logs
|
subPath: logs
|
||||||
restartPolicy: Never
|
restartPolicy: OnFailure
|
||||||
volumes:
|
volumes:
|
||||||
- name: data
|
- name: logs-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: data
|
claimName: data
|
||||||
|
subPath: logs
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue