Skip to content

Conversation

@Mathew-Estafanous
Copy link
Contributor

@Mathew-Estafanous Mathew-Estafanous commented Feb 4, 2026

What does this PR do?

Adds a new Autodiscovery EndpointSlices listener and provider gated behind kubernetes_use_endpoint_slices config flag, defaulting to false.

The internal AD service representation for an Endpoint, KubeEndpointService, remains the same. What has changed is how a service and its check configurations are collected. The endpoint slices provider queries discovery/v1 EndpointSlices matching AD annotation checks with each endpoint address (slice.Endpoints[*].Addresses[*]) to create a config check for each endpoint.

Similarly, the EndpointSlices provider will create a KubeEndpointService for each endpoint associated with an AD annotated service OR l.targetAllEndpoints = true.

Config generation optimization (deferred)

I explored an optimization to generate one template config per service (instead of one config per endpoint IP) to reduce memory overhead for services with many endpoints. However, that change would require modifying the global configresolver.Resolve() function, or some other shared codepath, to populate the scheduled check's ADIdentifiers with pod_uid identifiers so that the node agent receiving the cluster check would schedule & tag the check appropriately. However, making such a change had some unknown risks because .Resolve() is shared with all config <-> service resolution and isn't specific to endpoint checks.

To limit scope creep and minimize risk, I'm deferring this optimization to a follow-up PR after the core EndpointSlices migration is done and validated.

Motivation

As of Kubernetes version 1.33, the Endpoints API was deprecated in favour of EndpointSlices, which partition k8s endpoint addresses into N EndpointSlices. The Agent should use the latest API groups to ensure long term stability.

Describe how you validated your changes

  1. Added unit test suite with equivalent test cases, to ensure feature parity between the new and old listener/providers.
  2. Manually QA'd endpointslices listener/provider.

Deploy service with endpoints

apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-conf
data:
  status.conf: |
    server {
      listen 81;

      location /status {
        stub_status on;
      }

      location / {
        return 404;
      }
    }

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: proxy
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:latest
          ports:
            - containerPort: 81
              name: status
              protocol: TCP
            - containerPort: 80
              name: http
              protocol: TCP
          volumeMounts:
            - mountPath: /etc/nginx/conf.d/status.conf
              subPath: status.conf
              readOnly: true
              name: "config"
      volumes:
        - name: config
          configMap:
            name: "nginx-conf"
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-svc
  annotations:
    ad.datadoghq.com/endpoints.checks: |
      {
        "nginx": {
          "init_config": {},
          "instances": [
            {
              "name": "Nginx Endpoint",
              "nginx_status_url": "http://%%host%%:%%port_status%%/status/"
            }
          ]
        }
      }
spec:
  type: NodePort
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      name: http
    - protocol: TCP
      name: status
      port: 81
      targetPort: 81
(old) Autodiscovery using deprecated Endpoints

Deploy agent with default kubernetes_use_endpoint_slices (false)

datadog:
  kubernetesUseEndpointSlices: false  # Agent will use deprecated Endpoints api.
  clusterName: <CLUSTER_NAME>
  operator:
    enabled: false
  csi:
    enabled: false
  clusterChecks:
    enabled: true
  secretBackend:
    command: "/readsecret_multiple_providers.sh"
  kubelet:
    tlsVerify: false
  logs:
    enabled: true
    containerCollectAll: true
  dogstatsd:
    nonLocalTraffic: true
    originDetection: true
    useSocketVolume: true
    tagCardinality: "high"
  envDict:
    DD_CHECKS_TAG_CARDINALITY: "high"
clusterAgent:
  enabled: true

Confirm DCA schedules cluster check

> datadog-cluster-agent configcheck -v

=== nginx cluster check ===
Configuration provider: kubernetes-endpoints
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:157e3e6240ac87c9
name: Nginx Endpoint
nginx_status_url: http://10.244.0.74:81/status/
tags:
  - kube_endpoint_ip:10.244.0.74
  - kube_namespace:default
  - kube_service:nginx-svc
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.74
* kubernetes_pod://88f36ebb-f41d-4ad3-a8f3-0e1ec8bc88f9
State: dispatched to minikube
===

