You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add bootstrapLocalCluster option to FleetAddonConfig (#308)
Introduces a new boolean field `bootstrapLocalCluster` to the FleetAddonConfig CRD spec.
This option controls the auto-installation of a fleet agent in the local cluster.
The controller logic is updated to read and utilize this new configuration value.
Signed-off-by: Danil-Grigorev <[email protected]>
Copy file name to clipboardExpand all lines: docs/src/04_reference/01_import-strategy.md
+2-67Lines changed: 2 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ CAAPF follows a simple import strategy for CAPI clusters:
4
4
5
5
1. Each CAPI cluster has a corresponding Fleet `Cluster` object.
6
6
2. Each CAPI Cluster Class has a corresponding Fleet `ClusterGroup` object.
7
-
3. When a CAPI `Cluster` references a `ClusterClass` in a different namespace, a `ClusterGroup` is created in the `Cluster` namespace. This `ClusterGroup` targets all clusters in this namespace that reference the same `ClusterClass`. See the [configuration](#cluster-clustergroupbundlenamespacemapping-configuration) section for details.
7
+
3. When a CAPI `Cluster` references a `ClusterClass` in a different namespace, a `ClusterGroup` is created in the `Cluster` namespace. This `ClusterGroup` targets all clusters in this namespace that reference the same `ClusterClass`. See the [configuration](03_fleet-addon-config#applyclassgroup) section for details.
8
8
4. If at least one CAPI `Cluster` references a `ClusterClass` in a different namespace, a [`BundleNamespaceMapping`][mapping] is created in the `ClusterClass` namespace. This allows Fleet `Cluster` resources to use application sources such as `Bundles`, `HelmApps`, or `GitRepos` from the `ClusterClass` namespace as if they were deployed in the `Cluster` namespace. See the [configuration](#cluster-clustergroupbundlenamespacemapping-configuration) section for details.
**By default, `CAAPF` imports all `CAPI` clusters under Fleet management. See the next section for configuration details.**
12
+
**By default, `CAAPF` imports all `CAPI` clusters under Fleet management. See the [configuration](03_fleet-addon-config.md#applyclassgroup) section for details.**
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 that share the same `ClusterClass` from another namespace are grouped together.
35
-
36
-
This `ClusterGroup` inherits `ClusterClass` labels and applies two `CAAPF`-specific labels to uniquely identify the group within the cluster scope:
Additionally, this configuration enables the creation of a `BundleNamespaceMapping`. This mapping selects all available bundles and establishes a link between the namespace of the `Cluster` and the namespace of the referenced `ClusterClass`. This allows the Fleet `Cluster` to be evaluated as a target for application sources such as `Bundles`, `HelmApps`, or `GitRepos` from the **`ClusterClass`** namespace.
42
-
43
-
When all CAPI `Cluster` resources referencing the same `ClusterClass` are removed, both the `ClusterGroup` and `BundleNamespaceMapping` are cleaned up.
44
-
45
-
To enable this behavior, configure `FleetAddonConfig` as follows:
46
-
47
-
```yaml
48
-
apiVersion: addons.cluster.x-k8s.io/v1alpha1
49
-
kind: FleetAddonConfig
50
-
metadata:
51
-
name: fleet-addon-config
52
-
spec:
53
-
cluster:
54
-
applyClassGroup: true
55
-
```
56
-
57
-
Setting `applyClassGroup: true` ensures that Fleet automatically creates a `ClusterGroup` object for each `Cluster` resource and applies the necessary `BundleNamespaceMapping` for cross-namespace bundle access.
58
-
59
-
**Note: If the `cluster` field is not set, this setting is enabled by default.**
60
-
61
-
### Namespace Label Selection
62
-
63
-
This configuration defines how to select namespaces based on specific labels. The `namespaceSelector` field ensures that the import strategy applies only to namespaces that have the label `import: "true"`. This is useful for scoping automatic import to specific namespaces rather than applying it cluster-wide.
64
-
65
-
```yaml
66
-
apiVersion: addons.cluster.x-k8s.io/v1alpha1
67
-
kind: FleetAddonConfig
68
-
metadata:
69
-
name: fleet-addon-config
70
-
spec:
71
-
cluster:
72
-
namespaceSelector:
73
-
matchLabels:
74
-
import: "true"
75
-
```
76
-
77
-
### Cluster Label Selection
78
-
79
-
This configuration filters clusters based on labels, ensuring that the `FleetAddonConfig` applies only to clusters with the label `import: "true"`. This allows more granular per-cluster selection across the cluster scope.
0 commit comments