Pod-level limits defaults not set when all containers have limits set and pod-level request is set
#136,120 创建于 2026年1月9日
描述
As per the requirements listed in the KEP, pod-level limits are set to aggregated container limits if all containers have limits set. Please check rows 10, 12 from the table in the KEP:
The implementation is setting only pod-level requests defaults as per different scenarios. https://github.com/kubernetes/kubernetes/blob/98e6935d436d5068b3549e651e629f76ec96e3f7/pkg/apis/core/v1/defaults.go#L198
The bug fix involves adding the defaulting logic for pod-level limits such that when pod-level requests are set, and pod-level limits are unset and "all containers" have limits set then pod-level limits should be defaulted to aggregated container limits.
Instead of adding to the existing in defaults.go, it is recommended to limit this change to podStrategy#PrepareForCreate and podResizeStrategy#PrepareForUpdate and also guard the implementation behind a feature gate - PodLevelResourcesFixUpdateDefaulting