=== nginx cluster check ===
Configuration provider: kubernetes-endpoints
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:69f72b99b71e3158
name: Nginx Endpoint
nginx_status_url: http://10.244.0.75:81/status/
tags:
  - kube_endpoint_ip:10.244.0.75
  - kube_namespace:default
  - kube_service:nginx-svc
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.75
* kubernetes_pod://5a809347-b32c-4d3e-9690-dae3276083d8
State: dispatched to minikube
===

=== nginx cluster check ===
Configuration provider: kubernetes-endpoints
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:ed5f83c896f7a8f4
name: Nginx Endpoint
nginx_status_url: http://10.244.0.76:81/status/
tags:
  - kube_endpoint_ip:10.244.0.76
  - kube_namespace:default
  - kube_service:nginx-svc
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.76
* kubernetes_pod://0647a877-846d-42d4-abef-e46657ad8ad5
State: dispatched to minikube

Confirm node agent runs scheduled check with pod tags

> agent configcheck -v
....
=== nginx check ===
Configuration provider: endpoints-checks
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:95263da18dc4f377
name: Nginx Endpoint
nginx_status_url: http://10.244.0.75:81/status/
tags:
  - cluster_name:mathewe-dev
  - kube_cluster_name:mathewe-dev
  - kube_deployment:proxy
  - kube_endpoint_ip:10.244.0.75
  - kube_namespace:default
  - kube_ownerref_kind:replicaset
  - kube_ownerref_name:proxy-85f8c777d8
  - kube_qos:BestEffort
  - kube_replica_set:proxy-85f8c777d8
  - kube_service:nginx-svc
  - orch_cluster_id:f656ffb0-cd75-4cbb-b815-fb8476ca35a8
  - pod_name:proxy-85f8c777d8-lxhkn
  - pod_phase:running
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.75
* kubernetes_pod://5a809347-b32c-4d3e-9690-dae3276083d8
State: dispatched to minikube

(new) Autodiscovery listener/provider using EndpointSlices

Deploy Agent with kubernetes_use_endpoint_slices enabled.

datadog:
  kubernetesUseEndpointSlices: true
  clusterName: <CLUSTER_NAME>
  operator:
    enabled: false
  csi:
    enabled: false
  clusterChecks:
    enabled: true
clusterAgent:
  enabled: true

Confirm DCA schedules cluster check for each endpoint

> datadog-cluster-agent configcheck -v

=== nginx cluster check ===
Configuration provider: kubernetes-endpointslices
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:ed5f83c896f7a8f4
name: Nginx Endpoint
nginx_status_url: http://10.244.0.76:81/status/
tags:
  - kube_endpoint_ip:10.244.0.76
  - kube_namespace:default
  - kube_service:nginx-svc
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.76
* kubernetes_pod://0647a877-846d-42d4-abef-e46657ad8ad5
State: dispatched to minikube
===

=== nginx cluster check ===
Configuration provider: kubernetes-endpointslices
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:69f72b99b71e3158
name: Nginx Endpoint
nginx_status_url: http://10.244.0.75:81/status/
tags:
  - kube_endpoint_ip:10.244.0.75
  - kube_namespace:default
  - kube_service:nginx-svc
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.75
* kubernetes_pod://5a809347-b32c-4d3e-9690-dae3276083d8
State: dispatched to minikube
===

=== nginx cluster check ===
Configuration provider: kubernetes-endpointslices
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:157e3e6240ac87c9
name: Nginx Endpoint
nginx_status_url: http://10.244.0.74:81/status/
tags:
  - kube_endpoint_ip:10.244.0.74
  - kube_namespace:default
  - kube_service:nginx-svc
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.74
* kubernetes_pod://88f36ebb-f41d-4ad3-a8f3-0e1ec8bc88f9
State: dispatched to minikube

Confirm node agent running scheduled checks with tags

> agent configcheck

