kubernetes: API documentation incorrectly states that resizePolicy can be set to ephemeral containers
What happened?
Based on the concept of
resizePolicy, it is expected behavior that resizePolicy cannot be assigned to ephemeral containers, as they do not support resource requests or limits.
However, in the Kubernetes v1.31 API documentation, there is no clear indication that the resizePolicy option is disallowed for ephemeral containers, which may lead to confusion for users.
pkg/apis/core/validation/validation_test.go
func TestValidateEphemeralContainers(t *testing.T) {
...
...
...
{
"Container uses disallowed field: ResizePolicy",
line(),
[]core.EphemeralContainer{{
EphemeralContainerCommon: core.EphemeralContainerCommon{
Name: "resources-resize-policy",
Image: "image",
ImagePullPolicy: "IfNotPresent",
TerminationMessagePolicy: "File",
ResizePolicy: []core.ContainerResizePolicy{
{ResourceName: "cpu", RestartPolicy: "NotRequired"},
},
},
}},
field.ErrorList{{Type: field.ErrorTypeForbidden, Field: "ephemeralContainers[0].resizePolicy"}},
}
...
...
...
As shown in the code above, it is explicitly stated that resizePolicy cannot be assigned to ephemeral containers.
This restriction is not reflected in the API documentation, potentially leading users to believe they can apply resizePolicy to ephemeral containers. Including this limitation in the documentation would improve clarity and enhance the user experience.
What did you expect to happen?
The Kubernetes v1.31 API documentation should clearly state that resizePolicy cannot be assigned to ephemeral containers, as they do not support resource requests or limits. This clarification would prevent users from mistakenly assuming that resizePolicy can be applied to ephemeral containers and help avoid configuration errors.
How can we reproduce it (as minimally and precisely as possible)?
- Go to the Kubernetes v1.31 API documentation.
- Navigate to the section discussing
resizePolicyfor containers. - Review the documentation regarding ephemeral containers.
- Observe that there is no mention or clarification that
resizePolicycannot be applied to ephemeral containers, leading to potential misunderstandings.
Anything else we need to know?
No response
Kubernetes version
$ kubectl version
Client Version: v1.31.1
Kustomize Version: v5.4.2
Server Version: v1.31.1
Cloud provider
OS version
# On Linux:
$ cat /etc/os-release
RETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
$ uname -a
Linux masternode-virtual-machine 6.8.0-47-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct 2 16:16:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, …) and versions (if applicable)
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 23 (7 by maintainers)
I closed my PR as I see progress at https://github.com/kubernetes/kubernetes/pull/129606.
/unassign
This bug has been attempted few times but seems like this wasn’t rightly approached as suggested in the new contributor documentation. Please allow me to handle this one. If it’d help, I could also follow up with updating the readme with back-references on updating api references.
+adding new contributor ambassadors for suggestion.
/cc @pacoxu /cc @sreeram-venkitesh