/openbao/logs/alive/main.alive

This commit is contained in:
miwr 2025-03-20 16:03:21 +01:00
parent d21c543f2c
commit 3937c98d00
4 changed files with 3 additions and 116 deletions

View file

@ -72,28 +72,7 @@ alloy:
}
discovery.relabel "openbao_pod_logs" {
targets = discovery.kubernetes.pod.targets
rule {
source_labels = ["__meta_kubernetes_pod_name"]
action = "keep"
regex = "openbao-0"
}
}
loki.source.kubernetes "all_pod_logs" {
targets = discovery.relabel.pod_logs.output
forward_to = [loki.write.local_loki.receiver]
}
local.file_match "openbao_file_logs" {
path_targets = [{"__path__" = "/var/log/*"}]
sync_period = "5s"
}
loki.source.file "openbao_logs" {
targets = local.file_match.openbao_file_logs.targets
forward_to = [loki.write.local_loki.receiver]
}

View file

@ -23,7 +23,7 @@ spec:
targetRevision: HEAD
helm:
valueFiles:
- $values/stacks/ref-implementation/openbao/values.yaml
- $values/stacks/ref-implementation/openbao/values.yaml
- repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder
targetRevision: HEAD
ref: values

View file

@ -2,6 +2,7 @@ server:
extraContainers:
- name: grafana-alloy
image: grafana/alloy:latest
command: ["/bin/sh", "-c", "while [ -f /openbao/logs/alive/main.alive ]; do sleep 5; done; echo 'Main container exited, waiting 20s'; sleep 20; exit 1"]
ports:
- containerPort: 12345
securityContext:
@ -32,6 +33,7 @@ server:
- sh
- -c
- |
trap 'rm -f /openbao/logs/alive/main.alive; exit 0' TERM; touch /openbao/logs/alive/main.alive; sleep infinity
sleep 10
bao operator init >> /tmp/init.txt
cat /tmp/init.txt | grep "Key " | awk '{print $NF}' | xargs -I{} bao operator unseal {}