=== nginx check ===
Configuration provider: endpoints-checks
Configuration source: kube_endpoints:kube_endpoint_uid://default/nginx-svc/
Config for instance ID: nginx:Nginx Endpoint:b8ca24cda61ad08
name: Nginx Endpoint
nginx_status_url: http://10.244.0.76:81/status/
tags:
  - cluster_name:mathewe-dev
  - kube_cluster_name:mathewe-dev
  - kube_deployment:proxy
  - kube_endpoint_ip:10.244.0.76
  - kube_namespace:default
  - kube_ownerref_kind:replicaset
  - kube_ownerref_name:proxy-85f8c777d8
  - kube_qos:BestEffort
  - kube_replica_set:proxy-85f8c777d8
  - kube_service:nginx-svc
  - orch_cluster_id:f656ffb0-cd75-4cbb-b815-fb8476ca35a8
  - pod_name:proxy-85f8c777d8-n69mq
  - pod_phase:running
~
Init Config:
{}
Auto-discovery IDs:
* kube_endpoint_uid://default/nginx-svc/10.244.0.76
* kubernetes_pod://0647a877-846d-42d4-abef-e46657ad8ad5
State: dispatched to minikube

Additional Notes

@github-actions github-actions bot added long review PR is complex, plan time to review it team/container-platform The Container Platform Team labels Feb 4, 2026
@agent-platform-auto-pr
Copy link
Contributor

agent-platform-auto-pr bot commented Feb 4, 2026

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 0134072
📊 Static Quality Gates Dashboard
🔗 SQG Job

Successful checks

Info

