Skip to content

Run Traefik Mesh E2E with the Kubernetes Agent backend - #24897

Merged
nubtron merged 9 commits into
masterfrom
nubtron/traefik-mesh-kubernetes-agent-e2e
Aug 20, 2026
Merged

Run Traefik Mesh E2E with the Kubernetes Agent backend#24897
nubtron merged 9 commits into
masterfrom
nubtron/traefik-mesh-kubernetes-agent-e2e

Conversation

@nubtron

@nubtron nubtron commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Runs the Traefik Mesh Kind E2E with the Kubernetes Agent backend introduced by #24639.

  • The traefik_controller_api_endpoint (port 9000) uses the in-cluster Service DNS endpoint, http://traefik-mesh-controller.traefik-mesh.svc.cluster.local:9000, backed by the traefik-mesh-controller Service (port: 9000 -> targetPort: api).
  • The openmetrics_endpoint / traefik_proxy_api_endpoint (port 8080) has no matching Service (the proxy is a DaemonSet), so it falls back to the pod IP of the traefik-mesh-proxy DaemonSet, fetched via kubectl get pods -n traefik-mesh --selector app=maesh,component=maesh-mesh,release=traefik-mesh. The IP is cached via save_state/get_state since dd_environment re-runs in a fresh process after teardown.
  • Removes the ExitStack/port_forward setup; the Agent runs in a pod inside the kind cluster (agent_type: kubernetes), eliminating the port-forward startup race.

Motivation

Reduces Kind E2E flakes caused by the Agent running outside the cluster with port forwarding, which introduces startup races (e.g. Connection refused to the forwarded endpoint). Running the Agent inside the cluster removes the port-forward dependency.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 18, 2026

Copy link
Copy Markdown

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 17.86%
Overall Coverage: 82.11% (-6.42%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9d7c013 | Docs | View more details | Give us feedback!

The previous `kubectl wait pods --all --for=condition=Ready` had no
`--namespace`, so it ran against `default`, where nothing is deployed, and
`run_command` defaults to `check=False`, so the resulting failure was
swallowed. The proxy pod was therefore never waited for.

A pod is assigned its IP when it is scheduled, before Traefik starts
listening on port 8080, so without this barrier the in-cluster Agent can
still fail its first scrape with a connection error.
The single condition reported only the pod count, so a pod that existed
but had no IP yet produced the contradictory message "expected exactly one
pod with a pod IP, found 1". Split the two failures apart and include the
pod names, or the pod name and phase, in the error.

Also record the single-node Kind assumption behind expecting exactly one
pod for a DaemonSet.
`get_state` returns `None` when the state was never saved, which silently
produced `http://None:8080/metrics` and surfaced later as an opaque scrape
error. The check is limited to the set-up phase because the state is
intentionally absent during other phases.
The endpoint was set to the `/metrics` URL, which only worked because the
check joins it with the root-absolute path `/api/version`, discarding the
`/metrics` suffix. Passing the API root instead matches how the option is
documented and configured by users, and keeps `openmetrics_endpoint` as the
only endpoint carrying the `/metrics` path.
No test requests the fixture, and the `traefik_instance` state existed only
to feed it: the E2E configuration reaches the Agent through the value
`dd_environment` yields.
The comment said the code "only runs once, when the Kind cluster is
created", which glosses over retries and does not say why caching is needed.
Match the phrasing used in the weaviate conftest, which states the reason:
later fixture invocations run in a fresh process, after teardown.
@nubtron nubtron added the qa/skip-qa Automatically skip this PR for the next QA label Aug 19, 2026 — with ddtool CLI
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 19, 2026

Copy link
Copy Markdown

evalya-impact-summary

evalya impact analysis
Impact analysis: RUN-ALL — every test task will run
Trigger:         empty diff (default branch, scheduled run, or shallow-clone fallback)
Test tasks:      0 (all selected)
Publish tasks:   1 (always emitted)
Diff:            empty (no diff information)

Learn more about CI impact filtering

@nubtron
nubtron marked this pull request as ready for review August 19, 2026 16:07
@nubtron
nubtron requested a review from a team as a code owner August 19, 2026 16:07
@dd-octo-sts

dd-octo-sts Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@nubtron
nubtron added this pull request to the merge queue Aug 20, 2026
Merged via the queue into master with commit 0944e3f Aug 20, 2026
44 checks passed
@nubtron
nubtron deleted the nubtron/traefik-mesh-kubernetes-agent-e2e branch August 20, 2026 12:26
@dd-octo-sts dd-octo-sts Bot added this to the 7.83.0 milestone Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants