Commit ca3d347
CNTRLPLANE-2262: Add Azure scale-from-zero support (#8337)
* feat: CNTRLPLANE-2262: Add Azure scale-from-zero support
Extend the existing scale-from-zero autoscaling framework to support
Azure by implementing an Azure instance type provider that queries the
Azure Resource SKUs API for VM size specifications and writing capacity
annotations on MachineDeployments.
Changes:
- Add Azure instancetype.Provider using armcompute.ResourceSKUsClient
- Add AzureMachineTemplate case to scale_from_zero.go type switch
- Extend supportedScaleFromZeroPlatform() for Azure
- Extend reconcileScaleFromZeroAnnotations() for Azure
- Update autoscalerEnabledCondition() to accept Azure with min=0
- Update effectiveMin guard in capi.go to allow min=0 for Azure
- Add "azure" to supportedProviders in main.go and install.go
- Add Azure provider initialization with credential file parsing
- Update CRD CEL validation to allow min=0 for Azure platform
- Add unit tests for Azure provider and extended type switches
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address review feedback for Azure scale-from-zero
- Update NodePoolAutoScaling.Min field comment and CRD validation rule
to reflect Azure support alongside AWS
- Regenerate CRD manifests with updated docs and validation
- Fix partial SKU cache on Azure pager failure: build into local map
and assign to cache only after full walk succeeds
- Tighten platform gate: add ScaleFromZeroPlatform field so annotations
are only set when nodepool platform matches the configured provider
- Validate all required Azure credential fields (subscriptionId,
clientId, clientSecret, tenantId, location) upfront with a clear
error listing missing fields
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: update envtest suite for Azure scale-from-zero
Update CRD test suite to match the updated validation rule that
allows autoScaling.min=0 on Azure platform:
- Change Azure min=0 test from expecting failure to expecting success
- Update Agent and KubeVirt error messages to include Azure
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address lint and verify CI failures
- Lowercase error string for Azure scale-from-zero credentials
- Fix gci import ordering in main.go, provider_test.go,
scale_from_zero_test.go, and nodepool_test.go
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address CodeRabbit review for Azure scale-from-zero
- Gate effectiveMin=0 on runtime-configured scaleFromZeroPlatform instead
of static platform type check, preventing stalled pools when the
scale-from-zero provider isn't wired up
- Resolve AZURE_CLOUD_NAME for credential and SKU client construction in
scale-from-zero init, matching sovereign cloud support used elsewhere
- Return errors on invalid/negative GPU values in transformSKU instead of
silently skipping, with VM size in error messages for debuggability
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: update CLI help text and regenerate vendor files
Update the --scale-from-zero-provider help text to list both aws and azure
as supported platforms. Regenerate vendor and docs to sync with the rebased
branch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test(e2e): enable scale-from-zero e2e test for Azure platform
The TestNodePoolAutoscalingScaleFromZero test was hardcoded to skip on
non-AWS platforms. The test logic is already platform-agnostic (it copies
the existing NodePool spec), so the only change needed is widening the
platform gate to include Azure.
A follow-up PR in openshift/release will configure the Azure CI jobs to
install the operator with --scale-from-zero-provider=azure and the
appropriate credentials.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: make scale-from-zero effectiveMin data-driven
Replace hardcoded platform checks with a data-driven approach:
- Add hasStatusCapacity() to check native provider support
- Change setMachine{Deployment,Set}Replicas to accept bool
- Add statusCapacity extraction for Azure machine templates
- effectiveMin=0 allowed when Status.Capacity is populated OR
when the runtime scale-from-zero provider matches the platform
Addresses review comments from enxebre on PR #8337.
* fix: add cache TTL, VMSizeNotFoundError, and remove unrelated gitignore entries
Address csrwng review feedback:
- Add 1-hour TTL to Azure SKU cache so new VM sizes are picked up
- Introduce VMSizeNotFoundError to distinguish permanent errors (VM size
doesn't exist in region) from transient errors (API failure)
- Stop retrying indefinitely for non-existent VM sizes
- Document why Azure uses caching unlike the AWS provider
- Remove unrelated .claude/skills/dev/azure-sandbox-* from .gitignore
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d6ec188 commit ca3d347
26 files changed
Lines changed: 992 additions & 103 deletions
File tree
- api/hypershift/v1beta1
- zz_generated.featuregated-crd-manifests/nodepools.hypershift.openshift.io
- cmd/install
- assets/crds/hypershift-operator
- tests/nodepools.hypershift.openshift.io
- zz_generated.crd-manifests
- docs/content/reference
- hypershift-operator
- controllers/nodepool
- instancetype/azure
- test/e2e
- vendor/github.com/openshift/hypershift/api/hypershift/v1beta1
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
| 549 | + | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
1518 | 1518 | | |
1519 | 1519 | | |
1520 | 1520 | | |
1521 | | - | |
| 1521 | + | |
1522 | 1522 | | |
1523 | | - | |
| 1523 | + | |
1524 | 1524 | | |
1525 | 1525 | | |
1526 | 1526 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
1787 | 1787 | | |
1788 | 1788 | | |
1789 | 1789 | | |
1790 | | - | |
| 1790 | + | |
1791 | 1791 | | |
1792 | | - | |
| 1792 | + | |
1793 | 1793 | | |
1794 | 1794 | | |
1795 | 1795 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
1546 | 1546 | | |
1547 | 1547 | | |
1548 | 1548 | | |
1549 | | - | |
| 1549 | + | |
1550 | 1550 | | |
1551 | | - | |
| 1551 | + | |
1552 | 1552 | | |
1553 | 1553 | | |
1554 | 1554 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
1705 | 1705 | | |
1706 | 1706 | | |
1707 | 1707 | | |
1708 | | - | |
| 1708 | + | |
1709 | 1709 | | |
1710 | | - | |
| 1710 | + | |
1711 | 1711 | | |
1712 | 1712 | | |
1713 | 1713 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
| 79 | + | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
| |||
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | | - | |
| 103 | + | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments