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
|
||||
kind: Job
|
||||
apiVersion: batch/v1beta1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: timestamp-job
|
||||
name: timestamp-cronjob
|
||||
spec:
|
||||
schedule: "*/1 * * * *"
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: timestamp-job
|
||||
labels:
|
||||
app: timestamp-job
|
||||
spec:
|
||||
containers:
|
||||
- name: timestamp-container
|
||||
image: busybox
|
||||
command: ["sh", "-c", "while true; do date >> /logs/runs.log; sleep 60; done"]
|
||||
command: ["sh", "-c", "date >> /logs/runs.log"]
|
||||
volumeMounts:
|
||||
- name: data
|
||||
- name: logs-volume
|
||||
mountPath: /logs
|
||||
subPath: logs
|
||||
restartPolicy: Never
|
||||
restartPolicy: OnFailure
|
||||
volumes:
|
||||
- name: data
|
||||
- name: logs-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: data
|
||||
subPath: logs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue