This commit is contained in:
miwr 2025-04-02 10:43:10 +02:00
parent ca9fd7ba39
commit 5db72e2dc0

View file

@ -0,0 +1,43 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: example-cronjob
namespace: openbao
spec:
schedule: "*/2 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: logrotate
image: skymatic/logrotate:latest
securityContext:
runAsUser: 100
command: ["/bin/sh", "-c", "logrotate /etc/logrotate.conf"]
volumeMounts:
- name: host-log-storage
mountPath: /openbao/logs
- name: logrotate-config-volume
mountPath: /etc/logrotate.conf
subPath: logrotate.conf
readOnly: true
- name: passwd-volume
mountPath: /etc/passwd
subPath: passwd
- name: status
mountPath: /var/lib
restartPolicy: OnFailure
volumes:
- name: host-log-storage
hostPath:
path: /var/log
type: Directory
- name: logrotate-config-volume
configMap:
name: logrotate-config
- name: passwd-volume
configMap:
name: passwd-user-configmap
- name: status
emptyDir: {}