Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BundleNamespaceMapping generation #217

Conversation

Danil-Grigorev
Copy link
Contributor

@Danil-Grigorev Danil-Grigorev commented Mar 18, 2025

When a CAPI Cluster references a ClusterClass in a different namespace, a corresponding ClusterGroup is created in the Cluster namespace. This ensures that all clusters within the namespace sharing the same ClusterClass from other namespace are grouped together.

This ClusterGroup inherits ClusterClass labels, as well as applies two CAAPF specific labels to uniquely identify the group pointing to this ClusterClass in the cluster scope:

  • clusterclass-name.fleet.addons.cluster.x-k8s.io: <class-name>
  • clusterclass-namespace.fleet.addons.cluster.x-k8s.io: <class-ns>

Additionally, this configuration enables the creation of a BundleNamespaceMapping. The mapping selects all available bundles and establishes a link between the namespace of the Cluster and the namespace of the referenced ClusterClass. This allows Fleet Cluster to be evaluated as a target for application sources such as Bundles, HelmApps, or GitRepos, located in the ClusterClass namespace.

To configure this behavior, FleetAddonConfig should contain the following:

apiVersion: addons.cluster.x-k8s.io/v1alpha1
kind: FleetAddonConfig
metadata:
  name: fleet-addon-config
spec:
  cluster:
    applyClassGroup: true

Setting applyClassGroup: true ensures that Fleet automatically creates ClusterGroup object for Cluster resource and applies the necessary BundleNamespaceMapping for the cross-namespace bundle access.

Fixes #216

@Danil-Grigorev Danil-Grigorev force-pushed the bundle-namespace-mapping-support branch 6 times, most recently from c7262bc to ecf2916 Compare March 18, 2025 18:37
@Danil-Grigorev Danil-Grigorev force-pushed the bundle-namespace-mapping-support branch 2 times, most recently from 56e78b8 to 2cdd0cf Compare March 19, 2025 07:33
@Danil-Grigorev Danil-Grigorev force-pushed the bundle-namespace-mapping-support branch from 2cdd0cf to 9ca5d31 Compare March 19, 2025 08:00
@Danil-Grigorev Danil-Grigorev force-pushed the bundle-namespace-mapping-support branch from 900f49a to 3efe946 Compare March 19, 2025 09:25
@Danil-Grigorev Danil-Grigorev added this pull request to the merge queue Mar 19, 2025
Merged via the queue into rancher-sandbox:main with commit 9c46365 Mar 19, 2025
11 checks passed
@Danil-Grigorev Danil-Grigorev deleted the bundle-namespace-mapping-support branch March 19, 2025 12:26
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.

Explore automation based on BundleNamespaceMapping for cross-namespaced ClusterClasses
2 participants