Skip to content

Commit 649c34d

Browse files
authored
Merge pull request #11194 from fabriziopandini/group-API-reference-docs
📖 Group API reference docs
2 parents 8a634a7 + 9fb2545 commit 649c34d

10 files changed

+98
-102
lines changed

docs/book/src/SUMMARY.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
- [MachinePool](./developer/architecture/controllers/machine-pool.md)
8585
- [ClusterTopology](./developer/architecture/controllers/cluster-topology.md)
8686
- [ClusterResourceSet](./developer/architecture/controllers/cluster-resource-set.md)
87-
- [Metadata propagation](./developer/architecture/controllers/metadata-propagation.md)
8887
- [Multi-tenancy](./developer/architecture/controllers/multi-tenancy.md)
8988
- [Support multiple instances](./developer/architecture/controllers/support-multiple-instances.md)
9089
- [Tuning controllers](./developer/architecture/controllers/tuning.md)
@@ -106,10 +105,13 @@
106105
- [Webhooks](./developer/providers/webhooks.md)
107106
- [Controllers and Reconciliation](./developer/providers/implementers-guide/controllers_and_reconciliation.md)
108107
- [Building, Running, Testing](./developer/providers/implementers-guide/building_running_and_testing.md)
109-
- [CustomResourceDefinitions relationships](./developer/crd-relationships.md)
110108
- [Troubleshooting](./user/troubleshooting.md)
111109
- [Reference](./reference/reference.md)
112-
- [API Reference](./reference/api_reference.md)
110+
- [API Reference](./reference/api/reference.md)
111+
- [Labels and Annotations](reference/api/labels-and-annotations.md)
112+
- [CRD relationships](reference/api/crd-relationships.md)
113+
- [Metadata propagation](reference/api/metadata-propagation.md)
114+
- [Owner References](reference/api/owner-references.md)
113115
- [Glossary](./reference/glossary.md)
114116
- [Provider List](./reference/providers.md)
115117
- [Ports](./reference/ports.md)
@@ -118,5 +120,3 @@
118120
- [Jobs](./reference/jobs.md)
119121
- [Code Review in Cluster API](./REVIEWING.md)
120122
- [Version Support](./reference/versions.md)
121-
- [Supported Labels and Annotations](./reference/labels_and_annotations.md)
122-
- [Owner References](./reference/owner_references.md)

docs/book/src/developer/crd-relationships.md renamed to docs/book/src/reference/api/crd-relationships.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The direction of the arrows indicates the direction of "management" or "referenc
1414

1515
## Control plane machines relationships
1616

17-
![]( ../images/kubeadm-control-plane-machines-resources.png)
17+
![]( ../../images/kubeadm-control-plane-machines-resources.png)
1818

1919
## Worker machines relationships
2020

21-
![]( ../images/worker-machines-resources.png)
21+
![]( ../../images/worker-machines-resources.png)

docs/book/src/reference/api/labels-and-annotations.md

+59
Large diffs are not rendered by default.

docs/book/src/developer/architecture/controllers/metadata-propagation.md renamed to docs/book/src/reference/api/metadata-propagation.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Cluster API controllers implement consistent metadata (labels & annotations) pro
33
This behaviour tries to be consistent with Kubernetes apps/v1 Deployment and ReplicaSet.
44
New providers should behave accordingly fitting within the following pattern:
55

6-
![](../../../images/metadata-propagation.jpg)
6+
![](../../images/metadata-propagation.jpg)
77

88
## Cluster Topology
99
ControlPlaneTopology labels are labels and annotations are continuously propagated to ControlPlane top-level labels and annotations
@@ -67,5 +67,3 @@ Label should meet one of the following criterias to propagate to Node:
6767
- Has `node-role.kubernetes.io` as prefix.
6868
- Belongs to `node-restriction.kubernetes.io` domain.
6969
- Belongs to `node.cluster.x-k8s.io` domain.
70-
71-

docs/book/src/reference/owner_references.md renamed to docs/book/src/reference/api/owner-references.md

+12-17
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
# Owner References
22

