From 8281c6eef75721e136f15141f429cc69ab12d030 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Wed, 16 Apr 2025 06:35:51 +0800 Subject: [PATCH] feat: add volume mounts for log ingestion in OpenTelemetry and deployment configurations Signed-off-by: zhenyus --- .../templates/authentication/deployment.yaml | 11 ++++++++++- .../templates/authentication/opentelemetry.yaml | 10 +++++----- freeleaps/helm-pkg/authentication/values.alpha.yaml | 1 + freeleaps/helm-pkg/authentication/values.yaml | 1 + 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml index e73acb31..e824b9e7 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml @@ -101,4 +101,13 @@ spec: name: authentication-config key: {{ $key | snakecase | upper }} {{- end }} - +{{- if .Values.logIngest.enabled }} + volumeMounts: + - name: app-logs + mountPath: {{ .Values.logIngest.logPath }} +{{- end }} + volumes: +{{- if .Values.logIngest.enabled }} + - name: app-logs + emptyDir: {} +{{- end }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml index a0b77a18..24a44dfa 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml @@ -8,6 +8,9 @@ spec: mode: sidecar image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest serviceAccount: "{{ .Release.Name }}-otel-collector" + volumeMounts: + - name: app-logs + mountPath: {{ .Values.logIngest.logPath }} config: receivers: filelog: @@ -16,7 +19,6 @@ spec: start_at: beginning include_file_path: true include_file_name: true - processors: k8sattributes: auth_type: "serviceAccount" @@ -52,16 +54,14 @@ spec: value: json batch: send_batch_size: 1000 - timeout: 10s - + timeout: 10s exporters: loki: endpoint: {{ .Values.logIngest.lokiEndpoint }} tls: insecure: true debug: - verbosity: detailed - + verbosity: detailed service: telemetry: logs: diff --git a/freeleaps/helm-pkg/authentication/values.alpha.yaml b/freeleaps/helm-pkg/authentication/values.alpha.yaml index 5479be17..d1625591 100644 --- a/freeleaps/helm-pkg/authentication/values.alpha.yaml +++ b/freeleaps/helm-pkg/authentication/values.alpha.yaml @@ -8,6 +8,7 @@ logIngest: enabled: true lokiEndpoint: http://loki-gateway.freeleaps-logging-system/loki/api/v1/push logPathPattern: /app/log/authentication/*.log + logPath: /app/log/authentication authentication: replicas: 1 image: diff --git a/freeleaps/helm-pkg/authentication/values.yaml b/freeleaps/helm-pkg/authentication/values.yaml index 7626e657..41aa0d22 100644 --- a/freeleaps/helm-pkg/authentication/values.yaml +++ b/freeleaps/helm-pkg/authentication/values.yaml @@ -11,6 +11,7 @@ logIngest: enabled: false lokiEndpoint: http://loki-gateway.freeleaps-logging-system/loki/api/v1/push logPathPattern: /app/log/authentication/*.log + logPath: /app/log/authentication fluentbit: enabled: false resources: