← Back to Pull requests

ROSAENG-8272 | feat: add HCP spot CLI support #3457

Closed
unknown closed this pull request without merging on Aug 14, 2026 20:42 UTC
View on GitHub
unknown unknown commented on Aug 10, 2026 20:05 UTC
Author

PR Summary


Add ROSA HCP Spot CLI support for both Simple and Enhanced modes. Spot node pools are created with --use-spot-instances and optionally --spot-max-price at machine pool creation time. Spot configuration is immutable after creation — users must delete and recreate the machine pool to change spot settings. A new rosa create spot-termination-queue helper provisions the AWS resources for graceful interruption handling. Cluster describe only shows the queue URL when configured, avoiding ambiguous mode display.

Detailed Description of the Issue


ROSA HCP Spot support needs CLI changes across three user flows:
1. Creating HCP node pools with spot market options — --use-spot-instances and --spot-max-price flags on rosa create machinepool
2. Configuring the cluster-level termination-handler queue URL — --spot-termination-queue-url on rosa create cluster and rosa edit cluster
3. Helping users create the AWS queue/rule/policy resources — rosa create spot-termination-queue helper command

Prior to this change, the CLI exposed classic spot behavior but not the HCP node-pool API shape, could not set aws.termination_handler_queue_url, did not surface backend Simple-mode warnings, and had no supported helper for the AWS resource setup.

Key behaviors:


  • Simple mode (no queue URL): Spot node pools work immediately. CLI prints a warning when creating a Spot pool without a configured queue.

  • Enhanced mode (with queue URL): Cluster has graceful interruption handling via AWS Node Termination Handler.

  • Spot is immutable: Spot max price and enablement cannot be changed after node pool creation. Users must delete and recreate the machine pool.

  • Cluster describe: Only shows Spot Termination Queue URL: <url> when configured. No output when no queue is set (avoids ambiguity between on-demand and Simple mode).

  • Queue URL validation: Lightweight HTTPS URL sanity check client-side; backend owns format/region validation.

  • Queue helper role validation: Validates the NodePoolManagement role exists before creating the CloudFormation stack.
  • Related Issues and PRs


  • Jira: ROSAENG-8272

  • Fixes: N/A

  • Related PR(s):

  • - openshift-online/ocm-api-model#1178 (SDK changes)
    - uhc-clusters-service!11497 (Simple mode)
    - uhc-clusters-service!11523 (Enhanced mode)
    - openshift/rosa#3463 (SDK bump, merged)
  • Related design/docs:

  • - Backend DDR

    Type of Change


  • feat - adds a new user-facing capability.

  • fix - resolves an incorrect behavior or bug.

  • docs - updates documentation only.

  • style - formatting or naming changes with no logic impact.

  • refactor - code restructuring with no behavior change.

  • test - adds or updates tests only.

  • chore - maintenance work (tooling, housekeeping, non-product code).

  • build - changes build system, packaging, or dependencies for build output.

  • ci - changes CI pipelines, jobs, or automation workflows.

  • perf - improves performance without changing intended behavior.
  • Previous Behavior


  • No HCP Spot node pool support in ROSA CLI.

  • No --spot-termination-queue-url flag on cluster create/edit.

  • No queue helper command.

  • No HCP-specific Spot output in describe/list.
  • Behavior After This Change


  • rosa create machinepool --use-spot-instances [--spot-max-price <price>] creates HCP Spot node pools.

  • rosa create cluster --spot-termination-queue-url <url> and rosa edit cluster --spot-termination-queue-url <url> configure the cluster queue.

  • rosa create spot-termination-queue --name <prefix> --nodepool-management-role-arn <arn> creates AWS resources and returns the queue URL.

  • rosa describe cluster shows Spot Termination Queue URL: <url> only when configured.

  • rosa describe machinepool / rosa list machinepools shows Spot status.

  • Attempting to modify Spot settings on an existing machine pool returns a clear error guiding the user to delete and recreate.

  • Simple-mode warning prints when creating a Spot pool on a cluster without a queue URL.
  • How to Test (Step-by-Step)


    Preconditions


  • Go toolchain compatible with the repo go.mod requirement.

  • AWS/OCM credentials only required for live command checks.
  • Test Steps


    1. make install-hooks
    2. make fmt
    3. make test
    4. make pre-push-checks
    5. Optionally verify with rosa create cluster --help, rosa edit cluster --help, rosa create machinepool --help, rosa create spot-termination-queue --help

    Expected Results


  • Local validation passes.

  • New flags and commands are available.

  • Spot machine pool create works with warning in Simple mode.

  • Queue URL edit transitions cluster to Enhanced mode.

  • Modifying spot on an existing pool returns guidance to delete and recreate.
  • Proof of the Fix


  • Logs/CLI output: make pre-push-checks passes

  • Live validation runs performed in staging (see PR comments for raw outputs)
  • Breaking Changes


  • No breaking changes

  • Yes, this PR introduces a breaking change (describe impact and migration plan below)
  • Developer Verification Checklist


  • Commit subject/title follows [JIRA-TICKET] | [TYPE]: <MESSAGE>.

  • PR description clearly explains both what changed and why.

  • Relevant Jira/GitHub issues and related PRs are linked.

  • make install-hooks has been run in this clone.

  • Tests were added/updated where appropriate.

  • I manually tested the change.

  • make test passes.

  • make lint passes.

  • make rosa passes.

  • Documentation or repo-local agent guidance was added/updated where appropriate.

  • Any risk, limitation, or follow-up work is documented.
  • Known Limitations


  • Spot configuration is immutable after node pool creation. To change the spot max price or enable/disable spot, delete the machine pool and create a new one.

  • Day-2 Spot node pool edits: The backend currently rejects updates to aws_node_pool.spot_market_options in staging. The CLI sends the request through without local guards, so the user sees the backend's actual error if the path becomes available in a future backend release.
  • [ROSAENG-8272]: https://redhat.atlassian.net/browse/ROSAENG-8272?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: davidleerh Review duration: 5797m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3457"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository