← Back to Pull requests

Add SQS interruption queue support for spot instances #78

Open
unknown opened this pull request with 320 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 17, 2026 07:41 UTC
Author

Summary

  • Add InterruptionQueue field to KarpenterSpec API for configuring spot interruption handling

  • Configure INTERRUPTION_QUEUE environment variable in operand deployment when queue is specified

  • Add SQS permissions to AWS credentials request for queue operations

  • Include E2E test suite for SQS spot interruption with proper AWS resource cleanup

  • Sync operand manifests from upstream release-5.1 (required for clean rebase)
  • Implementation

    The operator now accepts an interruptionQueue field in the Karpenter CR spec. When set, it configures the operand deployment with the INTERRUPTION_QUEUE environment variable, enabling the AWS Karpenter provider's interruption controller to watch an SQS queue for EC2 spot interruption events.

    API Changes:

  • Added InterruptionQueue field to autoscaling.openshift.io/v1alpha1.KarpenterSpec

  • Generated CRD manifest updated
  • Controller Changes:

  • OCP controller passes interruptionQueue to operand config

  • Deployment builder conditionally injects INTERRUPTION_QUEUE env var

  • HCP controller includes TODO for AUTOSCALE-1019 (HyperShift API support)
  • RBAC Changes:

  • Added SQS permissions (ReceiveMessage, DeleteMessage, GetQueueUrl, GetQueueAttributes) to AWS credentials request
  • E2E Tests:

  • New test suite in test/suites/operator/interruption_test.go

  • Creates SQS queue, NodePool with spot capacity, and simulates interruption event

  • Verifies operand env var configuration and interruption handling

  • Cleanup includes EC2 fleet/spot instance request removal via resource tagging API
  • Operand Manifest Sync:

  • Includes operand manifest updates from upstream release-5.1 branch

  • Adds new CapacityBuffer CRD and additional RBAC permissions

  • Required for PR to pass make verify after rebasing on main
  • Test plan

  • Unit tests pass for OCP controller interruption queue configuration

  • E2E tests pass for SQS spot interruption on standalone OCP 4.22 cluster

  • make verify passes

  • make lint passes
  • Related

  • Implements AUTOSCALE-1018 (Add SQS Interruption Queue Support to Karpenter Operator API)

  • Implements AUTOSCALE-1020 (Add E2E Tests for Karpenter SQS Spot Interruption)

  • Blocked on AUTOSCALE-1019 for HyperShift support (API design pending)
  • 🤖 Generated with Claude Code

    Diff: 320 lines (+240 / -80) across 4 files Reviewer: linkvt Review duration: 422m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 320 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.345
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #78"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 41.9% (MEDIUM) · Higher = larger blast radius
    41.9%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 22.3% · Safe to merge
    22.3%