[CONTP-1709] Support enabling datadoginstrumentation crd controller#3002
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b15c1b4da
ℹ️ 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".
| func (f *instrumentationCRDFeature) ManageSingleContainerNodeAgent(feature.PodTemplateManagers, string) error { | ||
| return nil |
There was a problem hiding this comment.
Configure instrumentation env var for single-container agents
The new feature never configures node-agent env vars when SingleContainerStrategy is used because ManageSingleContainerNodeAgent is a no-op. In that mode the reconciler calls ManageSingleContainerNodeAgent instead of ManageNodeAgent, so DD_INSTRUMENTATION_CRD_CONTROLLER_ENABLED is not added to the node agent container and the instrumentation CRD flow is only partially enabled.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Single container node is a legacy configuration and won't be supported by this feature.
2b15c1b to
c216052
Compare
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (62.85%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3002 +/- ##
==========================================
+ Coverage 43.56% 44.32% +0.75%
==========================================
Files 343 354 +11
Lines 29771 30785 +1014
==========================================
+ Hits 12970 13645 +675
- Misses 15967 16261 +294
- Partials 834 879 +45
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 23 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
🛑 Gate Violations
|
levan-m
left a comment
There was a problem hiding this comment.
looks good. will approve once switched to experimental annotation.
* switch to annotation * fix linter
25a5943
into
main
…3002) (#3125) feat: add instrumentation controller crd feature fix: remove default rbac test chore: add instrumentation env var to single container chore: change rbac name Merge branch 'main' into mathew.estafanous/instrumentation-crd-feature switch to annotation (#3080) * switch to annotation * fix linter instrumentation crd feature on by default minimum required version is 7.81 enable feature with annotation switch to disable by default (cherry picked from commit 25a5943) Co-authored-by: Mathew Estafanous <[email protected]> Co-authored-by: levan-m <[email protected]> Co-authored-by: mathew.estafanous <[email protected]>
What does this PR do?
Enables the
DatadogInstrumentationCRD controller in the cluster agent, when the cluster agent version meets the minimum requirement (>= 7.81.0). Users can opt in via theagent.datadoghq.com/instrumentation-crd-enabled: "false"annotation on theDatadogAgentresource.Necessary RBACs for the controller to operate are automatically added when the feature is enabled.
Motivation
Previously, enabling the instrumentation CRD controller required manually adding
DD_INSTRUMENTATION_CRD_CONTROLLER_ENABLEDto both cluster and node agents. There was also no enforcement of the admission controller or RBAC prerequisites. This PR wires it up automatically for users meeting the version threshold.Describe how you validated your changes
instrumentationcrd/feature_test.go.Manual QA
DD_INSTRUMENTATION_CRD_CONTROLLER_ENABLED: "true"Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel