From 881b65fcecf338537dbb404d36c19f00f2b124a9 Mon Sep 17 00:00:00 2001 From: miwr Date: Mon, 31 Mar 2025 10:19:39 +0200 Subject: [PATCH] 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 securityContext: runAsUser: 0 volumeMounts: - name: host-log mountPath: /var/log containers: - name: running-container image: busybox command: ["sleep", "infinity"] volumes: - name: host-log hostPath: path: /var/log type: Directory --- .../open-bao-logging-setup.yaml | 29 +++++++++++++++ .../create-logging-directory.yaml | 37 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 template/stacks/ref-implementation/open-bao-logging-setup.yaml create mode 100644 template/stacks/ref-implementation/openbao-logging/create-logging-directory.yaml diff --git a/template/stacks/ref-implementation/open-bao-logging-setup.yaml b/template/stacks/ref-implementation/open-bao-logging-setup.yaml new file mode 100644 index 0000000..5c26dc7 --- /dev/null +++ b/template/stacks/ref-implementation/open-bao-logging-setup.yaml @@ -0,0 +1,29 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: openbao-logging-setup + 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-logging" + 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 \ No newline at end of file diff --git a/template/stacks/ref-implementation/openbao-logging/create-logging-directory.yaml b/template/stacks/ref-implementation/openbao-logging/create-logging-directory.yaml new file mode 100644 index 0000000..b46e3c0 --- /dev/null +++ b/template/stacks/ref-implementation/openbao-logging/create-logging-directory.yaml @@ -0,0 +1,37 @@ +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 + securityContext: + runAsUser: 0 + volumeMounts: + - name: host-log + mountPath: /var/log + containers: + - name: running-container + image: busybox + command: ["sleep", "infinity"] + volumes: + - name: host-log + hostPath: + path: /var/log + type: Directory \ No newline at end of file