← Back to Pull requests

Sign worker metrics certificates with CDI CA #4330

Closed
unknown closed this pull request without merging on Nov 18, 2026 22:02 UTC
View on GitHub
unknown unknown commented on Oct 29, 2026 13:49 UTC
Author

<!-- Thanks for sending a pull request! Here are some tips for you:
1. Follow the instructions for writing a release note from k8s: https://git.k8s.io/community/contributors/guide/release-notes.md
-->

What this PR does / why we need it:

Replace self-signed Prometheus metrics certificates for importer, clone-source, oVirt and OpenStack worker pods with certificates issued by the existing CDI upload server signer.

Inject the server certificate generator into the import, clone and forklift reconcilers and use the configured server certificate duration.
For oVirt and OpenStack populators, move certificate generation from the worker binaries to the controller, store the certificates in Secrets and mount them into the worker pods.

Reuse the existing certificate Secret and volume helpers, preserving Secret naming, labels, ownership and create-only behavior.

Centralize worker metrics certificate provisioning and move certificate configuration defaulting into controller/common, keeping the existing operator helper as a delegating wrapper and preserving defaulting behavior.

Unit tests cover certificate data, generator arguments, error propagation, preservation of existing Secrets, filesystem/block pod configuration, and certificate configuration defaulting.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Partially addresses #4260.

Special notes for your reviewer:

This PR aligns worker metrics endpoints with the existing pattern:
controller-generated certificates, signed by the CDI CA, stored in Secrets and mounted into pods.

Client-side TLS verification remains unchanged. Enabling verification with the CDI CA bundle and the appropriate server identity will be tracked in a separate issue.

Validation:

  • Full unit test suite, targeted Bazel tests and binary builds, and lint.

  • Import progress and host-assisted clone functional tests.

  • Manual oVirt and OpenStack metrics TLS checks on Kubernetes 1.35.4

  • using filesystem PVCs: both endpoints returned HTTP 200 with CA and
    hostname verification enabled, and served the certificate stored in
    their Secret.

    The manual runtime checks verified metrics TLS only; they did not exercise complete imports from real oVirt or OpenStack environments.

    Release note:
    <!-- Write your release note:
    1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
    2. If no release note is required, just write "NONE".
    -->
    ``release-note
    NONE
    ``

    Diff: 337 lines (+252 / -85) across 4 files Reviewer: davmarro Review duration: 29293m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 337 lines diff across 4 files
    0.42
    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.348
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4330"
    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: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    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: 16.7% · Safe to merge
    16.7%