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 apiVersion: batch/v1beta1
kind: Job kind: CronJob
metadata: metadata:
name: timestamp-job name: timestamp-cronjob
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec: 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