should be done
This commit is contained in:
parent
7cc75f0095
commit
c9d72e9f90
5 changed files with 3 additions and 82 deletions
|
@ -1,31 +0,0 @@
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: DaemonSet
|
|
||||||
metadata:
|
|
||||||
name: logrotate-priviledges
|
|
||||||
namespace: openbao
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: logrotate-priviledges
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: logrotate-priviledges
|
|
||||||
spec:
|
|
||||||
initContainers:
|
|
||||||
- name: creator
|
|
||||||
image: alpine:latest
|
|
||||||
command: ["/bin/sh", "-c"]
|
|
||||||
args:
|
|
||||||
- |
|
|
||||||
set -e
|
|
||||||
echo "logrotate:x:100:100::/home/logrotate:/bin/sh" >> /etc/passwd
|
|
||||||
echo "logrotate:x:100:" >> /etc/group
|
|
||||||
chown logrotate:logrotate /var/lib
|
|
||||||
tail -f /dev/null
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 0
|
|
||||||
containers:
|
|
||||||
- name: running-container
|
|
||||||
image: busybox
|
|
||||||
command: ["sleep", "infinity"]
|
|
|
@ -5,13 +5,13 @@ metadata:
|
||||||
data:
|
data:
|
||||||
logrotate.conf: |
|
logrotate.conf: |
|
||||||
/openbao/logs/openbao/*.log {
|
/openbao/logs/openbao/*.log {
|
||||||
size 5k
|
size 100M
|
||||||
rotate 7
|
rotate 7
|
||||||
compress
|
compress
|
||||||
|
delaycompress
|
||||||
missingok
|
missingok
|
||||||
notifempty
|
notifempty
|
||||||
postrotate
|
postrotate
|
||||||
mkdir pupa
|
|
||||||
kill -SIGHUP $(pidof bao)
|
kill -SIGHUP $(pidof bao)
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
|
@ -1,25 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: sidecar-container-alloy-config
|
|
||||||
data:
|
|
||||||
config.alloy: |
|
|
||||||
logging {
|
|
||||||
level = "info"
|
|
||||||
format = "logfmt"
|
|
||||||
}
|
|
||||||
loki.write "local_loki" {
|
|
||||||
endpoint {
|
|
||||||
url = "http://loki-loki-distributed-gateway.monitoring.svc.cluster.local/loki/api/v1/push"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
local.file_match "applogs" {
|
|
||||||
path_targets = [{"__path__" = "/openbao/logs/*"}]
|
|
||||||
sync_period = "5s"
|
|
||||||
}
|
|
||||||
|
|
||||||
loki.source.file "openbao_logs" {
|
|
||||||
targets = local.file_match.applogs.targets
|
|
||||||
forward_to = [loki.write.local_loki.receiver]
|
|
||||||
}
|
|
|
@ -1,27 +1,11 @@
|
||||||
server:
|
server:
|
||||||
shareProcessNamespace: true
|
shareProcessNamespace: true
|
||||||
extraContainers:
|
extraContainers:
|
||||||
- name: grafana-alloy
|
|
||||||
image: grafana/alloy:latest
|
|
||||||
ports:
|
|
||||||
- containerPort: 12345
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 100
|
|
||||||
volumeMounts:
|
|
||||||
- name: alloy-data
|
|
||||||
mountPath: /var/lib/alloy
|
|
||||||
- name: config-volume
|
|
||||||
mountPath: /etc/alloy
|
|
||||||
- name: host-log-storage
|
|
||||||
mountPath: /openbao/logs
|
|
||||||
- name: logrotate
|
- name: logrotate
|
||||||
image: skymatic/logrotate:latest
|
image: skymatic/logrotate:latest # MIT License
|
||||||
# command: ["/bin/sh", "-c", "while true; do /usr/sbin/logrotate /etc/logrotate.conf; sleep 60; done"]
|
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 100
|
runAsUser: 100
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: alloy-data
|
|
||||||
mountPath: /var/lib/
|
|
||||||
- name: host-log-storage
|
- name: host-log-storage
|
||||||
mountPath: /openbao/logs
|
mountPath: /openbao/logs
|
||||||
- name: logrotate-config-volume
|
- name: logrotate-config-volume
|
||||||
|
@ -32,13 +16,6 @@ server:
|
||||||
mountPath: /etc/passwd
|
mountPath: /etc/passwd
|
||||||
subPath: passwd
|
subPath: passwd
|
||||||
volumes:
|
volumes:
|
||||||
- name: log-storage
|
|
||||||
emptyDir: {}
|
|
||||||
- name: alloy-data
|
|
||||||
emptyDir: {}
|
|
||||||
- name: config-volume
|
|
||||||
configMap:
|
|
||||||
name: sidecar-container-alloy-config
|
|
||||||
- name: logrotate-config-volume
|
- name: logrotate-config-volume
|
||||||
configMap:
|
configMap:
|
||||||
name: logrotate-config
|
name: logrotate-config
|
||||||
|
|
Loading…
Reference in a new issue