Quality gate Change Size (prev → curr → max)
agent_deb_amd64_fips +4.0 KiB (0.00% increase) 714.469 → 714.473 → 716.820
agent_rpm_amd64_fips +4.0 KiB (0.00% increase) 714.453 → 714.457 → 716.810
agent_suse_amd64_fips +4.0 KiB (0.00% increase) 714.453 → 714.457 → 716.810
docker_cluster_agent_amd64 +48.03 KiB (0.03% increase) 180.979 → 181.026 → 181.200
docker_cluster_agent_arm64 +64.03 KiB (0.03% increase) 196.809 → 196.872 → 198.490
26 successful checks with minimal change (< 2 KiB)
Quality gate Current Size
agent_deb_amd64 754.371 MiB
agent_heroku_amd64 324.200 MiB
agent_msi 663.046 MiB
agent_rpm_amd64 754.355 MiB
agent_rpm_arm64 732.834 MiB
agent_rpm_arm64_fips 695.389 MiB
agent_suse_amd64 754.355 MiB
agent_suse_arm64 732.834 MiB
agent_suse_arm64_fips 695.389 MiB
docker_agent_amd64 817.728 MiB
docker_agent_arm64 821.337 MiB
docker_agent_jmx_amd64 1008.640 MiB
docker_agent_jmx_arm64 1001.031 MiB
docker_cws_instrumentation_amd64 7.135 MiB
docker_cws_instrumentation_arm64 6.689 MiB
docker_dogstatsd_amd64 38.453 MiB
docker_dogstatsd_arm64 36.749 MiB
dogstatsd_deb_amd64 29.669 MiB
dogstatsd_deb_arm64 27.833 MiB
dogstatsd_rpm_amd64 29.669 MiB
dogstatsd_suse_amd64 29.669 MiB
iot_agent_deb_amd64 42.818 MiB
iot_agent_deb_arm64 39.935 MiB
iot_agent_deb_armhf 40.505 MiB
iot_agent_rpm_amd64 42.818 MiB
iot_agent_suse_amd64 42.818 MiB
On-wire sizes (compressed)
Quality gate Change Size (prev → curr → max)
agent_deb_amd64 +62.1 KiB (0.03% increase) 184.361 → 184.422 → 185.360
agent_deb_amd64_fips neutral 176.287 MiB → 178.780
agent_heroku_amd64 neutral 87.110 MiB → 88.450
agent_msi -20.0 KiB (0.01% reduction) 143.262 → 143.242 → 143.300
agent_rpm_amd64 -16.72 KiB (0.01% reduction) 186.761 → 186.744 → 188.860
agent_rpm_amd64_fips -36.34 KiB (0.02% reduction) 178.294 → 178.258 → 179.710
agent_rpm_arm64 -17.07 KiB (0.01% reduction) 169.045 → 169.029 → 169.930
agent_rpm_arm64_fips -7.76 KiB (0.00% reduction) 162.291 → 162.284 → 163.610
agent_suse_amd64 -16.72 KiB (0.01% reduction) 186.761 → 186.744 → 188.860
agent_suse_amd64_fips -36.34 KiB (0.02% reduction) 178.294 → 178.258 → 179.710
agent_suse_arm64 -17.07 KiB (0.01% reduction) 169.045 → 169.029 → 169.930
agent_suse_arm64_fips -7.76 KiB (0.00% reduction) 162.291 → 162.284 → 163.610
docker_agent_amd64 -2.79 KiB (0.00% reduction) 278.012 → 278.009 → 278.130
docker_agent_arm64 +4.31 KiB (0.00% increase) 265.378 → 265.382 → 266.760
docker_agent_jmx_amd64 -3.55 KiB (0.00% reduction) 346.654 → 346.651 → 346.740
docker_agent_jmx_arm64 +17.88 KiB (0.01% increase) 330.001 → 330.018 → 331.370
docker_cluster_agent_amd64 +21.4 KiB (0.03% increase) 63.923 → 63.944 → 64.510
docker_cluster_agent_arm64 +5.95 KiB (0.01% increase) 60.185 → 60.191 → 61.170
docker_cws_instrumentation_amd64 neutral 2.994 MiB → 3.330
docker_cws_instrumentation_arm64 neutral 2.726 MiB → 3.090
docker_dogstatsd_amd64 neutral 14.878 MiB → 15.820
docker_dogstatsd_arm64 neutral 14.216 MiB → 14.830
dogstatsd_deb_amd64 neutral 7.840 MiB → 8.790
dogstatsd_deb_arm64 neutral 6.727 MiB → 7.710
dogstatsd_rpm_amd64 neutral 7.850 MiB → 8.800
dogstatsd_suse_amd64 neutral 7.850 MiB → 8.800
iot_agent_deb_amd64 +2.19 KiB (0.02% increase) 11.233 → 11.235 → 12.040
iot_agent_deb_arm64 +2.38 KiB (0.02% increase) 9.600 → 9.602 → 10.450
iot_agent_deb_armhf neutral 9.800 MiB → 10.620
iot_agent_rpm_amd64 neutral 11.250 MiB → 12.060
iot_agent_suse_amd64 neutral 11.250 MiB → 12.060

@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Feb 4, 2026

Regression Detector

Regression Detector Results

Metrics dashboard
Target profiles
Run ID: dba80e83-607a-4a86-bb64-1c56cf8ae5a9

Baseline: 0134072
Comparison: 7683dac
Diff

Optimization Goals: ✅ No significant changes detected

Experiments ignored for regressions

Regressions in experiments with settings containing erratic: true are ignored.

