Gate managed Agent installation on workload readiness - #3397
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 574c8c4ee3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
🔄 Datadog auto-retried 1 job - 1 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: a5b674d | Docs | View more details | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2bb7a59f0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }{ | ||
| {name: "Cluster Agent", enabled: !managedAgentInstallationComponentDisabled(dda, v2alpha1.ClusterAgentComponentName), status: dda.Status.ClusterAgent}, | ||
| {name: "Cluster Checks Runner", enabled: managedAgentInstallationOptionalComponentEnabled(dda, v2alpha1.ClusterChecksRunnerComponentName), status: dda.Status.ClusterChecksRunner}, | ||
| {name: "OTel Agent Gateway", enabled: managedAgentInstallationOptionalComponentEnabled(dda, v2alpha1.OtelAgentGatewayComponentName), status: dda.Status.OtelAgentGateway}, |
There was a problem hiding this comment.
Aggregate OTel gateway status before checking readiness
When a Fleet configuration enables the OTel Agent Gateway, this entry always waits on dda.Status.OtelAgentGateway, but the active DDAI reconciler writes the deployment status to DatadogAgentInternal.Status.OtelAgentGateway while addDDAIStatusToDDAStatus in internal/controller/datadogagent/reconcile_common.go aggregates only Agent, Cluster Agent, and CCR status. Consequently the top-level field remains nil even after the gateway is healthy, so every such managed installation stays RUNNING and then becomes ERROR after ten minutes; aggregate the OTel status or check the DDAI/workload directly.
Useful? React with 👍 / 👎.
b2bb7a5 to
a5b674d
Compare
|
Closing this PR in favor of a backend-mediated approach |
What does this PR do?
Prevents managed Agent installation from reporting success until the DatadogAgent has reconciled and every enabled workload is ready.
The installation remains RUNNING and the DatadogAgent remains marked partial while readiness is pending. The Fleet daemon retries readiness checks every five seconds and reports a terminal error after ten minutes. The readiness start time is persisted on the DatadogAgent so restarting the operator does not reset the deadline.
Readiness requires:
Fresh, unobserved all-zero workload statuses remain pending. A Windows Agent workload with a legitimate desired count of zero is accepted only after its DaemonSet generation has been observed and its native status also reports zero workloads.
The DatadogAgent status now aggregates OTel Agent Gateway status from DatadogAgentInternal profiles and detects changes to that status. Repeated RUNNING state writes are also deduplicated without discarding the current pending-readiness error.
Motivation
The EKS managed add-on installation could report success immediately after creating the DatadogAgent resource, before its controllers had reconciled or its workloads were available.
https://datadoghq.atlassian.net/browse/TON-833
Additional Notes
Explicitly disabled components are skipped. Optional components are checked only when enabled by the accepted DatadogAgent spec.
Minimum Agent Versions
No new minimum versions.
Describe your test plan
CGO_ENABLED=0 go test ./... -count=1make lintChecklist