diff --git a/template/stacks/ref-implementation/openbao-alloy-configmap.yaml b/template/stacks/ref-implementation/openbao-alloy-configmap.yaml new file mode 100644 index 0000000..9daa56a --- /dev/null +++ b/template/stacks/ref-implementation/openbao-alloy-configmap.yaml @@ -0,0 +1,29 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: openbao-alloy-configmap + namespace: argocd + labels: + env: dev + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://{{{ .Env.DOMAIN_GITEA }}}/giteaAdmin/edfbuilder + targetRevision: HEAD + path: "stacks/ref-implementation/openbao-alloy-configmap" + destination: + server: "https://kubernetes.default.svc" + namespace: openbao + syncPolicy: + syncOptions: + - CreateNamespace=true + automated: + selfHeal: true + retry: + limit: -1 + backoff: + duration: 15s + factor: 1 + maxDuration: 15s diff --git a/template/stacks/ref-implementation/openbao-alloy-configmap/sidecar-container-alloy-configmap.yaml b/template/stacks/ref-implementation/openbao-alloy-configmap/sidecar-container-alloy-configmap.yaml new file mode 100644 index 0000000..9a62c3f --- /dev/null +++ b/template/stacks/ref-implementation/openbao-alloy-configmap/sidecar-container-alloy-configmap.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: sidecar-container-alloy-config +data: + config.yaml: | + logging { + level = "info" + format = "logfmt" + } + + loki.write "local_loki" { + endpoint { + url = "http://loki-loki-distributed-gateway/loki/api/v1/push" + } + } + + discovery.kubernetes "pod" { + role = "pod" + } + + discovery.relabel "openbao_pod_logs" { + targets = discovery.kubernetes.pod.targets + + rule { + source_labels = ["__meta_kubernetes_pod_name"] + action = "keep" + regex = "openbao-0" + } + + 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 fd12825..41e08cb 100644 --- a/template/stacks/ref-implementation/openbao/values.yaml +++ b/template/stacks/ref-implementation/openbao/values.yaml @@ -1,4 +1,31 @@ server: + extraContainers: + - name: grafana-alloy + image: grafana/alloy:latest + ports: + - containerPort: 12345 + # volumeMounts: + # - name: sidecar-container-alloy-config + # mountPath: /etc/alloy/config.yaml + # subPath: config.yaml + # args: + # - --config.file=/etc/alloy/config.yaml + volumeMounts: + - name: alloy-data + mountPath: /var/lib/alloy/data + securityContext: + runAsUser: 1000 + fsGroup: 1000 + + volumes: + - name: alloy-data + emptyDir: {} + + # volumes: + # - name: sidecar-container-alloy-config + # configMap: + # name: sidecar-container-alloy-config + postStart: - sh - -c @@ -16,4 +43,4 @@ server: bao audit enable file file_path=stdout rm /tmp/init.txt ui: - enabled: true + enabled: true \ No newline at end of file