cronjob
This commit is contained in:
parent
ca9fd7ba39
commit
5db72e2dc0
1 changed files with 43 additions and 0 deletions
|
@ -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: {}
|
Loading…
Reference in a new issue