3-
4-
Cluster API uses [Kubernetes owner references](https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/) to track relationships between objects. These references are used for Kubernetes garbage collection, which is the basis of Cluster deletion in CAPI. They are also used places where the ownership hierarchy is important, for example when using `clusterctl move`.
3+
Cluster API uses [Kubernetes owner references](https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/) to track relationships between objects. These references are used
4+
for Kubernetes garbage collection, which is also used for Cluster deletion in CAPI. They are also used places where
5+
the ownership hierarchy is important, for example when using `clusterctl move`.
56

67
CAPI uses owner references in an opinionated way. The following guidelines should be considered:
7-
1. Objects should always be created with an owner reference to prevent leaking objects. Initial ownerReferences can be replaced later where another object is a more appropriate owner.
8-
2. Owner references should be re-reconciled if they are lost for an object. This is required as some tools - e.g. velero - may delete owner references on objects.
8+
1. Objects should always be created with an owner reference to prevent leaking objects. Initial ownerReferences can be
9+
replaced later where another object is a more appropriate owner.
10+
2. Owner references should be re-reconciled if they are lost for an object. This is required as some tools - e.g. velero -
11+
may delete owner references on objects.
912
3. Owner references should be kept to the most recent apiVersion.
1013
- This ensures garbage collection still works after an old apiVersion is no longer served.
1114
4. Owner references should not be added unless required.
1215
- Multiple owner references on a single object should be exceptional.
1316

14-
15-
16-
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. The tables are identical for classy and non-classy clusters.
20-
19+
The below tables map out the a reference for ownership relationships for the objects in a Cluster API cluster. The tables
20+
are identical for classy and non-classy clusters.
2121

2222
Providers may implement their own ownership relationships which may or may not map directly to the below tables.
23-
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.
23+
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.
24+
CAPI Providers can take advantage of the e2e test framework to ensure their owner references are predictable, documented and stable.
2425

25-
Kubernetes core types
26+
## Kubernetes core types
2627

2728
| type | Owner | Controller | Note |
2829
|-----------|---------------------|------------|--------------------------------------------|
@@ -44,22 +45,18 @@ These owner references are almost all tested in an [end-to-end test](https://git
4445
| Machine | KubeadmControlPlane | yes | When created by KCP |
4546
| MachineHealthChecks | Cluster | no | |
4647

47-
48-
4948
## Experimental types
5049
| type | Owner | Controller | Note |
5150
|----------------------------|--------------------|------------|--------------------------|
5251
| ClusterResourcesSet | None | | |
5352
| ClusterResourcesSetBinding | ClusterResourceSet | no | May have many CRS owners |
5453
| MachinePool | Cluster | no | |
5554

56-
5755
## KubeadmControlPlane types
5856
| type | Owner | Controller | Note |
5957
|-----------------------------|--------------|------------|------|
6058
| KubeadmControlPlane | Cluster | yes | |
6159
| KubeadmControlPlaneTemplate | ClusterClass | no | |
62-
6360

6461
## Kubeadm bootstrap types
6562
| type | Owner | Controller | Note |
@@ -78,5 +75,3 @@ These owner references are almost all tested in an [end-to-end test](https://git
7875
| InfrastructureCluster | Cluster | yes | |
7976
| InfrastructureClusterTemplate | ClusterClass | no | |
8077
| InfrastructureMachinePool | MachinePool | yes | |
81-
82-
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# API Reference
2+
3+
Cluster API currently exposes the following APIs:
4+
5+
* the Cluster API Custom Resource Definitions (CRDs): [documentation](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api)
6+
7+
* Golang APIs: [godoc](https://pkg.go.dev/sigs.k8s.io/cluster-api)
8+
9+
Following pages provide additional documentation to better understand and use Cluster API types.
10+
11+
* [Labels and Annotations](labels-and-annotations.md)
12+
13+
* [CRD relationships](crd-relationships.md)
14+
15+
* [Metadata propagation](metadata-propagation.md)
16+
17+
* [Owner References](owner-references.md)

docs/book/src/reference/api_reference.md

-9
This file was deleted.

0 commit comments

Comments
 (0)