|
| 1 | +# AutoScale From Zero |
| 2 | + |
| 3 | +> **Note:** AutoScaleFromZero is available in >= 0.14. |
| 4 | +
|
| 5 | +> **Note**: AutoScaleFromZero can be used only in clusters using the [ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/) feature. |
| 6 | +
|
| 7 | +The `AutoScaleFromZero` feature flag enables the usage of [cluster-autoscaler](https://github.com/kubernetes/autoscaler/tree/bc3f44c85df17bccc940adb7c885b192cf6135d7/cluster-autoscaler/cloudprovider/clusterapi#cluster-autoscaler-on-cluster-api) to scale from/to zero without the need of annotations. More information on how to use the cluster-autoscaler can be found [here](https://github.com/kubernetes/autoscaler/tree/bc3f44c85df17bccc940adb7c885b192cf6135d7/cluster-autoscaler/cloudprovider/clusterapi#scale-from-zero-support). |
| 8 | + |
| 9 | +## Enabling AutoScaleFromZero |
| 10 | + |
| 11 | +You can enable `AutoScaleFromZero` using the following. |
| 12 | + |
| 13 | +- Environment variable: `EXP_CAPO_AUTOSCALE_FROM_ZERO=true` |
| 14 | +- clusterctl.yaml variable: `EXP_CAPO_AUTOSCALE_FROM_ZERO: true` |
| 15 | +- --feature-gates argument: `AutoScaleFromZero=true` |
| 16 | + |
| 17 | +## Automatically Populated Status Fields |
| 18 | + |
| 19 | +> **Note**: Unsupported fields may be provided via annotations or incorporated into the controller by extending its functionality. |
| 20 | +
|
| 21 | +The controller automatically fills two sections of `OpenStackMachineTemplate.Status`: |
| 22 | +- **capacity** (resource quantities) |
| 23 | +- **nodeInfo** (OS metadata) |
| 24 | + |
| 25 | +The following mappings describe exactly where each value originates. |
| 26 | + |
| 27 | +### Capacity (`Status.Capacity`) |
| 28 | +- **CPU**: From the `VCPUs` property of the resolved OpenStack flavor |
| 29 | + |
| 30 | +- **Memory**: From the `RAM` property of the resolved OpenStack flavor |
| 31 | + |
| 32 | +- **Ephemeral Storage**: From the `Ephemeral` property of the resolved OpenStack flavor |
| 33 | + |
| 34 | +- **Root Storage**: Determined based on the boot method: |
| 35 | + - If **booting from volume** taken from `OpenStackMachineTemplate.Spec.Template.Spec.RootVolume.SizeGiB` |
| 36 | + - If **booting from image** taken from the `Disk` property of the resolved OpenStack flavor |
| 37 | + |
| 38 | +### Node Information (`Status.NodeInfo`) |
| 39 | +- **Operating System**: From the `os_type` property of the resolved OpenStack image. |
0 commit comments