← Back to Pull requests

Add kubelet serving certificate readiness example #365

Closed
unknown closed this pull request without merging on Oct 01, 2026 13:23 UTC
View on GitHub
unknown unknown commented on Aug 07, 2026 09:45 UTC
Author

This PR adds a new example demonstrating how to use NRC to prevent workloads from scheduling on a node until kubelet has obtained its TLS serving certificate.

Includes:

  • examples/kubelet-cert-readiness/: kind cluster config and manifests (RBAC, NPD ConfigMaps, NPD DaemonSet, NodeReadinessRule)

  • docs/book/src/examples/kubelet-cert-readiness.md: mdBook documentation page

  • docs/book/src/SUMMARY.md: adds the new page to the site navigation
  • Use Case

    This is in reference to a slack discussion raised in the NRC community. When a node is marked Ready, kubectl exec and kubectl logs may still fail because kubelet has not yet received its TLS serving certificate, the certificate is issued separately via a CSR and its approval can be delayed on some providers.

    This causes visible failures in CI/CD environments: GitLab Runner marks jobs as failed when it cannot exec into pods on a new node, and Fluentbit fails to collect logs from kubelet before the certificate is in place.

    How to test

    Create kind cluster


    kind create cluster --config examples/kubelet-cert-readiness/kind-config.yaml
    

    Install the CRDs and Controller


    See the Installation Guide for details

    Deploy the Example


    kubectl apply -f examples/kubelet-cert-readiness/manifests/
    

    Check the startup taint is applied


    kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints
    

    <img width="1160" height="91" alt="Pasted Graphic" src="https://github.com/user-attachments/assets/548ecebf-a323-4392-b709-e59fa0687de5" />

    Check the node condition


       kubectl get node <node-name> \
        -o jsonpath='{.status.conditions[?(@.type=="KubeletServingCertNotReady")]}' | jq .
    

    <img width="914" height="180" alt="Pasted Graphic 1" src="https://github.com/user-attachments/assets/67a20256-5220-4b0a-bbbc-3d3ba8552d12" />

    Approve the worker's pending CSR to simulate the certificate being issued


        kubectl get csr
        # find the entry with SIGNERNAME kubernetes.io/kubelet-serving and REQUESTOR system:node:<worker-name>
        kubectl certificate approve <worker-csr-name>
    

    <img width="1379" height="182" alt="Pasted Graphic 3" src="https://github.com/user-attachments/assets/760f1ec1-5bdf-4726-a990-e284e5f7f84c" />

    Check the condition again


        kubectl get node <node-name> \
        -o jsonpath='{.status.conditions[?(@.type=="KubeletServingCertNotReady")]}' | jq .
    

    <img width="918" height="182" alt="Pasted Graphic 4" src="https://github.com/user-attachments/assets/de5e0afa-fb82-4a98-9ba5-f86c27cd0b3a" />

    Check taint removal


       kubectl get node <node-name> -o jsonpath='{.spec.taints}'
    

    <img width="1144" height="38" alt="Pasted Graphic 5" src="https://github.com/user-attachments/assets/66e9ce63-74b8-41ab-818b-af5d1ea82899" />

    Confirm kubectl exec works


       kubectl run test-pod --image=busybox --restart=Never -- sleep 3600
       
       kubectl exec test-pod -- echo "exec works"
    

    <img width="865" height="54" alt="image" src="https://github.com/user-attachments/assets/fa4c7766-ef01-4b44-8f52-6b42af31794a" />

    Diff: 425 lines (+318 / -107) across 5 files Reviewer: ajaysundark Review duration: 79418m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.68) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 425 lines diff across 5 files
    0.68
    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.362
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.068
    Real PR Conversation Timeline
    1 comments
    "Review active on #365"
    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: 68.3% (HIGH) · Higher = larger blast radius
    68.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: 27.0% · Safe to merge
    27.0%