11# ServiceAccount for the OTel Collector Agent
2+ # Apply namespace secrets before this manifest: task secrets:apply (kubectl/secrets.env), or see secrets.example.yaml.
3+ # otel-otlp-ingest-htpasswd (key: htpasswd) -> /etc/otelcol-secrets/htpasswd
4+ # opensearch-credentials (keys: username, password) -> OPENSEARCH_USERNAME / OPENSEARCH_PASSWORD
25apiVersion : v1
36kind : ServiceAccount
47metadata :
1922 endpoint: ${env:MY_POD_IP}:13133
2023 basicauth/server:
2124 htpasswd:
22- inline: |
23- # TEST-ONLY: plaintext htpasswd entries are NOT production-ready.
24- # For production generate a bcrypt htpasswd line (e.g. `htpasswd -nbBC 10 USER PASS`)
25- # and store it in a Kubernetes Secret (or external secret store).
26- ##########:##########
25+ file: /etc/otelcol-secrets/htpasswd
2726 basicauth/client:
2827 client_auth:
2928 username: ${env:OPENSEARCH_USERNAME}
4039 endpoint: 0.0.0.0:4318
4140 auth:
4241 authenticator: basicauth/server
42+ filelog/tier2:
43+ include:
44+ - /var/log/pods/tier-2_*/*/*.log
45+ start_at: end
46+ include_file_path: true
47+ operators:
48+ - type: container
4349
4450 processors:
51+ transform/fixlogtime:
52+ log_statements:
53+ - context: log
54+ statements:
55+ - set(time_unix_nano, observed_time_unix_nano) where time_unix_nano == 0
4556 certificatelogverify:
4657 hash_algorithm: SHA256
4758 sign_content: body
6980 sending_queue:
7081 enabled: true
7182 storage: file_storage
83+ opensearch/tier2self:
84+ http:
85+ endpoint: https://opensearch-cluster-master.tier-3.svc.cluster.local:9200
86+ tls:
87+ insecure_skip_verify: true
88+ auth:
89+ authenticator: basicauth/client
90+ logs_index: otel-logs-tier2
91+ traces_index: otel-traces
92+ sending_queue:
93+ enabled: true
94+ storage: file_storage
7295 debug/logs:
7396 verbosity: detailed
7497 debug/metrics:
@@ -79,8 +102,12 @@ data:
79102 pipelines:
80103 logs:
81104 receivers: [otlp]
82- processors: [certificatelogverify, batch]
105+ processors: [transform/fixlogtime, certificatelogverify, batch]
83106 exporters: [opensearch, debug/logs]
107+ logs/tier2self:
108+ receivers: [filelog/tier2]
109+ processors: [transform/fixlogtime, batch]
110+ exporters: [opensearch/tier2self]
84111 metrics:
85112 receivers: [otlp]
86113 processors: [batch]
@@ -182,13 +209,19 @@ spec:
182209 cpu : 200m
183210 requests :
184211 memory : 128Mi
185- cpu : 100m
212+ cpu : 50m
186213 volumeMounts :
187214 - name : config
188215 mountPath : /etc/otelcol-contrib
189216 readOnly : true
190217 - name : storage
191218 mountPath : /var/lib/otelcol/storage
219+ - name : pod-logs
220+ mountPath : /var/log/pods
221+ readOnly : true
222+ - name : otlp-ingest-htpasswd
223+ mountPath : /etc/otelcol-secrets
224+ readOnly : true
192225 livenessProbe :
193226 httpGet :
194227 path : /
@@ -219,6 +252,14 @@ spec:
219252 hostPath :
220253 path : /var/lib/otelcol/storage
221254 type : DirectoryOrCreate
255+ - name : otlp-ingest-htpasswd
256+ secret :
257+ secretName : otel-otlp-ingest-htpasswd
258+ defaultMode : 288
259+ - name : pod-logs
260+ hostPath :
261+ path : /var/log/pods
262+ type : Directory
222263---
223264# Service for the OTel Collector Agent
224265apiVersion : v1
0 commit comments