Skip to content

Commit 3e1ec90

Browse files
committed
docs: updates after second review
Some updates after an additional review by Andreas. Signed-off-by: Richard Case <[email protected]>
1 parent 9e1b9fb commit 3e1ec90

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/book/src/developer/providers/contracts/infra-machinepool.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Infrastructure providers CAN OPTIONALLY implement an InfraMachinePool resource using Kubernetes' CustomResourceDefinition (CRD).
44

5-
The goal of an InfraMachinePool is to manage the lifecycle of a provider-specific pool of machines using a provider specific service (like auto-scale groups in AWS & virtual machine scalesets in Azure).
5+
The goal of an InfraMachinePool is to manage the lifecycle of a provider-specific pool of machines using a provider specific service (like Auto Scaling groups in AWS & Virtual Machine Scale Sets in Azure).
66

77
The machines in the pool may be physical or virtual instances (although most likely virtual), and they represent the infrastructure for Kubernetes nodes.
88

@@ -32,8 +32,7 @@ Instead, whenever you need something more from the Cluster API contract, you MUS
3232
The Cluster API maintainers welcome feedback and contributions to the contract in order to improve how it's defined,
3333
its clarity and visibility to provider implementers and its suitability across the different kinds of Cluster API providers.
3434

35-
To provide feedback or open a discussion about the provider contract please [open an issue on the Cluster API](https://github.com/kubernetes-sigs/cluster-api/issues/new?assignees=&labels=&template=feature_request.md)
36-
repo or add an item to the agenda in the [Cluster API community meeting](https://git.k8s.io/community/sig-cluster-lifecycle/README.md#cluster-api).
35+
To provide feedback or open a discussion about the provider contract please [open an issue on the Cluster API](https://github.com/kubernetes-sigs/cluster-api/issues/new?template=feature_request.yaml) repo or add an item to the agenda in the [Cluster API community meeting](https://git.k8s.io/community/sig-cluster-lifecycle/README.md#cluster-api).
3736

3837
</aside>
3938

@@ -75,7 +74,7 @@ All resources MUST have the standard Kubernetes `TypeMeta` and `ObjectMeta` fiel
7574
### All resources: `APIVersion` field value
7675

7776
In Kubernetes `APIVersion` is a combination of API group and version.
78-
Special consideration MUST applies to both API group and version for all the resources Cluster API interacts with.
77+
Special consideration MUST apply to both API group and version for all the resources Cluster API interacts with.
7978

8079
#### All resources: API group
8180

@@ -147,7 +146,7 @@ An example of this is in the [AWS infrastructure provider](https://github.com/ku
147146
### InfraMachinePool, InfraMachinePoolList resource definition
148147

149148
You MUST define a InfraMachinePool resource if you provider supports MachinePools.
150-
The InfraMachinePool resource name must have the format produced by `sigs.k8s.io/cluster-api/util/contract.CalculateCRDName(Group, Kind)`.
149+
The InfraMachinePool CRD name must have the format produced by [`sigs.k8s.io/cluster-api/util/contract.CalculateCRDName(Group, Kind)`](https://github.com/search?q=repo%3Akubernetes-sigs%2Fcluster-api+%22func+CalculateCRDName%22&type=code).
151150

152151
Note: Cluster API is using such a naming convention to avoid an expensive CRD lookup operation when looking for labels from
153152
the CRD definition of the InfraMachinePool resource.
@@ -237,11 +236,11 @@ type FooMachinePoolInstanceStatus struct {
237236

238237
### MachinePoolMachines support
239238

240-
A provider can opt-in to MachinePool Machines (MPM). With MPM machines all the replicas in a MachinePool are represented by a Machine & InfraMachine. This enables core CAPI to perform common operations on single machines (and their Nodes), such as draining a node before scale down, integration with Cluster Autoscaler and also machine healthchecks.
239+
A provider can opt-in to MachinePool Machines (MPM). With MPM machines all the replicas in a MachinePool are represented by a Machine & InfraMachine. This enables core CAPI to perform common operations on single machines (and their Nodes), such as draining a node before scale down, integration with Cluster Autoscaler and also [MachineHealthChecks].
241240

242-
If you want to adopt MPM then you MUST have a `status.infrastructureMachineKind` field and the field must contain the resource kind of the InfraMachine that represent the replicas in the pool. For example, for the AWS provider the value would be set to `AWSMachine`.
241+
If you want to adopt MPM then you MUST have an `status.infrastructureMachineKind` field and the field must contain the resource kind that represents the replicas in the pool. This is usually named InfraMachine if machine pool machines are representable like regular machines, or InfraMachinePoolMachine in other cases. For example, for the AWS provider the value would be set to `AWSMachine`.
243242

244-
By opting in an infra provider is expected to create a InfraMachine for every replica in the pool. The lifecycle of these InfraMachines must be managed so that when scale up or scale down happens the list of InfraMachines is representative.
243+
By opting in, the infra provider is expected to create a InfraMachine for every replica in the pool. The lifecycle of these InfraMachines must be managed so that when scale up or scale down happens, the list of InfraMachines is kept up to date.
245244

246245
```go
247246
type FooMachinePoolStatus struct {
@@ -299,13 +298,13 @@ type FooMachinePoolSpec struct {
299298
}
300299
```
301300

302-
Cluster API uses this list to determine the status of the machine pool and to know when replicas have been deleted, at which point the Node will be deleted.
301+
Cluster API uses this list to determine the status of the machine pool and to know when replicas have been deleted, at which point the Node will be deleted. Therefore, the list MUST be kept up to date.
303302

304303
### InfraMachinePool: initialization completed
305304

306305
Each provider MUST indicate when then the InfraMachinePool has been completely provisioned.
307306

308-
Currently this is done by setting `staus.ready` to **true**. The value retuned here is stored in the MachinePool's `status.infraStructureReady` field.
307+
Currently this is done by setting `status.ready` to **true**. The value returned here is stored in the MachinePool's `status.infraStructureReady` field.
309308

310309
Additionally providers should set `initialization.provisioned` to **true**. This value isn't currently used by core CAPI for MachinePools. However, MachinePools will start to use this instead and `status.ready` will be deprecated. By setting both these fields it will make the future migration easier.
311310

@@ -339,7 +338,7 @@ Once `status.ready` is set the MachinePool “core” controller will bubble up
339338

340339
### InfraMachinePool: pausing
341340

342-
Providers SHOULD implement the pause behaviour for every object with a reconciliation loop. This is done by checking if `spec.paused` is set on the Cluster object and by checking for the `cluster.x-k8s.io/paused` annotation on the InfraMachinePool object.
341+
Providers SHOULD implement the pause behaviour for every object with a reconciliation loop. This is done by checking if `spec.paused` is set on the Cluster object and by checking for the `cluster.x-k8s.io/paused` annotation on the InfraMachinePool object. Preferably, the utility `sigs.k8s.io/cluster-api/util/annotations.IsPaused(cluster, infraMachinePool)` SHOULD be used.
343342

344343
If implementing the pause behaviour, providers SHOULD surface the paused status of an object using the Paused condition: `Status.Conditions[Paused]`.
345344

@@ -384,7 +383,7 @@ the implication of this choice which are described both in the [Cluster API v1.1
384383

385384
### InfraMachinePool: replicas
386385

387-
Provider implementers MUST implement `status.replicas` to report the most recently observed number of machine instances in the pool. For example, in AWS this would be the number of replicas in a Auto Scale Group (ASG).
386+
Provider implementers MUST implement `status.replicas` to report the most recently observed number of machine instances in the pool. For example, in AWS this would be the number of replicas in a Auto Scaling group (ASG).
388387

389388
```go
390389
type FooMachinePoolStatus struct {
@@ -492,7 +491,7 @@ However, in case you have immutability checks for your InfraMachinePoolTemplate,
492491

493492
In order to avoid this InfraMachinePoolTemplate MUST specifically implement support for SSA dry run calls from the topology controller.
494493

495-
The implementation requires to use controller runtime's `CustomValidator`, available in CR versions >= v0.12.3.
494+
The implementation requires to use controller runtime's `CustomValidator`, available since version v0.12.3.
496495

497496
This will allow to skip the immutability check only when the topology controller is dry running while preserving the
498497
validation behavior for all other cases.
@@ -541,4 +540,5 @@ The clusterctl command is designed to work with all the providers compliant with
541540
[Improving status in CAPI resources]: https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md
542541
[infrastructure Provider Security Guidance]: ../security-guidelines.md
543542
[Support running multiple instances of the same provider]: ../../core/support-multiple-instances.md
544-
[clusterctl provider contract]: clusterctl.md
543+
[clusterctl provider contract]: clusterctl.md
544+
[MachineHealthChecks]: ../../../tasks/automated-machine-management/healthchecking.md

0 commit comments

Comments
 (0)