You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
#. Configure the Kubernetes Downward API to expose environment variables to Kubernetes resources. The following example demonstrates how to update a deployment to expose environment variables by adding the agent configuration under the ``.spec.template.spec.containers.env`` section:
437
+
438
+
.. code-block:: yaml
439
+
440
+
apiVersion: apps/v1
441
+
kind: Deployment
442
+
spec:
443
+
selector:
444
+
matchLabels:
445
+
app: your-application
446
+
template:
447
+
spec:
448
+
containers:
449
+
- name: myapp
450
+
env:
451
+
- name: SPLUNK_OTEL_AGENT
452
+
valueFrom:
453
+
fieldRef:
454
+
fieldPath: status.hostIP
455
+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
456
+
value: "http://$(SPLUNK_OTEL_AGENT):4318"
457
+
- name: OTEL_SERVICE_NAME
458
+
value: "<serviceName>"
459
+
- name: OTEL_RESOURCE_ATTRIBUTES
460
+
value: "deployment.environment=<environmentName>"
461
+
462
+
Based on the Collector deployment mode, modify the deployment manifest, setting the correct value for ``OTEL_EXPORTER_OTLP_ENDPOINT`` environment variable. In case of daemonset deployment mode, Kubernetes Downward API can be used to obtain an address of a collector.
463
+
464
+
.. note:: You can also deploy instrumentation using the Kubernetes Operator. See :ref:`k8s-backend-auto-discovery` for more information.
0 commit comments