From 278cf798f454b743a70b66f584ca2c99eb1ed935 Mon Sep 17 00:00:00 2001 From: miwr Date: Tue, 25 Mar 2025 13:52:55 +0100 Subject: [PATCH] apiVersion: v1 kind: ConfigMap metadata: name: openbao-logrotate-config namespace: openbao data: openbao: | /var/log/openbao/*.log { size 5k rotate 7 compress missingok notifempty postrotate kill -SIGHUP $(pidof bao) endscript } --- .../openbao-logging/logrotate.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 template/stacks/ref-implementation/openbao-logging/logrotate.yaml diff --git a/template/stacks/ref-implementation/openbao-logging/logrotate.yaml b/template/stacks/ref-implementation/openbao-logging/logrotate.yaml new file mode 100644 index 0000000..79ef774 --- /dev/null +++ b/template/stacks/ref-implementation/openbao-logging/logrotate.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: openbao-logrotate + namespace: openbao +spec: + selector: + matchLabels: + app: openbao-logrotate + template: + metadata: + labels: + app: openbao-logrotate + spec: + containers: + - name: logrotate + image: alpine + command: ["/bin/sh", "-c"] + args: + - | + apk add --no-cache logrotate + while true; do logrotate -f /etc/logrotate.d/openbao; sleep 3600; done + volumeMounts: + - name: logrotate-config + mountPath: /etc/logrotate.d/openbao + subPath: openbao + - name: host-log + mountPath: /var/log/openbao + volumes: + - name: logrotate-config + configMap: + name: openbao-logrotate-config + - name: host-log + hostPath: + path: /var/log + type: Directory +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + name: openbao-logrotate-config + namespace: openbao +data: + openbao: | + /var/log/openbao/*.log { + size 5k + rotate 7 + compress + missingok + notifempty + postrotate + kill -SIGHUP $(pidof bao) + endscript + } \ No newline at end of file