Kubernetes 1.38: Deep dive into new alpha features Kubernetes v1.38, scheduled for release on December 16, introduces 27 new alpha enhancements, including security profile distribution via OCI artifacts, two-phase eviction, DRA-aware preemption, dynamic containers, per-container ulimits, weighted load balancing for kube-apiserver, and conditional authorization. Among the node-level changes, KEP-6007 adds a `numa-allocation-strategy` option to the Topology Manager with three values — `none` (default), `most-allocated`, and `least-allocated` — so performance-sensitive workloads such as NFV and AI/ML can be consolidated or spread across NUMA nodes instead of defaulting to the lowest-ID node. KEP-5474 adds a `cgroupOptions` field under `securityContext` that, when `mountMode` is set to `Writable`, lets unprivileged containers create child cgroups for cases like Docker-in-Docker while still being capped at the Pod's aggregate limits. The Kubernetes v1.38 release is scheduled for December 16th and, as always, it comes with plenty of new features. They include security profile distribution via OCI artifacts, two-phase eviction, DRA-aware preemption, dynamic containers, per-container ulimits, weighted load balancing for kube-apiserver, and conditional authorization, among other things. Let’s take a closer look at 27 newly introduced enhancements Note : We do our best to announce the actual changes. However, given the ever-changing nature of the Kubernetes feature landscape, some of the Kubernetes Enhancement Proposals KEPs discussed in this article may be removed from the milestone as the release date approaches. Nodes Add Topology Manager option to improve workload density for single-numa-node For performance-sensitive workloads like NFV and AI/ML, keeping allocated CPUs, memory, and devices such as GPUs on the same NUMA node is essential. In Kubernetes, the Topology Manager https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/ takes care of this. It coordinates resource providers CPUManager , MemoryManager , DeviceManager , gathers their TopologyHints , and applies the alignment policies single-numa-node , restricted , best-effort . Previously, if multiple placement options were available for a Pod say, adequate resources on both NUMA 0 and NUMA 1 , the Topology Manager did not account for the existing resource allocation levels on those NUMA nodes. Instead, it defaulted to a tie-breaker favoring the NUMA node with the lowest ID — typically NUMA 0. As a result, workloads piled up on some NUMA nodes while others sat idle. KEP-6007 adds a new numa-allocation-strategy option to the Topology Manager. It lets you control how an eligible NUMA node is picked depending on their resource allocation levels. It supports three values: none default , most-allocated consolidates workloads , and least-allocated spreads workloads across NUMA nodes . The TopologyHint struct gets a new score field to measure resource allocation. It is calculated based on allocated CPUs, memory, and devices rather than their actual utilization. The score only acts as an additional criterion to choose between equally valid hints and doesn’t change any existing topology guarantees. On top of that, you can adjust the weights for specific resources or exclude them from scoring altogether. Enable Writable cgroups for unprivileged containers To limit container resources CPU and RAM , the Linux operating system uses the cgroups control groups mechanism. The configurations for these limits are stored in the container’s /sys/fs/cgroup directory. Kubernetes mounts this directory as read-only by default to prevent a program inside the container from changing its own limits or interfering with other apps on the same node. However, there are some use cases where you actually need to spin up child cgroups right inside the container. For example, they include nested containers such as Docker-in-Docker DinD and applications that dynamically manage resources. KEP-5474 adds a new cgroupOptions field under securityContext in the Pod manifest: apiVersion: v1 kind: Pod metadata: name: writable-cgroups-example spec: containers: - name: app image: myapp:latest securityContext: cgroupOptions: mountMode: Writable When its mountMode is set to Writable , the container runtime like containerd or CRI-O will mount the /sys/fs/cgroup directory inside the container as writable. In this scenario, the container will be able to create subgroups and allocate resources within its own cgroup subtree; however, it cannot exceed the overall limits established for the Pod. The system will respond to any breach of the aggregate Pod limits in the standard manner — for example, killing the process with an OOM error. Allow specifying whether to unshare cgroup namespaces In cgroup v2, privileged Pods share the host’s cgroup namespace by default. If you run nested containers inside them, their processes may end up outside the Pod’s cgroup hierarchy, messing up resource accounting and limit enforcement. This can result in OOM events and CPU contention on the node. KEP-5714 lets you explicitly enable cgroup namespace isolation for such Pods. OCI Artifact-Based Security Profile Distribution Kubernetes uses seccomp profiles to restrict syscalls and AppArmor profiles to restrict file, path, and network access, among other things for isolating Linux containers. The pain point is distributing custom Localhost profiles: you have to get the profile onto the node before a Pod can apply it. Currently, three approaches are commonly used to push profiles onto nodes: - Baking them into node images. The downside is that to update a profile, you have to rebuild the images and roll out all your nodes. - A dedicated DaemonSet. This approach is prone to race conditions: a workload may be scheduled and started before the DaemonSet has delivered the profile to a specific node. - Security Profiles Operator. It gets rid of the distribution issue; the downside is that you have to deploy a whole operator with all those CRDs, RBAC, and webhooks just for that. And here goes the magic: KEP-6061 suggests shipping security profiles as OCI artifacts In alpha, seccomp is supported, with AppArmor support planned for beta. The PodSpec specifies a full, digest-pinned OCI reference registry/repository@sha256:... ; mutable tags are intentionally unsupported. kubelet retrieves registry credentials via imagePullSecrets and hands them to the CRI runtime, which then pulls the profile and caches it. Note that the OCI profile isn’t applied “as is”. Instead, the runtime logically intersects the runtime’s baseline profile with an optional base profile specified in the PodSpec and the OCI profile. This way, an OCI profile can only add up to restrictions and cannot weaken the node-level protections configured by an administrator. Here’s an example: securityContext: seccompProfile: type: OCI oci: reference: "registry.example.com/agents/code-exec-seccomp@sha256:9d4e..." baseProfile: type: Localhost localhostProfile: "agentic-baseline.json" For AI agents, an admin can distribute a base Localhost profile across nodes. Each agent type then points to its own OCI profile. The runtime computes the logical intersection of these two profiles along with its own baseline profile; thus, if you tighten the baseline profile, the new restrictions automatically apply to every agent using it — no need to republish any OCI profiles. Support hugepages in kubelet’s --system-reserved and --kube-reserved flags - KEP 6252 https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/6252-system-reserved-hugepages issue https://github.com/kubernetes/enhancements/issues/6252 - Feature gate: none to use this new behavior, administrators need to manually specify hugepages-