feat: add volume mounts for log ingestion in OpenTelemetry and deployment configurations

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-04-16 06:35:51 +08:00
parent a01184310d
commit 8281c6eef7
4 changed files with 17 additions and 6 deletions

View File

@ -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 }}

View File

@ -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"
@ -53,7 +55,6 @@ spec:
batch:
send_batch_size: 1000
timeout: 10s
exporters:
loki:
endpoint: {{ .Values.logIngest.lokiEndpoint }}
@ -61,7 +62,6 @@ spec:
insecure: true
debug:
verbosity: detailed
service:
telemetry:
logs:

View File

@ -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:

View File

@ -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: