Run Traefik Mesh E2E with the Kubernetes Agent backend - #24897
Merged
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 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.
evalya-impact-summaryevalya impact analysis |
Contributor
Validation ReportAll 21 validations passed. Show details
|
sarah-witt
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Runs the Traefik Mesh Kind E2E with the Kubernetes Agent backend introduced by #24639.
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 thetraefik-mesh-controllerService (port: 9000->targetPort: api).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 thetraefik-mesh-proxyDaemonSet, fetched viakubectl get pods -n traefik-mesh --selector app=maesh,component=maesh-mesh,release=traefik-mesh. The IP is cached viasave_state/get_statesincedd_environmentre-runs in a fresh process after teardown.ExitStack/port_forwardsetup; 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 refusedto the forwarded endpoint). Running the Agent inside the cluster removes the port-forward dependency.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged