Commit 6a842b0
committed
Add AWS SpotMarketOptions support to ROSA HCP MachinePools (ROSAENG-65782)
Adds AWS Spot instance support to ROSA HCP MachinePools via the CAPA layer,
mapping a new optional, immutable spec.spotMarketOptions field to the OCM
AwsNodePool.spot_market_options API:
- spotMarketOptions: {} -> Spot with no maximum price
- spotMarketOptions: { maxPrice: "0.05" } -> cap the hourly bid
Behavior and guardrails:
- Day-1 only / immutable: cannot be added, removed, or changed after the
MachinePool is created. Enforced by the validating webhook and ignored in
the reconcile diff so it never triggers a spurious Day-2 update.
- Requires OpenShift >= 4.22, gated in the controller against the control-plane
version (the webhook cannot see the control-plane version). The gate runs even
when spec.version is omitted (the common inherit-from-control-plane case).
- Incompatible with capacityReservationID; setting both is rejected.
Robust version gating:
- Uses semver.ParseTolerant so "4.22" and "v4.22.0" are accepted; unparsable or
empty versions surface a user-visible Status.FailureMessage instead of an error
that requeues forever.
- Compares on the {Major, Minor, Patch} triple, so pre-release control-plane
versions such as "4.22.0-rc.1" are not wrongly rejected.
- Prefers the running control-plane version (Status.Version) over the requested
version (Spec.Version), falling back to Spec.Version when Status is unset.
- Validation failures set Status.FailureMessage and mark the Ready condition
False so they are observable via kubectl.
Also corrects the shared SpotMarketOptions MaxPrice kubebuilder marker from
lowercase 'pattern' (silently ignored) to 'Pattern', so the numeric validation
pattern is now emitted into all CRDs that embed the shared type. Bumps
ocm-sdk-go to v0.1.510 / ocm-api-model to v0.0.465 for the new spot builder.
Includes webhook, controller, and helper unit tests (immutability, capacity
reservation conflict, OCM round-trip, and the full version-gate matrix) and a
ROSA MachinePools docs section.1 parent 67de5c2 commit 6a842b0
20 files changed
Lines changed: 879 additions & 11 deletions
File tree
- api/v1beta2
- config/crd/bases
- docs/book/src/topics/rosa
- exp
- api/v1beta2
- controllers
- utils
- webhooks
- pkg/rosa
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
| 566 | + | |
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1591 | 1591 | | |
1592 | 1592 | | |
1593 | 1593 | | |
| 1594 | + | |
1594 | 1595 | | |
1595 | 1596 | | |
1596 | 1597 | | |
| |||
4107 | 4108 | | |
4108 | 4109 | | |
4109 | 4110 | | |
| 4111 | + | |
4110 | 4112 | | |
4111 | 4113 | | |
4112 | 4114 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2627 | 2627 | | |
2628 | 2628 | | |
2629 | 2629 | | |
| 2630 | + | |
2630 | 2631 | | |
2631 | 2632 | | |
2632 | 2633 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
898 | 899 | | |
899 | 900 | | |
900 | 901 | | |
| 902 | + | |
901 | 903 | | |
902 | 904 | | |
903 | 905 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1174 | 1174 | | |
1175 | 1175 | | |
1176 | 1176 | | |
| 1177 | + | |
1177 | 1178 | | |
1178 | 1179 | | |
1179 | 1180 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1098 | 1098 | | |
1099 | 1099 | | |
1100 | 1100 | | |
| 1101 | + | |
1101 | 1102 | | |
1102 | 1103 | | |
1103 | 1104 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
907 | 908 | | |
908 | 909 | | |
909 | 910 | | |
| 911 | + | |
910 | 912 | | |
911 | 913 | | |
912 | 914 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
137 | 151 | | |
138 | 152 | | |
139 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
| |||
0 commit comments