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 }
This commit is contained in:
parent
5c197fd0f1
commit
278cf798f4
1 changed files with 55 additions and 0 deletions
|
@ -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
|
||||
}
|
Loading…
Reference in a new issue