Skip to content

flux: generic controller support#858

Merged
illume merged 1 commit into
headlamp-k8s:mainfrom
cschindlbeck:feat-flux-generic-controller-support
Jun 29, 2026
Merged

flux: generic controller support#858
illume merged 1 commit into
headlamp-k8s:mainfrom
cschindlbeck:feat-flux-generic-controller-support

Conversation

@cschindlbeck

@cschindlbeck cschindlbeck commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Problem

The Controllers section in Flux Checks was built on a hardcoded allowlist of pod label selectors covering only the six standard Flux controllers plus source-watcher. Any third-party controller deployed alongside Flux — such as terraform-runner-tofu-controller (Tofu/OpenTofu) — was silently omitted.

Additionally, the pod list was scoped to fluxCheck.namespace, which defaults to an empty string on non-bootstrapped clusters, causing Headlamp to fall back to listing pods across all namespaces.

Changes

  • Switch from pods to deployments as the data source for the Controllers table. Deployments give a cleaner picture of intent (desired vs. ready replicas) compared to individual pod phase.
  • Generic name-based filter: include any deployment in the flux namespace whose name contains controller or watcher. This picks up all standard Flux controllers, source-watcher, terraform-runner-tofu-controller, and any future additions without code changes.
  • Namespace fix: scope the deployment list to fluxCheck.namespace || 'flux-system' so it never accidentally queries all namespaces on non-bootstrapped clusters.
  • Health checks updated: useFluxHealth and the accordion status badge now compare readyReplicas === replicas instead of phase === 'Running'.
  • Controllers table updated: name links to the deployment detail page, status column shows X/Y ready replicas, image path corrected to spec.template.spec.containers[0].image.

@cschindlbeck cschindlbeck force-pushed the feat-flux-generic-controller-support branch 2 times, most recently from 811d37b to 27fc149 Compare June 26, 2026 11:20
@cschindlbeck cschindlbeck marked this pull request as draft June 26, 2026 11:21
@cschindlbeck cschindlbeck force-pushed the feat-flux-generic-controller-support branch from 59e06e6 to 43bc88c Compare June 26, 2026 12:09
@cschindlbeck cschindlbeck marked this pull request as ready for review June 26, 2026 12:09
@illume illume requested a review from Copilot June 26, 2026 13:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Flux plugin’s “Controllers” health and display logic to support third-party Flux-adjacent controllers by switching the Controllers data source from Pods to Deployments, and by using a generic controller/watcher name filter. It also aims to prevent unintended all-namespace queries on non-bootstrapped clusters.

Changes:

  • Switched Controllers discovery from Pod listing to Deployment listing and filtered deployments by name containing controller/watcher.
  • Updated health/readiness logic and UI to use deployment replica readiness instead of pod phase.
  • Updated Controllers table to link to Deployment details and to display ready replica counts and the container image from the deployment template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread flux/src/overview/index.tsx
Comment thread flux/src/overview/index.tsx
Comment thread flux/src/overview/index.tsx
Comment thread flux/src/overview/index.tsx Outdated
@illume

illume commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Please check the git commit message follows the format... something like:

flux: Support generic controllers in flux plugin within flux-system
...

@cschindlbeck cschindlbeck force-pushed the feat-flux-generic-controller-support branch from d40c9d8 to beb0b62 Compare June 26, 2026 17:13
Signed-off-by: Chris Schindlbeck <chris.schindlbeck@gmail.com>
@cschindlbeck cschindlbeck force-pushed the feat-flux-generic-controller-support branch from beb0b62 to acbc3ea Compare June 26, 2026 17:13
@cschindlbeck cschindlbeck changed the title feat(flux): generic controller support flux: generic controller support Jun 29, 2026
@cschindlbeck

Copy link
Copy Markdown
Contributor Author

@illume tested in the cluster, works. also changed commit message and implemented ghcp suggestions

@illume illume left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome, thanks! 🎉

@illume illume merged commit 4d8032f into headlamp-k8s:main Jun 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants