Add basicauth to otel

This commit is contained in:
2025-11-14 18:55:57 +01:00
parent 8488467ca7
commit 3c8904b74a
3 changed files with 38 additions and 21 deletions

View File

@@ -0,0 +1,12 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: otel-basicauth
spec:
refreshInterval: 24h
secretStoreRef:
kind: ClusterSecretStore
name: bitwarden
dataFrom:
- extract:
key: otel-basicauth

View File

@@ -18,18 +18,7 @@ spec:
name: otel-collector name: otel-collector
port: port:
name: otlp-http name: otlp-http
- host: otel-grpc.sdg.moe
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: otel-collector
port:
name: otlp-grpc
tls: tls:
- hosts: - hosts:
- otel.sdg.moe - otel.sdg.moe
- otel-grpc.sdg.moe
secretName: otel-ssl secretName: otel-ssl

View File

@@ -10,6 +10,19 @@ spec:
secretKeyRef: secretKeyRef:
name: clickhouse-passwords name: clickhouse-passwords
key: collector key: collector
volumes:
- name: htpasswd
secret:
secretName: otel-basicauth
items:
- key: .htpasswd
path: .htpasswd
volumeMounts:
- name: htpasswd
mountPath: .htpasswd
subPath: .htpasswd
config: config:
receivers: receivers:
# hostmetrics: # hostmetrics:
@@ -25,10 +38,10 @@ spec:
# paging: # paging:
otlp: otlp:
protocols: protocols:
grpc:
endpoint: 0.0.0.0:4317
http: http:
endpoint: 0.0.0.0:4318 endpoint: 0.0.0.0:4318
auth:
authenticator: basicauth
processors: processors:
memory_limiter: memory_limiter:
@@ -66,14 +79,17 @@ spec:
endpoint: 0.0.0.0:1777 endpoint: 0.0.0.0:1777
zpages: zpages:
endpoint: 0.0.0.0:55679 endpoint: 0.0.0.0:55679
basicauth:
htpasswd:
file: .htpasswd
service: service:
extensions: [health_check, pprof, zpages] extensions: [basicauth, health_check, pprof, zpages]
pipelines: pipelines:
traces: traces:
receivers: [otlp] receivers: [otlp]
processors: [memory_limiter, batch] processors: [memory_limiter, batch]
exporters: [debug, clickhouse] exporters: [clickhouse]
metrics: metrics:
receivers: [otlp] #[otlp, hostmetrics] receivers: [otlp] #[otlp, hostmetrics]
processors: [memory_limiter, batch] processors: [memory_limiter, batch]
@@ -81,4 +97,4 @@ spec:
logs: logs:
receivers: [otlp] receivers: [otlp]
processors: [memory_limiter, batch] processors: [memory_limiter, batch]
exporters: [debug, clickhouse] exporters: [clickhouse]