Skip to content

Commit

Permalink
Refactor the BootstrapConfig contract
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Sep 27, 2024
1 parent 187f385 commit 5935f90
Show file tree
Hide file tree
Showing 7 changed files with 441 additions and 128 deletions.
3 changes: 1 addition & 2 deletions docs/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@
- [MachineSet](./developer/core/controllers/machine-set.md)
- [Machine](./developer/core/controllers/machine.md)
- [MachinePool](./developer/core/controllers/machine-pool.md)
- [MachineHealthCheck](./developer/core/controllers/machine-health-check.md)
- [Bootstrap](./developer/core/controllers/bootstrap.md)
- [MachineHealthCheck](./developer/core/controllers/machine-health-check.md)
- [Control Plane](./developer/core/controllers/control-plane.md)
- [Logging](developer/core/logging.md)
- [Testing](developer/core/testing.md)
Expand Down
16 changes: 0 additions & 16 deletions docs/book/src/developer/core/controllers/bootstrap.md

This file was deleted.

13 changes: 13 additions & 0 deletions docs/book/src/developer/core/controllers/machine.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ a BootstrapConfig object, e.g. KubeadmBoostrapConfig etc.
The [BootstrapConfig resource contract](../../providers/contracts/bootstrap-config.md) defines a set of rules a provider is expected to comply with in order to allow
the expected interactions with the Machine controller.

Among those rules:
- BootstrapConfig MUST create a [bootstrap data secret](../../providers/contracts/bootstrap-config.md#bootstrapconfig-data-secret) where machines should be placed in
- BootstrapConfig MUST report when Machine's bootstrap data secret is [fully provisioned](../../providers/contracts/bootstrap-config.md#bootstrapconfig-initialization-completed)
- BootstrapConfig SHOULD report [conditions](../../providers/contracts/bootstrap-config.md#bootstrapconfig-conditions)
- BootstrapConfig SHOULD report [terminal failures](../../providers/contracts/bootstrap-config.md#bootstrapconfig-terminal-failures)
- BootstrapConfig SHOULD report [taint Nodes at creation](../../providers/contracts/bootstrap-config.md#taint-nodes-at-creation)
- BootstrapConfig SHOULD create a [sentinel file](../../providers/contracts/bootstrap-config.md#sentinel-file) on machines

Considering all the info above, the Machine controller's main responsibilities are:

* Setting an OwnerReference on the infrastructure object referenced in `Machine.spec.infrastructureRef`.
Expand All @@ -44,3 +52,8 @@ The machine controller uses the kubeconfig for the new workload cluster to watch
When a node appears with `Node.Spec.ProviderID` matching `Machine.Spec.ProviderID`, the machine controller
transitions the associated machine into the `Provisioned` state. When the infrastructure ref is also
`Ready`, the machine controller marks the machine as `Running`.

The following schema goes trough machine phases and interactions with InfraMachine and BootstrapConfig
happening at each step.

![](../../../images/machine-phases.png)
Loading

0 comments on commit 5935f90

Please sign in to comment.