datadog-operator icon indicating copy to clipboard operation
datadog-operator copied to clipboard

[AGENTONB-2593] DDOT gateway with interface component

Open tbavelier opened this issue 3 months ago • 2 comments

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 avatar Oct 30 '25 13:10 tbavelier

Codecov Report

:x: Patch coverage is 0.47393% with 210 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 37.01%. Comparing base (490d736) to head (2b17956).

Files with missing lines Patch % Lines
...ler/datadogagent/component_otelcollectorgateway.go 0.00% 48 Missing :warning:
...dogagentinternal/component_otelcollectorgateway.go 0.00% 48 Missing :warning:
...datadogagent/component/otelagentgateway/default.go 0.00% 45 Missing :warning:
...r/datadogagent/feature/otelagentgateway/feature.go 0.00% 25 Missing :warning:
...nal/controller/datadogagent/global/dependencies.go 0.00% 13 Missing :warning:
pkg/testutils/builder.go 0.00% 8 Missing :warning:
pkg/constants/utils.go 0.00% 7 Missing :warning:
internal/controller/datadogagent/common/utils.go 0.00% 4 Missing :warning:
.../controller/datadogagent/feature/test/testsuite.go 0.00% 4 Missing :warning:
...roller/datadogagent/global/otelcollectorgateway.go 0.00% 4 Missing :warning:
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2276      +/-   ##
==========================================
- Coverage   37.32%   37.01%   -0.32%     
==========================================
  Files         290      296       +6     
  Lines       24720    24930     +210     
==========================================
+ Hits         9226     9227       +1     
- Misses      14781    14989     +208     
- Partials      713      714       +1     
Flag Coverage Δ
unittests 37.01% <0.47%> (-0.32%) :arrow_down:

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 51.85% <ø> (ø)
internal/controller/datadogagent/profile.go 73.61% <100.00%> (+0.18%) :arrow_up:
...er/datadogagent/component/otelagentgateway/rbac.go 0.00% <0.00%> (ø)
...er/datadogagent/controller_reconcile_v2_helpers.go 54.96% <0.00%> (-0.86%) :arrow_down:
internal/controller/datadogagent/common/utils.go 0.00% <0.00%> (ø)
.../controller/datadogagent/feature/test/testsuite.go 0.00% <0.00%> (ø)
...roller/datadogagent/global/otelcollectorgateway.go 0.00% <0.00%> (ø)
pkg/constants/utils.go 8.20% <0.00%> (-0.46%) :arrow_down:
pkg/testutils/builder.go 0.00% <0.00%> (ø)
...nal/controller/datadogagent/global/dependencies.go 18.87% <0.00%> (-1.04%) :arrow_down:
... and 4 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 490d736...2b17956. Read the comment docs.

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

codecov-commenter avatar Oct 30 '25 13:10 codecov-commenter

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 03633261:

╰─❯ 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>

tbavelier avatar Oct 31 '25 10:10 tbavelier