-
Notifications
You must be signed in to change notification settings - Fork 156
[DADP-182] Enable ADP by default for Linux Operator workloads #3401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0956999
d11f551
5142a11
1dc14bf
bb3e3e9
58443cb
a58042d
4978e5b
7e2d99c
2fc68af
d553cea
3cdf1b4
e3810a6
2e400bb
fb31281
d87eb29
d1928a4
0d2fd3b
22b5aab
88d016d
61d43ff
3677bc8
dcafe99
766a847
8342b04
5d8c3e3
5fd43f4
260dfc4
6ad7b88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ func buildDataPlaneFeature(options *feature.Options) feature.Feature { | |
|
|
||
| if options != nil { | ||
| f.logger = options.Logger | ||
| f.defaultEnabled = options.DefaultDataPlaneEnabled | ||
| } | ||
|
|
||
| return f | ||
|
|
@@ -37,6 +38,7 @@ func buildDataPlaneFeature(options *feature.Options) feature.Feature { | |
| type dataPlaneFeature struct { | ||
| logger logr.Logger | ||
|
|
||
| defaultEnabled bool | ||
| enabled bool | ||
| dogstatsdEnabled bool | ||
| } | ||
|
|
@@ -49,11 +51,12 @@ func (f *dataPlaneFeature) ID() feature.IDType { | |
| // Configure is used to configure the feature from a v2alpha1.DatadogAgent instance. | ||
| func (f *dataPlaneFeature) Configure(dda metav1.Object, ddaSpec *v2alpha1.DatadogAgentSpec, _ *v2alpha1.RemoteConfigConfiguration) feature.RequiredComponents { | ||
| // Check if the deprecated annotation is being used, and log a warning if so. | ||
| if featureutils.HasFeatureEnableAnnotation(dda, featureutils.EnableADPAnnotation) { | ||
| if featureutils.HasFeatureEnableAnnotation(dda, featureutils.EnableADPAnnotation) || | ||
| featureutils.HasFeatureDisableAnnotation(dda, featureutils.EnableADPAnnotation) { | ||
| f.logger.Info("DEPRECATION WARNING: annotation 'agent.datadoghq.com/adp-enabled' is deprecated; use 'spec.features.dataPlane.enabled' instead") | ||
| } | ||
|
|
||
| f.enabled = featureutils.IsDataPlaneEnabled(dda, ddaSpec) | ||
| f.enabled = featureutils.IsDataPlaneEnabled(dda, ddaSpec, f.defaultEnabled) | ||
| f.dogstatsdEnabled = featureutils.IsDataPlaneDogstatsdEnabled(ddaSpec) | ||
|
|
||
| var reqComp feature.RequiredComponents | ||
|
|
@@ -84,40 +87,40 @@ func (f *dataPlaneFeature) ManageClusterAgent(managers feature.PodTemplateManage | |
| // if SingleContainerStrategy is enabled and can be used with the configured feature set. | ||
| // 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) | ||
| return f.manageNodeAgent(managers, apicommon.UnprivilegedSingleAgentContainerName, apicommon.UnprivilegedSingleAgentContainerName) | ||
| } | ||
|
|
||
| // ManageNodeAgent allows a feature to configure the Node Agent's corev1.PodTemplateSpec | ||
| // It should do nothing if the feature doesn't need to configure it. | ||
| func (f *dataPlaneFeature) ManageNodeAgent(managers feature.PodTemplateManagers) error { | ||
| // We set the relevant configuration on the Core Agent specifically, which trickles down to the Data Plane when it | ||
| // queries the Core Agent for its configuration. | ||
| // | ||
| // It is also used to influence the Core Agent in terms of what it chooses to run itself or allow to be delegated to | ||
| // the data plane. | ||
| if f.enabled { | ||
| // When Data Plane is enabled, we signal this to the Core Agent by setting an environment variable. | ||
| managers.EnvVar().AddEnvVarToContainer(apicommon.CoreAgentContainerName, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneEnabled, | ||
| Value: "true", | ||
| }) | ||
| return f.manageNodeAgent(managers, apicommon.CoreAgentContainerName, apicommon.AgentDataPlaneContainerName) | ||
| } | ||
|
|
||
| // Configure the ADP container to fetch configuration from the Core Agent. | ||
| managers.EnvVar().AddEnvVarToContainer(apicommon.AgentDataPlaneContainerName, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneRemoteAgentEnabled, | ||
| Value: "true", | ||
| }) | ||
| managers.EnvVar().AddEnvVarToContainer(apicommon.AgentDataPlaneContainerName, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneUseNewConfigStreamEndpoint, | ||
| func (f *dataPlaneFeature) manageNodeAgent(managers feature.PodTemplateManagers, coreContainer, dataPlaneContainer apicommon.AgentContainerName) error { | ||
| if !f.enabled { | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like you mostly inlined a bunch of
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [GPT-5.6 Terra (OpenAI)] Reduced in fb31281. |
||
| return nil | ||
| } | ||
|
|
||
| // Core Agent delegates the selected pipelines to ADP. In the single-container strategy, | ||
| // both processes inherit these settings from the shared container environment. | ||
| managers.EnvVar().AddEnvVarToContainer(coreContainer, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneEnabled, | ||
| Value: "true", | ||
| }) | ||
| managers.EnvVar().AddEnvVarToContainer(dataPlaneContainer, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneRemoteAgentEnabled, | ||
| Value: "true", | ||
| }) | ||
| managers.EnvVar().AddEnvVarToContainer(dataPlaneContainer, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneUseNewConfigStreamEndpoint, | ||
| Value: "true", | ||
| }) | ||
|
|
||
| if f.dogstatsdEnabled { | ||
| managers.EnvVar().AddEnvVarToContainer(coreContainer, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneDogstatsdEnabled, | ||
| Value: "true", | ||
| }) | ||
|
|
||
| if f.dogstatsdEnabled { | ||
| managers.EnvVar().AddEnvVarToContainer(apicommon.CoreAgentContainerName, &corev1.EnvVar{ | ||
| Name: common.DDDataPlaneDogstatsdEnabled, | ||
| Value: "true", | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| return nil | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-planeexecutable was included. The generated sidecar then runsagent-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 👍 / 👎.
There was a problem hiding this comment.
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.imagesupports pinned older versions. Fixed in 22b5aab: the Operator-level default now applies only when the selected Agent image is 7.81.0 or newer. Explicitspec.features.dataPlane.enabledand 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.There was a problem hiding this comment.
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.