45 lines
No EOL
1.1 KiB
YAML
45 lines
No EOL
1.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: openbao-logging-dir
|
|
namespace: openbao
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: openbao-logging-dir
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: openbao-logging-dir
|
|
spec:
|
|
initContainers:
|
|
- name: creator
|
|
image: busybox
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
set -e
|
|
mkdir -p /var/log/openbao
|
|
chown 100:100 /var/log/openbao
|
|
chown 100:100 /etc/passwd
|
|
chmod o+rwx /var/log/openbao
|
|
echo "logrotate:x:100:100::/home/logrotate:/bin/sh" >> /etc/passwd
|
|
echo "logrotate:x:100:" >> /etc/group
|
|
mkdir -p /home/logrotate
|
|
# chown 100:100 /var/lib
|
|
securityContext:
|
|
runAsUser: 0
|
|
volumeMounts:
|
|
- name: host-log
|
|
mountPath: /var/log
|
|
containers:
|
|
- name: running-container
|
|
image: busybox
|
|
command: ["sleep", "infinity"]
|
|
securityContext:
|
|
runAsUser: 0
|
|
volumes:
|
|
- name: host-log
|
|
hostPath:
|
|
path: /var/log
|
|
type: Directory |