← Back to Pull requests

fix(kubevela): harden admission-webhook bootstrap against the vela-core chicken-egg #918

Closed
unknown closed this pull request without merging on Sep 23, 2026 08:33 UTC
View on GitHub
unknown unknown commented on Sep 22, 2026 14:20 UTC
Author

Problem

On a fresh cluster, the vela-core admission webhooks are registered before the vela-core Deployment is Ready. With the upstream default failurePolicy=Fail, the webhooks then reject every create/update they intercept — including the objects ArgoCD needs to finish its own sync — so the ArgoCD op wedges on the cert/admission hooks and vela-system stays empty. Classic chicken-egg; observed intermittently on spoke-dev while hub/prod won the race.

What was already in place (verified, left as-is)

  • Retry — the kubevela Application already has syncPolicy.retry.limit=-1 with exponential backoff (5s→10m). A wedged op is already retried; no change needed.

  • Sync-wave ordering — cert-manager is wave 2, kubevela is wave 3 (verified live on all three clusters), so cert-manager is Ready before kubevela. No change needed.
  • Fix (registry valuesObject.vela-core.admissionWebhooks)

  • failurePolicy: Ignore — a not-yet-ready webhook can no longer block object creation, so the bootstrap completes. Trade-off: OAM validation is best-effort while vela-core is briefly unavailable (acceptable vs. a hard bootstrap deadlock). Already covered by the Application's ignoreDifferences (.webhooks[].failurePolicy) so the apiserver/vela-core cannot flap it into permanent drift.

  • certManager.enabled: true — issue the webhook serving cert via cert-manager (a managed addon on every cluster, already Ready at wave 2) instead of the fragile PreSync kube-webhook-certgen Job. Removes the hook Job and its scheduling races without adding a new ordering dependency.
  • Verification (helm template, repo's local kubevela chart + these registry values)

    | Check | Default | With this change |
    |---|---|---|
    | failurePolicy: Ignore webhooks | 0 | 7 |
    | failurePolicy: Fail residual | (Fail) | 0 |
    | cert-manager Certificate / Issuer | 0 / 0 | 2 / 2 |
    | admission-webhooks/job-patch cert-gen Jobs | present | 0 (removed) |

    Sub-chart hook Jobs already carry helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded upstream, so no extra cleanup annotation was added.

    Rollout note (impact on live clusters)

    All three clusters are currently healthy on the old config (failurePolicy=Fail, cert via Job). Syncing this switches the admission-webhook cert mechanism to cert-manager on live clusters — an admission-control change. Recommend syncing kubevela-* one cluster at a time (start with spoke-dev) and confirming vela-core stays 2/2 and the webhooks get a cert-manager-issued caBundle before rolling to hub/prod. Not auto-synced by this PR.

    Diff: 332 lines (+249 / -83) across 4 files Reviewer: shapirov103 Review duration: 1092m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.65) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.65 · 332 lines diff across 4 files
    0.65
    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.347
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.065
    Real PR Conversation Timeline
    1 comments
    "Review active on #918"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 65.3% (HIGH) · Higher = larger blast radius
    65.3%
    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: 25.8% · Safe to merge
    25.8%