fluxcd: add container-based config discovery support - #24510
Conversation
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>
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 2b5b0de | Docs | View more details | Give us feedback! |
2c0dc75 to
9f91003
Compare
518ac33 to
e761168
Compare
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5f1a24a to
e20786c
Compare
9f91003 to
e5340cc
Compare
e20786c to
ebc0188
Compare
ebc0188 to
789f0b6
Compare
evalya-impact-summaryevalya impact analysis |
789f0b6 to
7b68c7f
Compare
There was a problem hiding this comment.
💡 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".
| - helm-controller | ||
| - image-automation-controller | ||
| - kustomize-controller | ||
| - notification-controller | ||
| - source-controller |
There was a problem hiding this comment.
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>
7b68c7f to
2b5b0de
Compare
Validation ReportAll 21 validations passed. Show details
|

What does this PR do?
Rebased onto
masternow that the generic config-discovery infrastructure (thefrom_named_portsstrategy and thedatadog_checks.dev.kubernetesE2E 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_identifierstargets somewhat generic short image names (source-controller,helm-controller, etc.) so we use a CEL selector to narrow those to FluxCD images.ad_identifierscovers all six flux-system controllers, includingimage-reflector-controller; the kind fixture'sinstall.yamldeliberately 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)
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