perf experiment goal Δ mean % Δ mean % CI trials links
docker_containers_cpu % cpu utilization -3.56 [-6.55, -0.57] 1 Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI trials links
quality_gate_logs % cpu utilization +1.64 [+0.11, +3.17] 1 Logs bounds checks dashboard
otlp_ingest_logs memory utilization +1.48 [+1.39, +1.58] 1 Logs
ddot_metrics memory utilization +0.71 [+0.47, +0.95] 1 Logs
tcp_syslog_to_blackhole ingress throughput +0.70 [+0.60, +0.79] 1 Logs
otlp_ingest_metrics memory utilization +0.54 [+0.39, +0.69] 1 Logs
uds_dogstatsd_20mb_12k_contexts_20_senders memory utilization +0.24 [+0.18, +0.29] 1 Logs
ddot_metrics_sum_delta memory utilization +0.15 [-0.05, +0.35] 1 Logs
docker_containers_memory memory utilization +0.06 [-0.01, +0.13] 1 Logs
file_to_blackhole_0ms_latency egress throughput +0.06 [-0.42, +0.54] 1 Logs
uds_dogstatsd_to_api ingress throughput +0.02 [-0.11, +0.15] 1 Logs
ddot_logs memory utilization -0.00 [-0.07, +0.07] 1 Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.11, +0.10] 1 Logs
uds_dogstatsd_to_api_v3 ingress throughput -0.01 [-0.14, +0.13] 1 Logs
file_to_blackhole_1000ms_latency egress throughput -0.02 [-0.44, +0.41] 1 Logs
file_to_blackhole_500ms_latency egress throughput -0.04 [-0.41, +0.33] 1 Logs
quality_gate_idle memory utilization -0.07 [-0.12, -0.03] 1 Logs bounds checks dashboard
file_to_blackhole_100ms_latency egress throughput -0.07 [-0.12, -0.03] 1 Logs
quality_gate_idle_all_features memory utilization -0.13 [-0.17, -0.10] 1 Logs bounds checks dashboard
quality_gate_metrics_logs memory utilization -0.23 [-0.44, -0.03] 1 Logs bounds checks dashboard
file_tree memory utilization -0.31 [-0.36, -0.26] 1 Logs
ddot_metrics_sum_cumulative memory utilization -0.46 [-0.62, -0.30] 1 Logs
ddot_metrics_sum_cumulativetodelta_exporter memory utilization -0.57 [-0.80, -0.34] 1 Logs
docker_containers_cpu % cpu utilization -3.56 [-6.55, -0.57] 1 Logs

Bounds Checks: ✅ Passed

perf experiment bounds_check_name replicates_passed links
docker_containers_cpu simple_check_run 10/10
docker_containers_memory memory_usage 10/10
docker_containers_memory simple_check_run 10/10
file_to_blackhole_0ms_latency lost_bytes 10/10
file_to_blackhole_0ms_latency memory_usage 10/10
file_to_blackhole_1000ms_latency lost_bytes 10/10
file_to_blackhole_1000ms_latency memory_usage 10/10
file_to_blackhole_100ms_latency lost_bytes 10/10
file_to_blackhole_100ms_latency memory_usage 10/10
file_to_blackhole_500ms_latency lost_bytes 10/10
file_to_blackhole_500ms_latency memory_usage 10/10
quality_gate_idle intake_connections 10/10 bounds checks dashboard
quality_gate_idle memory_usage 10/10 bounds checks dashboard
quality_gate_idle_all_features intake_connections 10/10 bounds checks dashboard
quality_gate_idle_all_features memory_usage 10/10 bounds checks dashboard
quality_gate_logs intake_connections 10/10 bounds checks dashboard
quality_gate_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_logs memory_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs cpu_usage 10/10 bounds checks dashboard
quality_gate_metrics_logs intake_connections 10/10 bounds checks dashboard
quality_gate_metrics_logs lost_bytes 10/10 bounds checks dashboard
quality_gate_metrics_logs memory_usage 10/10 bounds checks dashboard

Explanation

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

CI Pass/Fail Decision

Passed. All Quality Gates passed.

  • quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
  • quality_gate_metrics_logs, bounds check cpu_usage: 10/10 replicas passed. Gate passed.

