Skip to content

[πŸ› Bug]: HelmReleases missing from topology with FluxCD β‰₯ 2.7Β #5394

@gecube

Description

@gecube

Summary

KeepHQ @ 0.1.93 does not display any HelmRelease objects on the topology map when integrated with FluxCD 2.7.2.
Only Kustomization and GitRepository resources are shown.

As a result, the FluxCD integration becomes practically unusable for modern clusters.


🧩 Environment

Component Version
Kubernetes distro k3s (not relevant)
KeepHQ chart keep@0.1.93
FluxCD v2.7.2
Helm Controller v1.4.2
Kustomize Controller v1.7.1
Source Controller v1.7.2
Notification Controller v1.7.3
Image Controller v1.0.2

🧠 Root cause

Since FluxCD 2.7, API versions of several resources changed.
For example, helmreleases.helm.toolkit.fluxcd.io moved from v2beta2 to v2.

Running kubectl api-resources | grep flux now returns:

helmreleases                        hr                   helm.toolkit.fluxcd.io/v2                 true         HelmRelease
imagepolicies                       imgpol,imagepol      image.toolkit.fluxcd.io/v1                true         ImagePolicy
imagerepositories                   imgrepo,imagerepo    image.toolkit.fluxcd.io/v1                true         ImageRepository
imageupdateautomations              iua,imgupd,imgauto   image.toolkit.fluxcd.io/v1                true         ImageUpdateAutomation
kustomizations                      ks                   kustomize.toolkit.fluxcd.io/v1            true         Kustomization
alerts                                                   notification.toolkit.fluxcd.io/v1beta3    true         Alert
providers                                                notification.toolkit.fluxcd.io/v1beta3    true         Provider
receivers                                                notification.toolkit.fluxcd.io/v1         true         Receiver
artifactgenerators                  ag                   source.extensions.fluxcd.io/v1beta1       true         ArtifactGenerator
buckets                                                  source.toolkit.fluxcd.io/v1               true         Bucket
externalartifacts                                        source.toolkit.fluxcd.io/v1               true         ExternalArtifact
gitrepositories                     gitrepo              source.toolkit.fluxcd.io/v1               true         GitRepository
helmcharts                          hc                   source.toolkit.fluxcd.io/v1               true         HelmChart
helmrepositories                    helmrepo             source.toolkit.fluxcd.io/v1               true         HelmRepository
ocirepositories                     ocirepo              source.toolkit.fluxcd.io/v1               true         OCIRepository

However, in the current codebase (see line 483):

πŸ‘‰ fluxcd_provider.py#L483

The provider hardcodes the old API group/version helm.toolkit.fluxcd.io/v2beta2, so HelmReleases from the new API version are never discovered.


🧰 Steps to reproduce

  1. Install FluxCD 2.7.x on any cluster
  2. Install KeepHQ 0.1.93 via Helm
  3. Add FluxCD provider in values.yaml (works, provider is visible)
  4. Open Topology view β†’ only Kustomizations + GitRepositories appear, HelmReleases are missing

πŸ’‘ Expected behavior

  • KeepHQ should discover HelmReleases regardless of their API version
  • The provider should support both:
    • helm.toolkit.fluxcd.io/v2beta2 (old FluxCD)
    • helm.toolkit.fluxcd.io/v2 (new FluxCD β‰₯ 2.7)

βœ… Suggested fix

In fluxcd_provider.py, update resource discovery logic to gracefully detect available API versions before querying resources.

Pseudo-code:

api_versions = [
    "helm.toolkit.fluxcd.io/v2",
    "helm.toolkit.fluxcd.io/v2beta2",
]

for api_version in api_versions:
    try:
        result = k8s_client.list_cluster_custom_object(api_version, "helmreleases")
        if result["items"]:
            break
    except ApiException as e:
        continue

This will ensure backward compatibility and proper detection on both new and old FluxCD installations.


Labels: type:bug area:integration-fluxcd priority:high

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions