diff --git a/template/stacks/ref-implementation/openbao-logging/logrotate-cronjob.yaml b/template/stacks/ref-implementation/openbao-logging/logrotate-cronjob.yaml new file mode 100644 index 0000000..12ff152 --- /dev/null +++ b/template/stacks/ref-implementation/openbao-logging/logrotate-cronjob.yaml @@ -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: {} \ No newline at end of file