Skip to content

fix/opentelemetry: Skip the unused otel-agent ConfigMap and ServiceAccount when openTelemetry.agent.kind is Deployment - #1041

Merged
marcleblanc2 merged 1 commit into
mainfrom
marc/otel-agent-configmap-daemonset-only
Dec 1, 2026
Merged

marcleblanc2 merged 1 commit into
mainfrom
marc/otel-agent-configmap-daemonset-only

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Context

Problem

  • With kind: Deployment, the chart still renders the otel-agent ConfigMap, which nothing uses

  • With openTelemetry.agent.serviceAccount.create: true, the otel-agent ServiceAccount renders regardless of kind and openTelemetry.enabled, so it is also unused when no DaemonSet renders

Solution

  • Render the otel-agent ConfigMap and ServiceAccount under the same condition as the DaemonSet: openTelemetry.enabled and openTelemetry.agent.kind of DaemonSet, the default. The ServiceAccount still also needs serviceAccount.create

  • On upgrade, Helm deletes the unused objects from releases that set kind: Deployment. Renders with the default kind: DaemonSet do not change

Testing

  • Four new tests in otelAgentKind_test.yaml: the ConfigMap and ServiceAccount each render by default, and not with kind: Deployment. The two kind: Deployment tests fail on main and pass here; helm unittest (317 tests, 120 snapshots) and helm lint pass

  • helm template renders byte-identical output on main and this branch with the default values, and with openTelemetry.agent.serviceAccount.create: true

  • With serviceAccount.create: true, the ServiceAccount renders on main with kind: Deployment or openTelemetry.enabled: false, and not here

  • The customer override with kind: Deployment renders 49 objects on main, including the otel-agent ConfigMap, and 48 here, without it

  • Not deployed on a cluster

Amp threads

Changelog

The otel-agent ConfigMap and ServiceAccount are no longer rendered when openTelemetry.agent.kind is Deployment

@marcleblanc2
marcleblanc2 force-pushed the marc/otel-agent-configmap-daemonset-only branch from 2fc92d4 to 263a15e Compare December 1, 2026 09:28
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

@marcleblanc2 marcleblanc2 changed the title fix/opentelemetry: Skip the unused otel-agent ConfigMap when openTelemetry.agent.kind is Deployment fix/opentelemetry: Skip the unused otel-agent ConfigMap and ServiceAccount when openTelemetry.agent.kind is Deployment Dec 1, 2026
@marcleblanc2
marcleblanc2 enabled auto-merge (squash) December 1, 2026 09:32
@marcleblanc2
marcleblanc2 requested a review from a team December 1, 2026 09:32
@marcleblanc2
marcleblanc2 merged commit c239141 into main Dec 1, 2026
7 checks passed
@marcleblanc2
marcleblanc2 deleted the marc/otel-agent-configmap-daemonset-only branch December 1, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants