Skip to content

[DADP-182] Enable ADP by default for Linux Operator workloads - #3401

Open
thieman wants to merge 23 commits into
mainfrom
thieman/dadp-182-operator-linux-default
Open

[DADP-182] Enable ADP by default for Linux Operator workloads#3401
thieman wants to merge 23 commits into
mainfrom
thieman/dadp-182-operator-linux-default

Conversation

@thieman

@thieman thieman commented Aug 25, 2026

Copy link
Copy Markdown

Configuration

New controls

Surface Current default Behavior
--defaultDataPlaneLinuxEnabled false Enables ADP by default for Linux workloads managed by this Operator instance when no workload-level override is present and the selected Agent image is version 7.83 or later.
DD_DEFAULT_DATA_PLANE_LINUX_ENABLED unset; the effective default remains false Environment-variable equivalent of --defaultDataPlaneLinuxEnabled; an explicit CLI argument takes precedence.
defaultDataPlaneEnabled.linux true in the datadog-operator Helm chart The separate Helm chart PR renders DD_DEFAULT_DATA_PLANE_LINUX_ENABLED=true. The default applies to Agent 7.83+; non-Helm installations retain the binary default unless configured.

Existing and deprecated controls

Surface Status Default when unset Behavior
spec.features.dataPlane.enabled Existing, supported no explicit value An explicit true or false is the authoritative per-workload setting. In particular, false opts an individual workload out of the Linux default.
agent.datadoghq.com/adp-enabled Deprecated no effect The legacy annotation remains supported for compatibility: "true" enables ADP and "false" opts out. Both values log a deprecation warning.

Enablement precedence is: explicit spec.features.dataPlane.enabled, then the legacy annotation, then the Operator Linux default. The global default applies only when the selected Agent image is version 7.83 or later; explicit CRD and legacy-annotation opt-ins remain available for older Agent images. Windows profiles do not inherit the Linux default.

Summary

  • add the Linux-only Operator default and the CLI/environment configuration surface, preserving explicit CRD and legacy annotation opt-outs
  • support ADP in optimized and single-container Agent workloads
  • add single-container runtime E2E coverage and document the Operator startup option
  • align with upstream removal of ExtendedDaemonSet runtime support; EDS is not part of this PR

Relates to DADP-182.

Validation

Automated local validation

  • CGO_ENABLED=0 make ci-test
  • make lint-e2e
  • GOWORK=off go test -C test/e2e/ ./tests/k8s_suite/... --tags=e2e -run '^$'
  • focused Data Plane, DogStatsD, and DDAI single-container tests

On this Darwin ARM host, the normal CGO-enabled suite crashes in the third-party go-m1cpu initialization path; the complete suite passed with CGO_ENABLED=0.

Prior local Kind runtime validation

Built DADP implementation commit d87eb29b with make docker-build-ci IMG=dadp-operator:dadp-182, loaded that image into Kind, and verified the running Operator reports that commit.

  • Single-container default path: applied the focused fixture with E2E-equivalent generated credentials. The generated DDAI retained containerStrategy: single; the Agent pod contained only unprivileged-single-agent; all four ADP environment variables were set; the container declared UDP/8125 as a HostPort; and the s6-managed agent-data-plane process owned the UDP/8125 listener.
  • Optimized default path: applied the existing optimized DogStatsD fixture with its explicit features.dataPlane block removed, proving the Operator default enabled ADP. The resulting pod contained the agent-data-plane sidecar; Core received DD_DATA_PLANE_ENABLED and DD_DATA_PLANE_DOGSTATSD_ENABLED; ADP received the remote-agent/config-stream settings; only ADP declared UDP/8125 as a HostPort; and the ADP sidecar process owned the UDP/8125 listener.

This validation used Agent 7.81.1, before the subsequent change that gates the default at Agent 7.83+.

GKE Autopilot coverage

The GKE Autopilot suite now uses the published Agent 7.83.0-rc.5 image and deploys two workloads in one cluster:

  • ADP on: no explicit features.dataPlane.enabled; the Operator receives DD_DEFAULT_DATA_PLANE_LINUX_ENABLED=true; assertions require the ADP sidecar and its Core/ADP environment contract.
  • ADP off: spec.features.dataPlane.enabled: false; assertions require the ADP sidecar to be absent. Its Agent and Cluster Agent endpoints are redirected to loopback, so it cannot emit test telemetry to the real intake.

make lint-e2e and the GKE suite compilation pass locally. Executing make e2e-gke-autopilot-tests remains pending GCP Application Default Credentials, a configured GCP/Pulumi environment, and a registry-accessible branch Operator image. The DDCI Kubernetes-version matrix remains the final cross-version validation.

Add a CLI and environment option for enabling the data plane by default on Linux DatadogAgentInternals. Propagate the resolved value into feature options while excluding Windows profile DDAIs and preserving ordinary DDAIs with stray Windows annotations.
Use the same resolved Data Plane default for sidecar activation and DogStatsD port ownership so default-enabled Linux workloads delegate DogStatsD consistently.
Extend the feature-default regression case to verify the Agent Data Plane sidecar requirement and its delegation environment variables. This ensures omitted DataPlane CRD configuration exercises the complete default-enabled ADP path.
Configure all Core/ADP interaction flags on the shared unprivileged Agent container when ADP is enabled under the single-container strategy. Keep the DogStatsD UDP host port on that shared container instead of routing it to an ADP sidecar.
Mirror DaemonSet feature-hook dispatch for ExtendedDaemonSets so single-container workloads receive shared Agent Data Plane configuration.
Exercise an Operator-managed Linux DatadogAgent with the data-plane block omitted and the Operator default enabled through Helm environment values. Verify the single container configuration, ADP socket ownership, DogStatsD delivery, and failure diagnostics in the real Kind suite.
Honor the deprecated false annotation before the Linux rollout default and document the effective Data Plane behavior for optimized and single-container workloads.
Synchronize bundle CRD documentation and assert that both legacy annotation values emit the migration warning.
Regenerate the Marketplace CRD template from the updated Operator API documentation.
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 25, 2026

Copy link
Copy Markdown

Pipelines  Code Coverage

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 2 Pipeline jobs failed

DataDog/datadog-operator | build_operator_image_amd64 — 🔄 Retry may pass, looks flaky

View more details · View in GitLab

DataDog/datadog-operator | build_operator_image_fips_arm64 — 🔄 Retry may pass, looks flaky

View more details · View in GitLab

ℹ️ Info

🎯 Code Coverage (details)
Patch Coverage: 94.87%
Overall Coverage: 50.58% (+0.08%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: dcafe99 | Docs | View more details | Give us feedback!

Keep the rollout behavior focused on runtime code and tests. Regenerate distribution schemas as part of the versioned release workflow.
Comment thread cmd/main.go Outdated
"When true (requires --untaintControllerEnabled), the Untaint controller removes the startup taint only after both the node Agent and Datadog CSI node-server pods are Ready. Requires Pod watch coverage of CSI namespaces (DD_CSIDRIVER_WATCH_NAMESPACE).")
flag.BoolVar(&opts.rolloutOnConfigMapChangeEnabled, "rolloutOnConfigMapChangeEnabled", true,
"Automatically roll out Agent/Cluster Agent/Cluster Check Runner/OTel Agent Gateway workloads when a ConfigMap referenced by their pod template changes content out-of-band")
flag.BoolVar(&opts.defaultDataPlaneLinuxEnabled, "defaultDataPlaneLinuxEnabled", false, "Enable the data plane by default for Linux DatadogAgentInternals")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change help to "Enable the Agent Data Plane by default on Linux"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[GPT-5.6 Terra (OpenAI)] Fixed in fb31281: the flag now reads Enable the Agent Data Plane by default on Linux.

Comment thread docs/installation.md Outdated
| Controller revisions | `--createControllerRevisions` | `DD_CREATE_CONTROLLER_REVISIONS` | `false` |
| Linux Data Plane default | `--defaultDataPlaneLinuxEnabled` | `DD_DEFAULT_DATA_PLANE_LINUX_ENABLED` | `false` |

The Linux Data Plane default applies only when `spec.features.dataPlane.enabled` is unset. An explicit CRD value takes precedence, followed by the deprecated `agent.datadoghq.com/adp-enabled` annotation. Set `spec.features.dataPlane.enabled: false` to opt an individual workload out. Windows profiles do not inherit this default. With the optimized container strategy, Data Plane runs in a sidecar. With the single container strategy, the Agent image's s6 supervisor runs it as a process in the Agent container.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[GPT-5.6 Terra (OpenAI)] Removed in fb31281. The detailed rollout behavior remains in the chart value documentation and PR description rather than duplicating it here.

// It should do nothing if the feature doesn't need to configure it.
func (f *dataPlaneFeature) ManageSingleContainerNodeAgent(managers feature.PodTemplateManagers) error {
return f.ManageNodeAgent(managers)
if !f.enabled {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you mostly inlined a bunch of ManageNodeAgent here, can you reduce the duplication? What actually needs to change? Also are there any other uses of ManageNodeAgent or did you get rid of the only one?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[GPT-5.6 Terra (OpenAI)] Reduced in fb31281. ManageSingleContainerNodeAgent and ManageNodeAgent now delegate to one helper with the Core and ADP target containers as parameters. ManageNodeAgent remains the optimized DaemonSet path; the EDS loop also uses it for optimized workloads.

})

