Skip to content

Conversation

@tbavelier
Copy link
Member

What does this PR do?

DDOT gateway support using the componentreconciler

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

Write there any instructions and details you may have to test your PR.

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label

@tbavelier tbavelier added this to the v1.21.0 milestone Oct 30, 2025
@tbavelier tbavelier added the enhancement New feature or request label Oct 30, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 29.50108% with 325 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.93%. Comparing base (94dfd9a) to head (81332d8).

Files with missing lines Patch % Lines
...dogagentinternal/component_otelcollectorgateway.go 0.00% 48 Missing ⚠️
...datadogagent/component/otelagentgateway/default.go 0.00% 42 Missing ⚠️
pkg/testutils/builder.go 0.00% 41 Missing ⚠️
...ature/otelcollector/defaultconfig/defaultconfig.go 0.00% 39 Missing ⚠️
...ler/datadogagent/component_otelcollectorgateway.go 43.75% 26 Missing and 1 partial ⚠️
...r/datadogagent/feature/otelagentgateway/feature.go 84.12% 14 Missing and 6 partials ⚠️
...nal/controller/datadogagent/global/dependencies.go 0.00% 13 Missing ⚠️
pkg/constants/utils.go 0.00% 7 Missing ⚠️
internal/controller/datadogagent/common/utils.go 0.00% 4 Missing ⚠️
.../controller/datadogagent/feature/test/testsuite.go 0.00% 4 Missing ⚠️
... and 38 more

❌ Your patch status has failed because the patch coverage (29.50%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@                                 Coverage Diff                                  @@
##           tbavelier/component-reconcile-interface-rf-clean    #2276      +/-   ##
====================================================================================
- Coverage                                             38.11%   37.93%   -0.19%     
====================================================================================
  Files                                                   257      264       +7     
  Lines                                                 21066    21523     +457     
====================================================================================
+ Hits                                                   8029     8164     +135     
- Misses                                                12418    12732     +314     
- Partials                                                619      627       +8     
Flag Coverage Δ
unittests 37.93% <29.50%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/controller/datadogagent/controller.go 53.57% <100.00%> (+1.71%) ⬆️
internal/controller/datadogagent/profile.go 82.41% <100.00%> (+0.19%) ⬆️
...rnal/controller/datadogagentinternal/controller.go 0.00% <0.00%> (ø)
...er/datadogagent/controller_reconcile_v2_helpers.go 54.96% <0.00%> (-0.86%) ⬇️
...atadogagent/feature/admissioncontroller/feature.go 66.06% <0.00%> (-0.49%) ⬇️
...nal/controller/datadogagent/feature/apm/feature.go 66.91% <0.00%> (-0.50%) ⬇️
...nal/controller/datadogagent/feature/asm/feature.go 72.41% <0.00%> (-2.59%) ⬇️
...roller/datadogagent/feature/autoscaling/feature.go 82.14% <0.00%> (-3.05%) ⬇️
...ller/datadogagent/feature/clusterchecks/feature.go 66.45% <0.00%> (-0.87%) ⬇️
...dogagent/feature/controlplanemonitoring/feature.go 14.07% <0.00%> (-0.15%) ⬇️
... and 40 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94dfd9a...81332d8. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@songy23 songy23 self-requested a review October 30, 2025 14:11
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

A high-level question: where are Services defined in operator? In DDOT Gateway we need to create a k8s Service to expose the gateway pods: https://github.com/DataDog/helm-charts/blob/main/charts/datadog/templates/agent-services.yaml#L119

}

func (o *otelCollectorFeature) ManageOtelCollectorGateway(managers feature.PodTemplateManagers, provider string) error {
return nil
Copy link
Member

Choose a reason for hiding this comment

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

The otel agents in Daemonset need to use a different config when gateway is enabled: http://github.com/DataDog/helm-charts/blob/main/charts/datadog/templates/_otel_agent_config.yaml#L3

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, but this is not the place to do it. It would be in otelCollector feature and ManageNodeAgent or even higher up in the feature Configure. Because the otelCollector feature is the one that is modified based on whether or not gateway is enabled. I pushed 8d5bdc5 that quickly showcases how the otelCollector daemonset could be modified based on gateway being enabled:

╭─ ~/dd/datadog-operator tbavelier/dd…ce-component                                                                                                                      󱃾 kind-local-k8s/system 11:24:15
╰─❯ k get dd datadog-agent -oyaml | yq .spec.features.otelCollector
enabled: true
╭─ ~/dd/datadog-operator tbavelier/dd…ce-component                                                                                                                      󱃾 kind-local-k8s/system 11:26:20
╰─❯ k get dd datadog-agent -oyaml | yq .spec.features.otelCollectorGateway
null
╭─ ~/dd/datadog-operator tbavelier/dd…ce-component                                                                                                                      󱃾 kind-local-k8s/system 11:26:38
╰─❯ k describe ds datadog-agent | grep -i "IS_OTEL_GATEWAY_ENABLED"
╭─ ~/dd/datadog-operator tbavelier/dd…ce-component                                                                                                                      󱃾 kind-local-k8s/system 11:27:08
╰─❯ k apply -f ~/misc/k8s_stuff/minikube/operator/datadog-agent.yaml
datadogagent.datadoghq.com/datadog-agent configured
╭─ ~/dd/datadog-operator tbavelier/dd…ce-component                                                                                                                      󱃾 kind-local-k8s/system 11:27:25
╰─❯ k get dd datadog-agent -oyaml | yq .spec.features.otelCollectorGateway
enabled: true
╭─ ~/dd/datadog-operator tbavelier/dd…ce-component                                                                                                                      󱃾 kind-local-k8s/system 11:27:31
╰─❯ k describe ds datadog-agent | grep -i "IS_OTEL_GATEWAY_ENABLED"
      IS_OTEL_GATEWAY_ENABLED:                      true

@tbavelier
Copy link
Member Author

A high-level question: where are Services defined in operator? In DDOT Gateway we need to create a k8s Service to expose the gateway pods: https://github.com/DataDog/helm-charts/blob/main/charts/datadog/templates/agent-services.yaml#L119

This is done within the ManageDependencies of a feature. Added in 0363326:

╰─❯ k describe svc datadog-agent-otel-collector-gateway
Name:                     datadog-agent-otel-collector-gateway
Namespace:                system
Labels:                   app.kubernetes.io/instance=datadog-agent
                          app.kubernetes.io/managed-by=datadog-operator
                          app.kubernetes.io/name=datadog-agent-deployment
                          app.kubernetes.io/part-of=system-datadog--agent
                          app.kubernetes.io/version=
                          operator.datadoghq.com/managed-by-store=true
Annotations:              <none>
Selector:                 agent.datadoghq.com/component=otel-collector-gateway,app.kubernetes.io/part-of=system-datadog--agent
Type:                     ClusterIP
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.96.102.42
IPs:                      10.96.102.42
Port:                     otlpgrpcport  4317/TCP
TargetPort:               4317/TCP
Endpoints:                10.244.1.10:4317
Port:                     otlphttpport  4318/TCP
TargetPort:               4318/TCP
Endpoints:                10.244.1.10:4318
Session Affinity:         None
Internal Traffic Policy:  Local
Events:                   <none>

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

Looks good so far, just a few naming suggestions

@songy23 songy23 force-pushed the tbavelier/ddot-with-interface-component branch from 7f1efb8 to ed3e0fb Compare November 10, 2025 20:38
@tbavelier tbavelier modified the milestones: v1.21.0, v1.22.0 Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants