From 509a07b39d2a724bc35dfd030101fbd7aeed8162 Mon Sep 17 00:00:00 2001 From: miwr Date: Wed, 26 Mar 2025 14:58:55 +0100 Subject: [PATCH] configuration added --- template/stacks/monitoring/alloy/values.yaml | 24 ++++++++--------- .../sidecar-container-alloy-configmap.yaml | 26 ------------------- .../ref-implementation/openbao/values.yaml | 23 +--------------- 3 files changed, 12 insertions(+), 61 deletions(-) delete mode 100644 template/stacks/ref-implementation/openbao-logging/sidecar-container-alloy-configmap.yaml diff --git a/template/stacks/monitoring/alloy/values.yaml b/template/stacks/monitoring/alloy/values.yaml index d24bc06..24b1e60 100644 --- a/template/stacks/monitoring/alloy/values.yaml +++ b/template/stacks/monitoring/alloy/values.yaml @@ -1,12 +1,4 @@ alloy: - - extraPorts: - - name: "tcpsocket" - port: 1514 - targetPort: 1514 - protocol: "TCP" - appProtocol: "tcp" - uiPathPrefix: "/alloy" create: false @@ -80,11 +72,17 @@ alloy: } + local.file_match "openbao_file_logs" { + path_targets = [{"__path__" = "/openbao/logs/*"}] + sync_period = "5s" + } - loki.source.syslog "tcp_socket" { - listener { - address = "0.0.0.0:1514" - labels = { component = "loki.source.syslog", protocol = "tcp" } - } + loki.source.file "openbao_logs" { + targets = local.file_match.openbao_file_logs.output + forward_to = [loki.write.local_loki.receiver] + } + + loki.source.kubernetes "all_pod_logs" { + targets = discovery.relabel.pod_logs.output forward_to = [loki.write.local_loki.receiver] } \ No newline at end of file diff --git a/template/stacks/ref-implementation/openbao-logging/sidecar-container-alloy-configmap.yaml b/template/stacks/ref-implementation/openbao-logging/sidecar-container-alloy-configmap.yaml deleted file mode 100644 index 1b89a78..0000000 --- a/template/stacks/ref-implementation/openbao-logging/sidecar-container-alloy-configmap.yaml +++ /dev/null @@ -1,26 +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] -# } \ No newline at end of file diff --git a/template/stacks/ref-implementation/openbao/values.yaml b/template/stacks/ref-implementation/openbao/values.yaml index 233b44d..8c973fd 100644 --- a/template/stacks/ref-implementation/openbao/values.yaml +++ b/template/stacks/ref-implementation/openbao/values.yaml @@ -1,25 +1,5 @@ -server: - # 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 - +server: volumes: - # - name: alloy-data - # emptyDir: {} - # - name: config-volume - # configMap: - # name: sidecar-container-alloy-config - name: host-log-storage hostPath: path: /var/log @@ -46,7 +26,6 @@ server: echo $(grep "Unseal Key 5:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key5.txt bao login $(grep "Initial Root Token:" /tmp/init.txt | awk '{print $NF}') rm /tmp/init.txt - bao audit enable -path="stdout" file file_path=stdout bao audit enable -path="file" file file_path=/openbao/logs/openbao/openbao.log ui: enabled: true \ No newline at end of file