← Back to Pull requests

monitor: enable TLS for kata-monitor #2777

Closed
unknown closed this pull request without merging on Sep 23, 2026 07:30 UTC
View on GitHub
unknown unknown commented on Sep 01, 2026 10:09 UTC
Author

<!--
If this is a bug fix, make sure your description includes "Fixes: #xxxx", or

Please provide the following information:
-->
- Description of the problem which is fixed/What is the use case
Update kata-monitor deployment to use HTTPS (port 8443) with TLS certificates managed by OpenShift's service-ca controller. This aligns with upstream https://github.com/kata-containers/kata-containers/pull/13257, which adds --tls-cert-file and --tls-key-file flags to kata-monitor binary.

- What I did

  • Update Service to port 8443 and add serving-cert-secret-name annotation

  • Configure DaemonSet to mount TLS certs from kata-monitor-certs secret

  • Pass --tls-cert-file and --tls-key-file flags to kata-monitor command
  • - Test Results

    Environment

  • Cluster: OCP 4.22.0-0.nightly-2026-09-02-125503 (AWS, 3 compact nodes)

  • Operator image: quay.io/thejasn/openshift-sandboxed-containers-operator:1.14.0-monitor

  • kata-monitor image: quay.io/redhat-user-workloads/ose-osc-tenant/osc-monitor:c92e9f5445838574aa4faf8e1708156bde6c3a32 (includes upstream TLS support from openshift/kata-containers#416)

  • FBC catalog: quay.io/thejasn/openshift-sandboxed-containers-operator-fbc-catalog:v1.14.0-monitor
  • TLS configuration verified on monitor pod

    Command args — listening on HTTPS port 8443 with TLS cert/key flags:
    ``[
    "/usr/bin/kata-monitor",
    "--listen-address=:8443",
    "--log-level=debug",
    "--runtime-endpoint=/run/crio/crio.sock",
    "--tls-cert-file=/etc/kata-monitor/certs/tls.crt",
    "--tls-key-file=/etc/kata-monitor/certs/tls.key",
    "--tls-min-version=VersionTLS12",
    "--log-level=debug",
    "--runtime-endpoint=/run/crio/crio.sock",
    "--tls-cert-file=/etc/kata-monitor/certs/tls.crt",
    "--tls-key-file=/etc/kata-monitor/certs/tls.key",
    "--tls-min-version=VersionTLS12",
    "--log-level=debug",
    "--runtime-endpoint=/run/crio/crio.sock",
    "--tls-cert-file=/etc/kata-monitor/certs/tls.crt",
    "--tls-key-file=/etc/kata-monitor/certs/tls.key",
    "--tls-min-version=VersionTLS12",
    "--tls-cipher-suites=TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,..."
    ]

    
    ### TLS cert volume mount — certs from kata-monitor-certs secret (managed by OpenShift service-ca):
    
    {
    "mountPath": "/etc/kata-monitor/certs/",
    "name": "kata-monitor-certs",
    "readOnly": true
    }
    
    ### Volume source — secret with tls.crt and tls.key:
    
    {
    "name": "kata-monitor-certs",
    "secret": {
    "secretName": "kata-monitor-certs",
    "items": [
    { "key": "tls.crt", "path": "tls.crt" },
    { "key": "tls.key", "path": "tls.key" }
    ]
    }
    }
    ###  Metrics endpoint reachable over HTTPS
    
    Queried using the prometheus-k8s SA token (same SA Prometheus uses to scrape):
    

    $ TOKEN=$(oc create token prometheus-k8s -n openshift-monitoring)
    $ oc run monitor-test --rm -i --restart=Never \
    -n openshift-sandboxed-containers-operator \
    --image=registry.access.redhat.com/ubi9/ubi-minimal:latest \
    -- curl -sk -H "Authorization: Bearer $TOKEN" \
    https://metrics.openshift-sandboxed-containers-operator.svc:8443/metrics

    HELP kata_monitor_go_gc_duration_seconds A summary of the wall-time pause...


    TYPE kata_monitor_go_gc_duration_seconds summary


    kata_monitor_go_gc_duration_seconds{quantile="0"} 3.1142e-05
    kata_monitor_go_gc_duration_seconds{quantile="0.25"} 4.7252e-05
    ...

    HELP kata_monitor_go_goroutines Number of goroutines that currently exist.


    TYPE kata_monitor_go_goroutines gauge


    kata_monitor_go_goroutines 14

    HELP kata_monitor_go_info Information about the Go environment.


    TYPE kata_monitor_go_info gauge


    kata_monitor_go_info{version="go1.26.7 (Red Hat 1.26.7-1.el9_8)"} 1
    ...
    ``

    - Description for the changelog
    TBD
    <!--
    Write a short (one line) summary that describes the changes in this
    pull request for inclusion in the changelog:
    -->

    Closes: KATA-5872

    Diff: 495 lines (+371 / -124) across 6 files Reviewer: ngopalak-redhat Review duration: 31520m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.71) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.71 · 495 lines diff across 6 files
    0.71
    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.371
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.071
    Real PR Conversation Timeline
    1 comments
    "Review active on #2777"
    general weight: 0.35
    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: 70.6% (HIGH) · Higher = larger blast radius
    70.6%
    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: 27.9% · Safe to merge
    27.9%