make it a cronjob

This commit is contained in:
Waylon Walker 2024-02-12 09:24:03 -06:00
parent d6cac42438
commit 0137bb1953
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4

View file

@ -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