|
| 1 | +//Module included in the following assemblies: |
| 2 | +// hosted_control_planes/hcp-deploy/hcp-deploy-azure.adoc |
| 3 | + |
| 4 | +:_mod-docs-content-type: REFERENCE |
| 5 | +[id="hcp-azure-autoscaling_{context}"] |
| 6 | += Example: Autoscaling a hosted cluster on {azure-short} |
| 7 | + |
| 8 | +[role="_abstract"] |
| 9 | +To balance node pools on your {azure-short} hosted cluster, you can configure autoscaling for the cluster. |
| 10 | + |
| 11 | +When you scale up `NodePool` objects, the Cluster API Provider for {azure-short} provisions individual {azure-short} virtual machines. |
| 12 | + |
| 13 | +To configure autoscaling for a hosted cluster on {azure-short}, you edit the `spec.autoscaling` parameters in the `HostedCluster` resource. The following example shows a `HostedCluster` resource with 2 {azure-short} node pools. |
| 14 | + |
| 15 | +[NOTE] |
| 16 | +==== |
| 17 | +This example shows only the autoscaling-related fields. |
| 18 | +==== |
| 19 | + |
| 20 | +[source,yaml] |
| 21 | +---- |
| 22 | +apiVersion: hypershift.openshift.io/v1beta1 |
| 23 | +kind: HostedCluster |
| 24 | +metadata: |
| 25 | + name: my-cluster |
| 26 | + namespace: my-cluster-namespace |
| 27 | +spec: |
| 28 | + autoscaling: |
| 29 | + scaling: ScaleUpAndScaleDown |
| 30 | + maxNodesTotal: 12 |
| 31 | + expanders: |
| 32 | + - Random |
| 33 | + scaleDown: |
| 34 | + delayAfterAddSeconds: 300 |
| 35 | + unneededDurationSeconds: 600 |
| 36 | + utilizationThresholdPercent: 40 |
| 37 | + balancingIgnoredLabels: |
| 38 | + - "custom.label/environment" |
| 39 | + maxFreeDifferenceRatioPercent: 70 |
| 40 | +--- |
| 41 | +apiVersion: hypershift.openshift.io/v1beta1 |
| 42 | +kind: NodePool |
| 43 | +metadata: |
| 44 | + name: my-cluster-nodepool-1 |
| 45 | + namespace: my-cluster-namespace |
| 46 | +spec: |
| 47 | + clusterName: my-cluster |
| 48 | + autoScaling: |
| 49 | + min: 1 |
| 50 | + max: 6 |
| 51 | + platform: |
| 52 | + azure: |
| 53 | + vmSize: Standard_D4s_v3 |
| 54 | + # ... |
| 55 | +--- |
| 56 | +apiVersion: hypershift.openshift.io/v1beta1 |
| 57 | +kind: NodePool |
| 58 | +metadata: |
| 59 | + name: my-cluster-nodepool-2 |
| 60 | + namespace: my-cluster-namespace |
| 61 | +spec: |
| 62 | + clusterName: my-cluster |
| 63 | + autoScaling: |
| 64 | + min: 1 |
| 65 | + max: 6 |
| 66 | + platform: |
| 67 | + azure: |
| 68 | + vmSize: Standard_D4s_v3 |
| 69 | + # ... |
| 70 | +---- |
| 71 | + |
| 72 | +* `spec.autoScaling.min` must be greater than or equal to `1`. Scaling from zero (`autoScaling.min: 0`) is not supported on {azure-short}. |
0 commit comments