← Back to Pull requests

KEP-5714: CgroupNamespacesSupport: correct POD namespace mode to CONTAINER #6462

Open
AkihiroSuda opened this pull request with 37 lines diff across 1 files
View on GitHub
AkihiroSuda AkihiroSuda commented on Oct 09, 2026 14:08 UTC
Author

<!--
Please use the following format when naming your PR
< Issue Number >:< Issue Description >
e.g. KEP-000: adding beta graduation criteria

Avoid using phrases like fixes #NNNN in the description
unless the pull request is to change the KEP status to
implemented or KEP has been deprecated.
-->

<!-- short description of work done in PR e.g. updating milestone, adding new KEP, adding test requirements… -->

  • One-line PR description: correct POD namespace mode to CONTAINER
  • <!-- link to the k/enhancements issue -->

  • Issue link: #5714
  • <!-- other comments or additional information -->

  • Other comments:
  • It doesn't make much sense to unshare a cgroup namespace per a pod, as each of containers in a pod has their own cgroup.

    Actually, containerd and CRI-O have been unsharing cgroup namespaces per a container, not per a pod:

  • https://github.com/containerd/containerd/blob/v2.4.1/internal/cri/server/container_create.go#L765-L771

  • https://github.com/cri-o/cri-o/blob/v1.37.1/server/container_create.go#L971 (createSandboxContainer in CRI-O is called per a container, not per a pod)
  • Diff: 37 lines (+26 / -11) across 1 files Reviewer: chrishenzie Review duration: 82201m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.32) × (1 − Review Confidence (0.82)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.32 · 37 lines diff across 1 files
    0.32
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.77 · 5 substantive comment(s)
    0.77
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    82%
    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.218
    Real PR Conversation Timeline
    13 items
    chrishenzie chrishenzie commented on code on Oct 30, 2026 23:24 UTC
    Code Review
    keps/sig-node/5714-cgroupns/README.md:1
    @@ -318,8 +328,8 @@ How will UX be reviewed, and by whom?
     Consider including folks who also work outside the SIG or subproject.
     -->
     
    -Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the pod,
    -however, they are not modifiable unless the pod is running with privileged mode.
    +Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the container,
    +however, they are not modifiable unless the container is running with privileged mode.

    Note that this changes with KEP-5474 and the cgroup mount mode field, which lets an unprivileged container mount cgroupfs as read-write

    AkihiroSuda AkihiroSuda commented on code on Oct 30, 2026 23:39 UTC
    Code Review
    keps/sig-node/5714-cgroupns/README.md:1
    @@ -318,8 +328,8 @@ How will UX be reviewed, and by whom?
     Consider including folks who also work outside the SIG or subproject.
     -->
     
    -Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the pod,
    -however, they are not modifiable unless the pod is running with privileged mode.
    +Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the container,
    +however, they are not modifiable unless the container is running with privileged mode.

    Added a note about KEP-5474

    AkihiroSuda AkihiroSuda commented on Nov 05, 2026 03:49 UTC
    Author

    @kubernetes/sig-node-leads
    Could you merge this?
    The corresponding CRI PR is already merged:

  • https://github.com/kubernetes/kubernetes/pull/142544
  • haircommander haircommander commented on Nov 08, 2026 20:44 UTC
    Contributor

    /lgtm

    AkihiroSuda AkihiroSuda commented on Nov 09, 2026 03:50 UTC
    Author

    /assign @dchen1107

    chrishenzie chrishenzie approved these changes on Nov 19, 2026 17:48 UTC
    Approved Reviewer

    Approved these changes.

    chrishenzie chrishenzie commented on code on Nov 19, 2026 19:15 UTC
    Code Review
    keps/sig-node/5714-cgroupns/README.md:1
    @@ -318,8 +329,12 @@ How will UX be reviewed, and by whom?
     Consider including folks who also work outside the SIG or subproject.
     -->
     
    -Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the pod,
    -however, they are not modifiable unless the pod is running with privileged mode.
    +Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the container,
    +however, they are not modifiable unless the container is running with privileged mode,
    +or with `securityContext.cgroupOptions.mountMode: Writable` ([KEP-5474](../5474-enable-writable-cgroups/README.md)).

    This should be ReadWrite here and on line 337, to match KEP-5474.

    kubernetes-prow[bot] kubernetes-prow[bot] commented on Nov 19, 2026 19:56 UTC
    Bot

    New changes are detected. LGTM label has been removed.

    AkihiroSuda AkihiroSuda commented on code on Nov 19, 2026 19:56 UTC
    Code Review
    keps/sig-node/5714-cgroupns/README.md:1
    @@ -318,8 +329,12 @@ How will UX be reviewed, and by whom?
     Consider including folks who also work outside the SIG or subproject.
     -->
     
    -Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the pod,
    -however, they are not modifiable unless the pod is running with privileged mode.
    +Setting `HostCgroupNamespace` to `true` will make other cgroups visible to the container,
    +however, they are not modifiable unless the container is running with privileged mode,
    +or with `securityContext.cgroupOptions.mountMode: Writable` ([KEP-5474](../5474-enable-writable-cgroups/README.md)).

    fixed

    chrishenzie chrishenzie approved these changes on Nov 24, 2026 15:27 UTC
    Approved Reviewer

    Approved these changes.

    kubernetes-prow[bot] kubernetes-prow[bot] commented on Nov 24, 2026 15:27 UTC
    Bot

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by: <a href="https://github.com/kubernetes/enhancements/pull/6462#" title="Author self-approved">AkihiroSuda</a>, <a href="https://github.com/kubernetes/enhancements/pull/6462#pullrequestreview-6042192639" title="Approved">chrishenzie</a>
    Once this PR has been reviewed and has the lgtm label, please ask for approval from dchen1107. For more information see the Code Review Process.

    The full list of commands accepted by this bot can be found here.

    <details open>
    Needs approval from an approver in each of these files:

  • keps/sig-node/OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["dchen1107"]} -->

    AkihiroSuda AkihiroSuda commented on Dec 01, 2026 03:17 UTC
    Author

    @kubernetes/sig-node-leads PTAL. The implementation is already merged.

    Reviewers
    Assignees
    AkihiroSuda AkihiroSuda
    Labels
    risk: low confidence: 82.3% 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: 31.8% (LOW) · Higher = larger blast radius
    31.8%
    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: 82.3% · Lower = rushed or shallow review
    82.3%
    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: 5.6% · Safe to merge
    5.6%