// --- Subtest: DSD UDP, single-container ADP enabled by the Operator default ---
s.T().Run("Single-container DSD UDP uses the Operator ADP default", func(t *testing.T) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty involved test for the single container use case, do we have an equivalent for multi-container?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[GPT-5.6 Terra (OpenAI)] Yes: DSD UDP with ADP immediately above is the multi-container counterpart for the ADP sidecar, UDP host-port ownership, and fake-intake metric delivery. The new test is separate because it must assert the one-container/s6 process contract. I am currently fixing the live single-container E2E failure rather than treating the existing multi-container test as proof of that distinct runtime path.

@thieman thieman added the enhancement New feature or request label Aug 25, 2026
@thieman thieman added this to the v1.31.0 milestone Aug 25, 2026
thieman and others added 6 commits August 25, 2026 14:26
Assert that both the DatadogAgent and its internal resource retain the requested container strategy before validating the rendered runtime pod.
Exercise runtime default, legacy annotations, and explicit CRD override precedence directly to protect the rollout opt-out contract.
Exercise both enabled and disabled paths of the shared single-container ADP environment configuration.
Use one target-container helper for optimized and single-container Agent workloads, and align the Linux default flag help text with its user-facing behavior.
Service Discovery requires the privileged system-probe container, so its Agent-version default prevents the unprivileged single-container strategy from applying. Disable it explicitly in the focused ADP runtime fixture.
Keep the single-container shape, configuration, listener ownership, and metric-delivery assertions while removing temporary diagnostic collection that duplicated the suite helpers and emitted broad pod and container-log output.
@thieman
thieman marked this pull request as ready for review August 27, 2026 16:23
@thieman
thieman requested a review from a team August 27, 2026 16:23
@thieman
thieman requested review from a team as code owners August 27, 2026 16:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d2fd3b7a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

f.enabled = featureutils.IsDataPlaneEnabled(dda, ddaSpec)
f.enabled = featureutils.IsDataPlaneEnabled(dda, ddaSpec, f.defaultEnabled)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate the ADP default on a compatible Agent version

When the Operator/Helm default is enabled, a workload with no explicit Data Plane setting is enabled unconditionally, including workloads that pin a node Agent image from before the agent-data-plane executable was included. The generated sidecar then runs agent-data-plane ... from that pinned image and CrashLoops, making the Agent DaemonSet unavailable after an Operator upgrade. Apply the default only when the selected Agent image meets the minimum ADP version, while still allowing an explicit workload-level enablement to take precedence.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[GPT-5.6 Terra (OpenAI)] Verified. Unpinned workloads use the current default Agent image, but spec.override.nodeAgent.image supports pinned older versions. Fixed in 22b5aab: the Operator-level default now applies only when the selected Agent image is 7.81.0 or newer. Explicit spec.features.dataPlane.enabled and the legacy annotation retain their existing opt-in behavior for older images. Regression coverage includes a pinned 7.80 image (default remains disabled), a pinned 7.81 image (default enables ADP), and explicit enablement on 7.80.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[GPT-5.6 Terra (OpenAI)] Updated the eligibility threshold per release coordination: 88d016d now applies the global default only to selected Agent images at 7.83.0 or newer. Explicit CRD and legacy-annotation opt-ins remain unchanged. Default-path tests use the published 7.83.0-rc.5 image; the complete CGO-disabled Operator suite passes.

Apply the Operator-level default only to Agent 7.81 and newer, including an explicitly selected node Agent image. Explicit CRD configuration and legacy annotation opt-ins retain their existing behavior for older versions.
Raise the default eligibility threshold to Agent 7.83. Explicit Data Plane and legacy annotation opt-ins remain available for older Agent versions. Pin default-path tests to an available 7.83 release candidate.
Resolve upstream changes while retaining the Linux ADP default and single-container DaemonSet handling. ExtendedDaemonSet runtime support was removed from main, so the obsolete EDS-specific path and test are not retained.
Exercise the Linux ADP default and explicit CRD opt-out in one GKE Autopilot suite using compatible Agent 7.83 release-candidate images. The opt-out workload uses loopback intake endpoints so it cannot emit test telemetry to the real intake.
Log only the matching Agent pod states and DatadogAgentInternal conditions when the GKE Autopilot ADP assertions fail, preserving the existing behavioral assertions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants