← Back to Pull requests

fix(chart): verify the metrics certificate when a TLS secret is set #538

Open
unknown opened this pull request with 302 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 19, 2026 12:30 UTC
Author

/kind bug

What this PR does / why we need it:

The ServiceMonitor defaults to tlsConfig.insecureSkipVerify: true. That is needed for the self-signed certificate generated when tls.metricsTLSSecret is empty, but it also means that a certificate provided through tls.metricsTLSSecret is never verified.

  • the default of prometheus.serviceMonitor.tlsConfig changes from insecureSkipVerify: true to {}, and the template sets insecureSkipVerify: true only when tls.metricsTLSSecret is empty: an install with default values renders the same ServiceMonitor as before

  • with a secret, verification stays on and ca / serverName go in prometheus.serviceMonitor.tlsConfig

  • an explicit insecureSkipVerify is always honored

  • the release notes warn when a secret is set and tlsConfig is empty, since the scrapes fail in that case

  • adds a unit test that renders the chart with helm template
  • | | Before | After |
    |---|---|---|
    | values.yaml default | tlsConfig: {insecureSkipVerify: true} | tlsConfig: {} |
    | No secret, nothing else set | skip verify | skip verify (unchanged) |
    | Secret set, nothing else set | skip verify | verify |

    Release note:

    ``release-note
    Helm chart: the ServiceMonitor skips the verification of the metrics certificate only when
    tls.metricsTLSSecret is empty. Action required: releases that set tls.metricsTLSSecret and relied on the default must set ca and serverName in prometheus.serviceMonitor.tlsConfig, or an explicit insecureSkipVerify: true.
    `

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    ServiceMonitor TLS settings are applied consistently to both metrics endpoints and support custom CA certificates and server names.
    Without a metrics TLS secret, certificate verification is disabled by default. With a secret, Prometheus uses its default verification behavior unless configured otherwise. Explicit
    true or false values are respected; null` keeps verification enabled.
    Helm warns when a TLS secret is configured without verification settings and recommends configuring a CA and server name.

    Documentation
    Clarified TLS defaults and noted that unverified self-signed certificates are intended for development and testing.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 302 lines (+226 / -76) across 3 files Reviewer: ricky-rav Review duration: 23616m
    All Vouch review confidence checks passed
    Residual risk 0.34 = Change Risk (0.63) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 302 lines diff across 3 files
    0.63
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.342
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #538"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 63.3% (MEDIUM) · Higher = larger blast radius
    63.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: 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: 33.7% · Safe to merge
    33.7%