|
| 1 | += Cluster Resource Relationships in Turtles |
| 2 | + |
| 3 | +== Overview |
| 4 | + |
| 5 | +Rancher integrates several components that define their own `Cluster` custom resources. |
| 6 | +Rancher Turtles builds on this foundation using Cluster API and Fleet, which can lead to confusion around how these `Cluster` resources interact and what users should edit. |
| 7 | + |
| 8 | +This document explains the purpose, behavior, and relationships between the following cluster resources: |
| 9 | + |
| 10 | +* `clusters.cluster.x-k8s.io` (CAPI Cluster) |
| 11 | +* `clusters.fleet.cattle.io` (Fleet Cluster) |
| 12 | +* `clusters.provisioning.cattle.io` (Provisioning Cluster) |
| 13 | +* `clusters.management.cattle.io` (Management Cluster) |
| 14 | + |
| 15 | +== Resource Summary |
| 16 | + |
| 17 | +|=== |
| 18 | +| API Group | Cluster Resource | Role |
| 19 | + |
| 20 | +| `cluster.x-k8s.io` |
| 21 | +| CAPI Cluster |
| 22 | +| Defines the cluster lifecycle and topology. Acts as the source of truth in Turtles. |
| 23 | + |
| 24 | +| `fleet.cattle.io` |
| 25 | +| Fleet Cluster |
| 26 | +| Used for GitOps bundle targeting and application synchronization via Fleet. |
| 27 | + |
| 28 | +| `provisioning.cattle.io` |
| 29 | +| Provisioning Cluster |
| 30 | +| Rancher’s earlier general-purpose cluster abstraction. Encapsulates both infrastructure-agnostic and provider-specific configuration, and is required for generating cluster registration tokens and manifests. In Rancher Turtles, this resource has been used to wrap imported CAPI clusters, but it is being phased out. |
| 31 | + |
| 32 | +| `management.cattle.io` |
| 33 | +| Management Cluster |
| 34 | +| Rancher’s current cluster representation. `management.cattle.io/v3` clusters are now the default resource created and managed by Turtles. This should not be confused with CAPI-managed clusters, where “managed” refers to Cluster API lifecycle management, not Rancher’s `management.cattle.io` API group. |
| 35 | +|=== |
| 36 | + |
| 37 | +== Relationships |
| 38 | + |
| 39 | +=== CAPI Cluster → Fleet Cluster |
| 40 | + |
| 41 | +When the Cluster API Add-on Provider for Fleet (CAAPF) is enabled, it propagates labels and annotations from the CAPI `Cluster` to the corresponding Fleet `Cluster`. This enables targeting GitOps bundles via label selectors. CAAPF creates the corresponding Fleet `Cluster` resource after the CAPI `Cluster` reaches the `ControlPlaneInitialized` condition. |
| 42 | + |
| 43 | +=== CAPI Cluster → Provisioning Cluster (Legacy) |
| 44 | + |
| 45 | +A `provisioning.cattle.io.Cluster` may be created to wrap the CAPI Cluster and expose Rancher-specific fields (e.g., display name, RKE config). However, in most Rancher Turtles workflows it is being phased out and the user is not required to interact with this resource. |
| 46 | + |
| 47 | +=== Management Cluster → Provisioning Cluster |
| 48 | + |
| 49 | +For legacy clusters, a `provisioning.cattle.io/v1.Cluster` may be generated from a `management.cattle.io/v3.Cluster`. This object is used by Rancher’s UI and APIs and is not intended for direct modification by users. |
| 50 | +New clusters managed solely via Turtles do not automatically create a `provisioning.cattle.io` cluster. |
| 51 | + |
| 52 | +== Propagation Behavior |
| 53 | + |
| 54 | +|=== |
| 55 | +| From → To | Propagation | Notes |
| 56 | + |
| 57 | +| CAPI → Fleet |
| 58 | +| Yes |
| 59 | +| Propagated by CAAPF |
| 60 | + |
| 61 | +| CAPI → Provisioning |
| 62 | +| No |
| 63 | +| Not automatically created; only generated via Turtles for legacy clusters |
| 64 | + |
| 65 | +| CAPI → Management |
| 66 | +| No |
| 67 | +| Only via Provisioning Cluster for legacy clusters |
| 68 | + |
| 69 | +| Provisioning → Fleet |
| 70 | +| No |
| 71 | +| Not supported |
| 72 | + |
| 73 | +| Fleet → CAPI |
| 74 | +| No |
| 75 | +| Not supported |
| 76 | + |
| 77 | +| Management → Provisioning |
| 78 | +| Conditional |
| 79 | +| Only for legacy clusters; new Turtles-managed clusters do not generate provisioning clusters |
| 80 | +|=== |
| 81 | + |
| 82 | +== What Should User Edit? |
| 83 | + |
| 84 | +=== Recommended: `cluster.x-k8s.io.Cluster` |
| 85 | + |
| 86 | +The CAPI Cluster is the authoritative resource for cluster definition in Rancher Turtles. |
| 87 | +Labels must be placed on the CAPI Cluster object. They will automatically propagate to the Fleet Cluster, enabling label-based bundle selectors to work as expected. |
| 88 | + |
| 89 | +=== Conditional: `provisioning.cattle.io.Cluster` |
| 90 | + |
| 91 | +Only required when using Rancher-native provisioning features (e.g., `spec.rkeConfig`, UI-driven flows). Avoid editing unless explicitly required. |
| 92 | + |
| 93 | +=== Avoid: `fleet.cattle.io.Cluster` |
| 94 | + |
| 95 | +Fleet Clusters are managed automatically. Edits are discouraged unless working on Fleet internals. |
| 96 | + |
| 97 | +=== Avoid: `management.cattle.io.Cluster` |
| 98 | + |
| 99 | +These resources are internal and fully managed by Rancher. Do not modify them. |
| 100 | + |
| 101 | +[NOTE] |
| 102 | +==== |
| 103 | +* The **CAPI Cluster** is the source of truth. |
| 104 | +* **Fleet Clusters** are generated automatically from CAPI Clusters via CAAPF. |
| 105 | +* **Provisioning** and **Management Clusters** are *not required* unless Rancher provisioning is involved. |
| 106 | +==== |
| 107 | + |
| 108 | +[TIP] |
| 109 | +==== |
| 110 | +Use the CAPI Cluster’s labels to drive Fleet bundle deployment. The CAAPF controller ensures those labels are synced to the Fleet Cluster object. |
| 111 | +==== |
| 112 | + |
| 113 | +== References |
| 114 | + |
| 115 | +* https://github.com/rancher/cluster-api-addon-provider-fleet[Cluster API Add-on Provider for Fleet (CAAPF)] |
| 116 | +* https://fleet.rancher.io[Fleet documentation] |
| 117 | +* https://extensions.rancher.io/internal/code-base-works/cluster-management-resources#cluster-resources[Rancher Cluster Internals] |
0 commit comments