Skip to content

fluxcd: add container-based config discovery support - #24510

Open
vitkyrka wants to merge 1 commit into
masterfrom
vwhitchurch/fluxcd-discovery
Open

fluxcd: add container-based config discovery support#24510
vitkyrka wants to merge 1 commit into
masterfrom
vwhitchurch/fluxcd-discovery

Conversation

@vitkyrka

@vitkyrka vitkyrka commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Rebased onto master now that the generic config-discovery infrastructure (the from_named_ports strategy and the datadog_checks.dev.kubernetes E2E harness) has merged via #24886, and the test infra for this integration is already on the Kubernetes Agent E2E backend.

Adds container-based config discovery support to fluxcd.

Discovery finds the FluxCD controller metrics endpoints using the named Kubernetes port http-prom.

The ad_identifiers targets somewhat generic short image names (source-controller, helm-controller, etc.) so we use a CEL selector to narrow those to FluxCD images. ad_identifiers covers all six flux-system controllers, including image-reflector-controller; the kind fixture's install.yaml deliberately excludes that controller's Deployment (it never reached Ready in CI), so it has no running pod for the E2E tests to exercise, but Autodiscovery will still match it in a real cluster.

The E2E discovery test validates that Kubernetes Autodiscovery finds all five FluxCD controller instances deployed by the kind fixture (the four covered by the non-discovery E2E test plus image-automation-controller, which the non-discovery test's fixed controller list doesn't include), and a separate test probes each of those five controllers individually to confirm generated discovery candidates don't destabilize them.

Motivation

https://datadoghq.atlassian.net/browse/DSCVR-529

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

@vitkyrka vitkyrka added the qa/skip-qa Automatically skip this PR for the next QA label Jul 10, 2026
vitkyrka added a commit that referenced this pull request Jul 10, 2026
Also renames the two changelog entries inherited from the unmerged
vwhitchurch/keda-discovery base branch (keda/changelog.d/24459.added,
datadog_checks_dev/changelog.d/24459.added) to this PR's number, since
the PR-changelog CI check flags them as belonging to the wrong PR when
diffed against master.

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 71.43%
Overall Coverage: 87.61% (-1.03%)

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

@vitkyrka
vitkyrka changed the base branch from master to vwhitchurch/keda-discovery July 10, 2026 22:07
@vitkyrka
vitkyrka changed the base branch from vwhitchurch/keda-discovery to graphite-base/24510 July 15, 2026 14:17
@vitkyrka
vitkyrka force-pushed the graphite-base/24510 branch from 2c0dc75 to 9f91003 Compare July 15, 2026 14:17
@vitkyrka
vitkyrka force-pushed the vwhitchurch/fluxcd-discovery branch from 518ac33 to e761168 Compare July 15, 2026 14:17
@vitkyrka
vitkyrka changed the base branch from graphite-base/24510 to vwhitchurch/argo_workflows-discovery July 15, 2026 14:17

vitkyrka commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vitkyrka
vitkyrka changed the base branch from vwhitchurch/argo_workflows-discovery to graphite-base/24510 July 16, 2026 08:51
@vitkyrka
vitkyrka force-pushed the vwhitchurch/fluxcd-discovery branch from 5f1a24a to e20786c Compare July 16, 2026 09:01
@vitkyrka
vitkyrka force-pushed the graphite-base/24510 branch from 9f91003 to e5340cc Compare July 16, 2026 09:01
@vitkyrka
vitkyrka changed the base branch from graphite-base/24510 to vwhitchurch/argo_workflows-discovery July 16, 2026 09:01
@vitkyrka
vitkyrka force-pushed the vwhitchurch/fluxcd-discovery branch from e20786c to ebc0188 Compare August 21, 2026 10:06
@vitkyrka
vitkyrka changed the base branch from vwhitchurch/argo_workflows-discovery to master August 21, 2026 10:07
@vitkyrka vitkyrka closed this Aug 21, 2026
@vitkyrka vitkyrka reopened this Aug 21, 2026
@vitkyrka
vitkyrka force-pushed the vwhitchurch/fluxcd-discovery branch from ebc0188 to 789f0b6 Compare August 21, 2026 10:36
@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:   1 (always emitted)
Diff (9 files):
  fluxcd/assets/configuration/spec.yaml
  fluxcd/changelog.d/24510.added
  fluxcd/datadog_checks/fluxcd/config_models/discovery.py
  fluxcd/datadog_checks/fluxcd/config_models/discovery_overrides.py
  fluxcd/datadog_checks/fluxcd/config_models/discovery_strategies.py
  fluxcd/datadog_checks/fluxcd/data/auto_conf.yaml
  fluxcd/pyproject.toml
  fluxcd/tests/conftest.py
  fluxcd/tests/test_e2e.py

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

Learn more about CI impact filtering

@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: 7b68c7fbf4

ℹ️ 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 on lines +29 to +33
- helm-controller
- image-automation-controller
- kustomize-controller
- notification-controller
- source-controller

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add image-reflector-controller to autodiscovery

When Flux image automation is installed, it includes image-reflector-controller alongside image-automation-controller, and that controller exposes metrics through the same named http-prom port. Because ad_identifiers is an allow-list and omits image-reflector-controller, Autodiscovery never creates a FluxCD check for it, leaving its metrics uncollected. The E2E fixture removes this controller, so the five-controller test does not expose the omission; add the identifier to both the spec and generated auto_conf.yaml and cover it with the discovery test.

Useful? React with 👍 / 👎.

Rebased onto master now that the generic config-discovery infrastructure
has merged via #24886. Adds a discovery block (openmetrics_from_named_ports,
http-prom port) and auto_conf.yaml (five controller ad_identifiers plus a
CEL selector narrowing to fluxcd/ images) to spec.yaml, an auto_conf
metadata key so the Kubernetes Agent backend mounts the discovery
template, and discovery E2E tests covering all five flux-system
controllers (including image-automation-controller, which isn't part of
the non-discovery E2E test's fixed controller list).

Environment: Datadog workspace

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vitkyrka
vitkyrka force-pushed the vwhitchurch/fluxcd-discovery branch from 7b68c7f to 2b5b0de Compare August 21, 2026 12:11
@dd-octo-sts

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