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 name: authentication-config
key: {{ $key | snakecase | upper }} key: {{ $key | snakecase | upper }}
{{- end }} {{- 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 mode: sidecar
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
serviceAccount: "{{ .Release.Name }}-otel-collector" serviceAccount: "{{ .Release.Name }}-otel-collector"
volumeMounts:
- name: app-logs
mountPath: {{ .Values.logIngest.logPath }}
config: config:
receivers: receivers:
filelog: filelog:
@ -16,7 +19,6 @@ spec:
start_at: beginning start_at: beginning
include_file_path: true include_file_path: true
include_file_name: true include_file_name: true
processors: processors:
k8sattributes: k8sattributes:
auth_type: "serviceAccount" auth_type: "serviceAccount"
@ -53,7 +55,6 @@ spec:
batch: batch:
send_batch_size: 1000 send_batch_size: 1000
timeout: 10s timeout: 10s
exporters: exporters:
loki: loki:
endpoint: {{ .Values.logIngest.lokiEndpoint }} endpoint: {{ .Values.logIngest.lokiEndpoint }}
@ -61,7 +62,6 @@ spec:
insecure: true insecure: true
debug: debug:
verbosity: detailed verbosity: detailed
service: service:
telemetry: telemetry:
logs: logs:

View File

@ -8,6 +8,7 @@ logIngest:
enabled: true enabled: true
lokiEndpoint: http://loki-gateway.freeleaps-logging-system/loki/api/v1/push lokiEndpoint: http://loki-gateway.freeleaps-logging-system/loki/api/v1/push
logPathPattern: /app/log/authentication/*.log logPathPattern: /app/log/authentication/*.log
logPath: /app/log/authentication
authentication: authentication:
replicas: 1 replicas: 1
image: image:

View File

@ -11,6 +11,7 @@ logIngest:
enabled: false enabled: false
lokiEndpoint: http://loki-gateway.freeleaps-logging-system/loki/api/v1/push lokiEndpoint: http://loki-gateway.freeleaps-logging-system/loki/api/v1/push
logPathPattern: /app/log/authentication/*.log logPathPattern: /app/log/authentication/*.log
logPath: /app/log/authentication
fluentbit: fluentbit:
enabled: false enabled: false
resources: resources: