← Back to Pull requests

feat(fleet): replace mgmt-cluster Bicep with aks-cluster-create Go tool #6856

Closed
unknown closed this pull request without merging on Sep 18, 2026 13:36 UTC
View on GitHub
unknown unknown commented on Sep 07, 2026 19:08 UTC
Author

Summary

Move management-cluster provisioning from Bicep into a Go tool as the first step toward environment-derived node pool management. This stage uses static config.yaml mgmt.aks.{systemAgentPool,userAgentPool,infraAgentPool} configuration and shares the resource-modeling code with fleet controllers. ARM still handles resource dependencies and long-running operations, rather than the tool independently polling every pool.

Tracking: this PR serves as the implementation and review record for the static-configuration stage; no separate tracking ticket is linked. Follow-up PRs will add desired-state allocation (PR2) and the day-2 node pool reconciliation controller (PR3).

Provisioning behavior

  • One incremental ARM deployment per cluster: dev-infrastructure/scripts/aks-cluster-create builds the template from SDK cluster and agent-pool specifications. The bootstrap system pool is inline only for initial cluster creation; configured child pools are deployed declaratively. Unconfigured pools are left untouched, and Kubernetes versions are omitted on updates to avoid implicit upgrades.

  • Avoid no-op cluster reconciliation: omit the cluster resource when its owned configuration already matches and provisioning has succeeded, because even an identical AKS PUT starts reconciliation. Include it for configuration drift or recovery from unsuccessful provisioning. Log changed cluster field paths, not configuration values.

  • Restart and recovery: use the stable aks-cluster-create deployment name, wait for previous deployment and cluster operations, then observe live configuration before building a fresh template. A previous successful deployment does not replace the live drift check. Log the previous Azure deployment error before recovering Failed/Canceled work.

  • Resource diagnostics without continuous polling: collect deployment operations in one paginated pass after completion or failure. Log resource identity, provisioning state and operation, timestamp, duration, status code, and nested provider errors. Collection is best-effort, bounded to 30 seconds even after cancellation, and never replaces the deployment result. Request and response payloads are excluded from operation logs.

  • Provisioning handover: stamp new clusters with aro-hcp-provisioning. Deployment success is the handover barrier: refresh the cluster and its ETag, then conditionally remove the marker while applying configured tags and preserving external tags. Failed deployments leave the marker intact; finalization does not independently poll every pool.
  • Shared packages and pipeline changes

  • Share compute types, zone/capacity helpers, SKU metadata caching, agent-pool helpers, and SDK-based pool specification construction through fleet/pkg/compute and fleet/pkg/azure/{skucache,agentpools,agentpoolspec}. Adapt the capacity reporting controller to these packages and armcontainerservice v8, and align affected module dependencies.

  • Deployment pipeline change: dev-infrastructure/mgmt-pipeline.yaml pre-builds the binary and runs cluster-create as a Shell step between infra and cluster.

  • Move AKS prerequisites—managed identity, subnets, NSG, outbound IP, and KMS Key Vault—from mgmt-cluster.bicep to mgmt-infra.bicep so they exist before the tool runs. Keep mgmt-cluster.bicep for post-cluster wiring and extract ACR pull, workload identity, and maintenance configuration into aks-cluster-post.bicep.
  • Test plan

    Verified locally for the updated AKS tool:

  • cd dev-infrastructure/scripts/aks-cluster-create && GOWORK=off go test -race ./...

  • cd dev-infrastructure/scripts/aks-cluster-create && GOWORK=off go build -o aks-cluster-create .

  • Local SDK-transport smoke run: previous deployment error before recovery, multi-page operation collection, nested provider errors and timings, diagnostics after cancellation, exclusion of request/response payloads, and best-effort handling of unavailable diagnostics. No Azure deployments created; temporary smoke files removed.
  • Broader validation remains to be completed or confirmed for this revision:

  • go test ./fleet/pkg/azure/... ./fleet/pkg/compute/... ./fleet/pkg/controllers/capacityreporting/...

  • make validate-config-pipelines

  • make verify-materialize after cd config && make materialize

  • Deploy to a personal development environment and verify cluster and pool creation

  • All required non-Tide CI checks pass (new checks are pending after the push)
  • Diff: 566 lines (+424 / -142) across 7 files Reviewer: bennerv Review duration: 15508m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 566 lines diff across 7 files
    0.50
    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.379
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6856"
    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: 49.7% (MEDIUM) · Higher = larger blast radius
    49.7%
    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: 19.6% · Safe to merge
    19.6%
    Repository