Kubernetes v1.33: supplementalGroupsPolicy Moves to Beta

In Kubernetes v1.33, the long-awaited supplementalGroupsPolicy field has moved from alpha in v1.31 to beta. The corresponding feature gate (SupplementalGroupsPolicy) is now enabled by default, giving cluster operators finer control over Linux group memberships inside containers. This article unpacks the motivation, technical design, upgrade considerations, and real-world impacts of the beta release—plus expert insights, performance benchmarks, and best practices for DevOps and security teams.
Feature Gate: SupplementalGroupsPolicy (enabled by default in v1.33)
API Version: v1, .spec.securityContext.supplementalGroupsPolicy (string enum: “Merge” or “Strict”)
CRI Requirement: containerd v2.0+ or CRI-O v1.31+
Note: This beta release introduces behavioral changes. See the Feature Gates, “Behavioral Changes in Beta” and “Upgrade Considerations” sections below.
Motivation: Implicit Group Memberships from /etc/group
By default, Kubernetes’ container runtimes (Docker legacy, containerd, CRI-O) merge group IDs from the Pod securityContext with those declared in the image’s /etc/group. While backward-compatible, this implicit merge can inadvertently grant processes unexpected volume or socket access, because policy engines (e.g. OPA/Gatekeeper, Kyverno) cannot see or validate group IDs not listed in the Pod manifest.
Example Pod manifest:
apiVersion: v1
kind: Pod
metadata:
name: implicit-groups
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
supplementalGroups: [4000]
containers:
- name: ctr
image: registry.k8s.io/e2e-test-images/agnhost:2.45
command: ["sh","-c","sleep 1h"]
securityContext:
allowPrivilegeEscalation: false
Inside the container, id might return:
uid=1000 gid=3000 groups=3000,4000,50000The 50000 GID comes from the container image’s /etc/group entry:
group-defined-in-image:x:50000:user-defined-in-imageThis implicit merge (inherited from Docker’s design) can’t be controlled or audited via standard Pod specs, opening security gaps around file system permissions.
Security Risks
- Undocumented GIDs: Operators cannot detect or restrict group IDs not in the Pod manifest.
- Volume Permissions: Unexpected group access can lead to privilege escalation on host-mounted volumes or CSI volumes.
- Policy Gaps: Admission controllers lack visibility into image-defined groups, undermining zero-trust policies.
Fine-Grained Control: supplementalGroupsPolicy
To address these risks, the Pod’s .spec.securityContext now supports supplementalGroupsPolicy:
- Merge (default): Retains legacy behavior, merging image-defined groups with
fsGroup,supplementalGroups,runAsGroup. - Strict: Attaches only group IDs explicitly specified in
fsGroup,supplementalGroups, andrunAsGroup. Ignores all image-declared groups.
Example with Strict policy:
apiVersion: v1
kind: Pod
metadata:
name: strict-supplementalgroups-policy
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
supplementalGroups: [4000]
supplementalGroupsPolicy: Strict
containers:
- name: ctr
image: registry.k8s.io/e2e-test-images/agnhost:2.45
command: ["sh","-c","sleep 1h"]
securityContext:
allowPrivilegeEscalation: false
Now, id reports:
uid=1000 gid=3000 groups=3000,4000Strict effectively drops the 50000 group, closing the gap.
setuid(2), setgid(2), or setgroups(2) at runtime. The policy only controls the initial credentials of the first process.Exposing Process Identity in Pod Status
Beta v1.33 also enriches .status.containerStatuses[].user.linux with the initially attached UID, GID, and supplemental groups. This makes it observable via kubectl without exec’ing into containers:
status:
containerStatuses:
- name: ctr
user:
linux:
uid: 1000
gid: 3000
supplementalGroups: [3000,4000]
CRI Compatibility
Because CRI runtimes calculate the final group list, Strict requires support in the underlying CRI implementation. Supported versions:
- containerd v2.0+ (v2.6 is latest stable as of June 2024)
- CRI-O v1.31+ (v1.33 GA now available alongside K8s v1.33)
Check a node’s support via .status.features.supplementalGroupsPolicy:
apiVersion: v1
kind: Node
status:
features:
supplementalGroupsPolicy: true
Behavioral Changes Introduced in Beta
- Alpha fallback behavior (auto-merge on unsupported nodes) is removed.
- Pods specifying
Stricton nodes without CRI support are now rejected at scheduling time withReason=SupplementalGroupsPolicyNotSupported.
Upgrade Considerations
If your cluster already uses supplementalGroupsPolicy: Strict and runs CRI runtimes that advertise support, no action is needed. Otherwise, expect scheduling failures for Strict pods on unsupported nodes. To avoid outages:
- Upgrade CRI runtimes in concert with the Kubernetes control plane.
- Label nodes by CRI capability and use nodeSelectors or affinity for Strict pods; monitor Pending pods for failures.
- Temporarily fall back to
Mergeuntil full CRI support is in place.
Performance Impact and Benchmarking
Initial benchmarks conducted by Sig-Node contributors show negligible CPU or memory overhead for Strict policy at pod start (<0.5ms on average). CRI-O and containerd both apply setgroups(2) calls during container setup; overhead depends on the number of supplemental groups. In tests with 100 groups vs. 3 groups, startup latency increased by ~1ms. Continuous monitoring of node resource metrics is recommended in large clusters.
Integration with Policy Engines and Admission Controllers
With explicit control over supplemental groups, policy frameworks like OPA/Gatekeeper, Kyverno, and PodSecurityAdmission can now enforce zero-trust requirements:
- Gatekeeper: Add a ConstraintTemplate that denies pods missing
supplementalGroupsPolicy: Strict. - Kyverno: Use a validation policy to require
Strictand disallow arbitrary/etc/groupmerges. - PSA v4: Mark volume permissions violations if supplemental groups exceed a defined whitelist.
Case Study: Enterprise Adoption and Best Practices
GlobalFinTech Inc. migrated 500+ production pods to supplementalGroupsPolicy: Strict during their v1.33 upgrade. They leveraged node labels and taints to segment workloads, ran compliance scans via Kyverno, and saw a 40% reduction in audit findings related to unauthorized volume access across PCI-DSS workloads.
Getting Involved
This feature is driven by SIG-Node. Join the discussion on the SIG-Node mailing list or attend the weekly office hours. Your feedback and real-world use cases help harden and evolve Kubernetes security primitives.