Repository navigation
fix/opentelemetry: Skip the unused otel-agent ConfigMap and ServiceAccount when openTelemetry.agent.kind is Deployment - #1041
Merged
Conversation
…for the DaemonSet kind Amp-Thread-ID: https://ampcode.com/threads/T-01a21663-f060-7148-8fdc-8eed219fa092 Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2
force-pushed
the
marc/otel-agent-configmap-daemonset-only
branch
from
December 1, 2026 09:28
2fc92d4 to
263a15e
Compare
marcleblanc2
enabled auto-merge (squash)
December 1, 2026 09:32
filiphaftek
approved these changes
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
otel-agent: support Deployment kind, routing directly to existing otel-collector #863 added
openTelemetry.agent.kind: Deployment, which skips theotel-agentDaemonSet, so application pods send traces straight tootel-collector:4317The
otel-agentDaemonSet is the only pod that mounts theotel-agentConfigMap and uses theotel-agentServiceAccountProblem
With
kind: Deployment, the chart still renders theotel-agentConfigMap, which nothing useskind: Deploymentand sourcegraph: render opt-in labels on every object, each key once #1038's label values: the orphan ConfigMap was the only object of 49 without their per-component label, since they set noopenTelemetry.agent.labelsfor an agent they don't runWith
openTelemetry.agent.serviceAccount.create: true, theotel-agentServiceAccount renders regardless ofkindandopenTelemetry.enabled, so it is also unused when no DaemonSet rendersSolution
Render the
otel-agentConfigMap and ServiceAccount under the same condition as the DaemonSet:openTelemetry.enabledandopenTelemetry.agent.kindofDaemonSet, the default. The ServiceAccount still also needsserviceAccount.createOn upgrade, Helm deletes the unused objects from releases that set
kind: Deployment. Renders with the defaultkind: DaemonSetdo not changeTesting
Four new tests in
otelAgentKind_test.yaml: the ConfigMap and ServiceAccount each render by default, and not withkind: Deployment. The twokind: Deploymenttests fail onmainand pass here;helm unittest(317 tests, 120 snapshots) andhelm lintpasshelm templaterenders byte-identical output onmainand this branch with the default values, and withopenTelemetry.agent.serviceAccount.create: trueWith
serviceAccount.create: true, the ServiceAccount renders onmainwithkind: DeploymentoropenTelemetry.enabled: false, and not hereThe customer override with
kind: Deploymentrenders 49 objects onmain, including theotel-agentConfigMap, and 48 here, without itNot deployed on a cluster
Amp threads
Changelog
The
otel-agentConfigMap and ServiceAccount are no longer rendered whenopenTelemetry.agent.kindisDeployment