Skip to content

Commit 62a574c

Browse files
authored
Merge pull request #9153 from killianmuldoon/pr-test-controller-refs
🌱 Test and document controller ownerReferences
2 parents 584af03 + cedb82e commit 62a574c

File tree

2 files changed

+126
-107
lines changed

2 files changed

+126
-107
lines changed

docs/book/src/reference/owner_references.md

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,65 +16,67 @@ CAPI uses owner references in an opinionated way. The following guidelines shoul
1616

1717
## Owner reference relationships in Cluster API
1818

19-
The below tables map out the a reference for ownership relationships for the objects in a Cluster API cluster.
19+
The below tables map out the a reference for ownership relationships for the objects in a Cluster API cluster. The tables are identical for classy and non-classy clusters.
20+
21+
2022
Providers may implement their own ownership relationships which may or may not map directly to the below tables.
2123
These owner references are almost all tested in an [end-to-end test](https://github.com/kubernetes-sigs/cluster-api/blob/caaa74482b51fae777334cd7a29595da1c06481e/test/e2e/quick_start_test.go#L31). Lack of testing is noted where this is not the case. CAPI Providers can take advantage of the e2e test framework to ensure their owner references are predictable, documented and stable.
2224

2325
Kubernetes core types
2426

25-
| type | Owner | Note |
26-
|-----------|---------------------|------------------------------------------|
27-
| Secret | KubeadmControlPlane | For cluster certificates |
28-
| Secret | KubeadmConfig | For bootstrap secrets |
29-
| Secret | ClusterResourceSet | When created by CRS. Not covered in e2e. |
30-
| ConfigMap | ClusterResourceSet | When created by CRS |
27+
| type | Owner | Controller | Note |
28+
|-----------|---------------------|------------|--------------------------------------------|
29+
| Secret | KubeadmControlPlane | yes | For cluster certificates |
30+
| Secret | KubeadmConfig | yes | For bootstrap secrets |
31+
| Secret | ClusterResourceSet | no | When referenced by CRS. Not tested in e2e. |
32+
| ConfigMap | ClusterResourceSet | no | When referenced by CRS |
3133

3234
## Core types
3335

34-
| type | Owner | Note |
35-
|---------------------|---------------------|----------------------------|
36-
| ExtensionConfig | None | |
37-
| ClusterClass | None | |
38-
| Cluster | None | |
39-
| MachineDeployments | Cluster | |
40-
| MachineSet | MachineDeployment | |
41-
| Machine | MachineSet | When created by MachineSet |
42-
| Machine | KubeadmControlPlane | When created by KCP |
43-
| MachineHealthChecks | Cluster | |
36+
| type | Owner | Controller | Note |
37+
|---------------------|---------------------|------------|----------------------------|
38+
| ExtensionConfig | None | | |
39+
| ClusterClass | None | | |
40+
| Cluster | None | | |
41+
| MachineDeployments | Cluster | no | |
42+
| MachineSet | MachineDeployment | yes | |
43+
| Machine | MachineSet | yes | When created by MachineSet |
44+
| Machine | KubeadmControlPlane | yes | When created by KCP |
45+
| MachineHealthChecks | Cluster | no | |
4446

4547

4648

4749
## Experimental types
48-
| type | Owner | Note |
49-
|----------------------------|--------------------|------|
50-
| ClusterResourcesSet | None | |
51-
| ClusterResourcesSetBinding | ClusterResourceSet | |
52-
| MachinePool | Cluster | |
50+
| type | Owner | Controller | Note |
51+
|----------------------------|--------------------|------------|--------------------------|
52+
| ClusterResourcesSet | None | | |
53+
| ClusterResourcesSetBinding | ClusterResourceSet | no | May have many CRS owners |
54+
| MachinePool | Cluster | unknown | Not tested in e2e |
5355

5456

5557
## KubeadmControlPlane types
56-
| type | Owner | Note |
57-
|-----------------------------|--------------|------|
58-
| KubeadmControlPlane | Cluster | |
59-
| KubeadmControlPlaneTemplate | ClusterClass | |
58+
| type | Owner | Controller | Note |
59+
|-----------------------------|--------------|------------|------|
60+
| KubeadmControlPlane | Cluster | yes | |
61+
| KubeadmControlPlaneTemplate | ClusterClass | no | |
6062

6163

6264
## Kubeadm bootstrap types
63-
| type | Owner | Note |
64-
|-----------------------|--------------|-------------------------------------------|
65-
| KubeadmConfig | Machine | When created for Machine |
66-
| KubeadmConfig | MachinePool | When created for MachinePool |
67-
| KubeadmConfigTemplate | Cluster | When referenced in MachineDeployment spec |
68-
| KubeadmConfigTemplate | ClusterClass | When referenced in ClusterClass |
65+
| type | Owner | Controller | Note |
66+
|-----------------------|--------------|------------|-------------------------------------------------|
67+
| KubeadmConfig | Machine | yes | When created for Machine |
68+
| KubeadmConfig | MachinePool | unknown | When created for MachinePool. Not tested in e2e |
69+
| KubeadmConfigTemplate | Cluster | no | When referenced in MachineDeployment spec |
70+
| KubeadmConfigTemplate | ClusterClass | no | When referenced in ClusterClass |
6971

7072
## Infrastructure provider types
71-
| type | Owner | Note |
72-
|-------------------------------|--------------|---------------------------------------------|
73-
| InfrastructureMachine | Machine | |
74-
| InfrastructureMachineTemplate | Cluster | When created by cluster topology controller |
75-
| InfrastructureMachineTemplate | ClusterClass | When referenced in a ClusterClass |
76-
| InfrastructureCluster | Cluster | |
77-
| InfrastructureClusterTemplate | ClusterClass | |
78-
| InfrastructureMachinePool | MachinePool | |
73+
| type | Owner | Controller | Note |
74+
|-------------------------------|--------------|------------|---------------------------------------------|
75+
| InfrastructureMachine | Machine | yes | |
76+
| InfrastructureMachineTemplate | Cluster | no | When created by cluster topology controller |
77+
| InfrastructureMachineTemplate | ClusterClass | no | When referenced in a ClusterClass |
78+
| InfrastructureCluster | Cluster | yes | |
79+
| InfrastructureClusterTemplate | ClusterClass | no | |
80+
| InfrastructureMachinePool | MachinePool | unknown | Not tested in e2e |
7981

8082

0 commit comments

Comments
 (0)