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