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: spec:
template: schedule: "*/1 * * * *"
metadata: jobTemplate:
name: timestamp-job
spec: spec:
containers: template:
- name: timestamp-container metadata:
image: busybox labels:
command: ["sh", "-c", "while true; do date >> /logs/runs.log; sleep 60; done"] app: timestamp-job
volumeMounts: spec:
- name: data containers:
mountPath: /logs - name: timestamp-container
subPath: logs image: busybox
restartPolicy: Never command: ["sh", "-c", "date >> /logs/runs.log"]
volumes: volumeMounts:
- name: data - name: logs-volume
persistentVolumeClaim: mountPath: /logs
claimName: data subPath: logs
restartPolicy: OnFailure
volumes:
- name: logs-volume
persistentVolumeClaim:
claimName: data
subPath: logs