@Mathew-Estafanous Mathew-Estafanous self-assigned this Feb 4, 2026
@Mathew-Estafanous Mathew-Estafanous force-pushed the mathew.estafanous/ad-endpoint-slices branch from 2fa93da to a3f48f7 Compare February 4, 2026 23:24
@Mathew-Estafanous Mathew-Estafanous added the qa/done QA done before merge and regressions are covered by tests label Feb 6, 2026
@Mathew-Estafanous Mathew-Estafanous changed the title chore(ad_endpointslices): Add new EndpointSlices AD listener and provider chore(ad_endpointslices): Add new EndpointSlices AD listener and providers Feb 6, 2026
@Mathew-Estafanous Mathew-Estafanous changed the title chore(ad_endpointslices): Add new EndpointSlices AD listener and providers chore(autodiscovery): Add new EndpointSlices AD listener and providers Feb 6, 2026
@Mathew-Estafanous Mathew-Estafanous changed the title chore(autodiscovery): Add new EndpointSlices AD listener and providers [CONTP-1254] chore(autodiscovery): Add new EndpointSlices AD listener and providers Feb 6, 2026
@Mathew-Estafanous Mathew-Estafanous force-pushed the mathew.estafanous/ad-endpoint-slices branch 3 times, most recently from 96c18ad to 10b9350 Compare February 9, 2026 17:44
@Mathew-Estafanous Mathew-Estafanous marked this pull request as ready for review February 9, 2026 19:30
@Mathew-Estafanous Mathew-Estafanous requested review from a team as code owners February 9, 2026 19:30
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

}

// NewKubeEndpointSlicesListener returns the kube endpointslices implementation of the ServiceListener interface
func NewKubeEndpointSlicesListener(options ServiceListernerDeps) (ServiceListener, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This listener is functionality equivalent to listeners/kube_endpoints.go so referencing that listener while reviewing could be a helpful.

// NewKubeEndpointSlicesConfigProvider returns a new ConfigProvider connected to apiserver using EndpointSlices.
// Connectivity is not checked at this stage to allow for retries, Collect will do it.
// Using GetAPIClient (no wait) as Client should already be initialized by Cluster Agent main entrypoint before
func NewKubeEndpointSlicesConfigProvider(_ *pkgconfigsetup.ConfigurationProviders, telemetryStore *telemetry.Store) (types.ConfigProvider, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similarly, this provider is very similar to providers/kube_endpoints.go and is meant as a drop-in replacement of that provider.

@Mathew-Estafanous Mathew-Estafanous force-pushed the mathew.estafanous/ad-endpoint-slices branch from dad57b1 to 3f7d7ba Compare February 10, 2026 16:59
Copy link
Contributor

@triviajon triviajon left a comment

Choose a reason for hiding this comment

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

lgtm, left 2 nits and 1 question

func (ac *AutoConfig) start() {
listeners.RegisterListeners(ac.serviceListenerFactories)
providers.RegisterProviders(ac.providerCatalog)
useEndpointSlices := pkgconfigsetup.Datadog().GetBool("kubernetes_use_endpoint_slices")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be also gated behind a K8s server version check like v1.21+?

func KubeServerVersion(discoveryCl discovery.DiscoveryInterface, retryTimeout time.Duration) (*version.Info, error) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We have a follow up ticket to address this case.

Comment on lines 14 to 19
"github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver"
"github.com/DataDog/datadog-agent/pkg/util/log"
discv1 "k8s.io/api/discovery/v1"

v1 "k8s.io/api/core/v1"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, linter doesn't pickup that this is in the wrong block

Suggested change
"github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver"
"github.com/DataDog/datadog-agent/pkg/util/log"
discv1 "k8s.io/api/discovery/v1"
v1 "k8s.io/api/core/v1"
)
"github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver"
"github.com/DataDog/datadog-agent/pkg/util/log"
v1 "k8s.io/api/core/v1"
discv1 "k8s.io/api/discovery/v1"
)

servicesInformer apiserver.InformerName = "v1/services"
crdInformer apiserver.InformerName = "v1/crd"
endpointsInformer apiserver.InformerName = "v1/endpoints"
endpointSlicesInformer apiserver.InformerName = "discovery.v1/endpointslices"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
endpointSlicesInformer apiserver.InformerName = "discovery.v1/endpointslices"
endpointSlicesInformer apiserver.InformerName = "discovery.k8s.io/v1/endpointslices"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Identify a non-fork PR long review PR is complex, plan time to review it qa/done QA done before merge and regressions are covered by tests team/agent-devx team/container-platform The Container Platform Team team/kubernetes-experiences

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants