Skip to content

Run Flux CD E2E with the Kubernetes Agent backend - #24829

Open
vitkyrka wants to merge 2 commits into
masterfrom
vwhitchurch/fluxcd-kubernetes-agent-e2e
Open

Run Flux CD E2E with the Kubernetes Agent backend#24829
vitkyrka wants to merge 2 commits into
masterfrom
vwhitchurch/fluxcd-kubernetes-agent-e2e

Conversation

@vitkyrka

@vitkyrka vitkyrka commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Runs the Flux CD Kind E2E with the Kubernetes Agent backend introduced by #24639, following the pattern established for Argo Rollouts in #24674.

The dd_environment fixture no longer port-forwards from the host; instead it builds endpoints that are reachable from inside the Kind cluster:

  • source-controller and notification-controller do have a Kubernetes Service, but that Service only forwards its port 80 to the controller's API port (9090), not to the Prometheus metrics port (8080) — confirmed by inspecting the Endpoints object and by a manual in-cluster wget against the Service DNS name, which times out on :8080. Service DNS therefore cannot be used to reach /metrics for these two controllers.
  • helm-controller and kustomize-controller have no Service at all.

Because none of the four controllers' metrics ports are reachable via a Service, all four use their pod's IP directly on port 8080 (the port the shipped allow-scraping NetworkPolicy explicitly opens to cross-namespace ingress, confirming it's the intended scrape path). Each controller is a single-replica Deployment, so the pod IP is unambiguous. The pod IP is looked up once inside setup_fluxcd() — while the Kind cluster is guaranteed to still be up — and cached with datadog_checks.dev._env.save_state/get_state (mirroring get_node_agent() in #24645 for Velero), so ddev env test and ddev env stop, which re-invoke dd_environment in a fresh process, don't need to re-run kubectl against a cluster that may already be gone.

Validation:

  • ddev test -fs fluxcd
  • ddev --no-interactive test fluxcd (4 passed, 1 E2E skipped)
  • ddev env show fluxcd (py3.13)
  • ddev env start --dev fluxcd py3.13
  • ddev env test --dev fluxcd py3.13 (1 passed, 4 deselected)
  • ddev env stop fluxcd py3.13

Motivation

This PR migrates Flux CD to the new backend. Running the Agent inside the same Kind cluster removes the long-lived host-side kubectl port-forward processes without changing the E2E setup, waits, instance shape, assertions, or timeout behavior.

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

Convert fluxcd's dd_environment fixture from host-side port-forwarding to
reaching the flux-system controllers from inside the Kind cluster. The
flux-system Services only expose each controller's API port, not the
Prometheus metrics port, so Service DNS cannot reach /metrics; instead the
pod IP of all four single-replica controller Deployments is fetched once
during cluster setup and cached via ddev's save_state/get_state, so later
`ddev env` invocations (including `stop`) don't need to re-run kubectl
against a cluster that may already be gone.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

evalya-impact-summary

evalya impact analysis
Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   0 (always emitted)
Diff (1 file):
  fluxcd/tests/conftest.py

Debug a specific task: evalya plan impact --path <path> --task <task>

Learn more about CI impact filtering

@datadog-datadog-prod-us1-2

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

Copy link
Copy Markdown

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 37.50%
Overall Coverage: 87.85% (-0.56%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b8cbbc9 | Docs | Datadog PR Page | Give us feedback!

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcda1e9390

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread fluxcd/tests/conftest.py Outdated
Addresses a Codex review finding on PR #24829.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vitkyrka
vitkyrka marked this pull request as ready for review August 12, 2026 08:07
@vitkyrka
vitkyrka requested a review from a team as a code owner August 12, 2026 08:07
@dd-octo-sts

dd-octo-sts Bot commented Aug 12, 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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant