Skip to content

[PodLevelResources] Validation for Windows OS #132582

Open
@ndixita

Description

@ndixita

PodLevelResources feature is not supported on Windows OS. Add the necessary validation logic to reject pods for Windows.

From the KEP #2837, until full Windows support for pod-level resource specifications is implemented, the behavior for pods, with pod-level resources, targeting Windows is as follows:

  • API Server Validation: If the spec.os.name field in the Pod specification is explicitly set to "windows", the Kubernetes API server will generally reject the pod during validation.

    Add the following logic in validatePodResources
    // windows pods are not supported.
    if oldPod.Spec.OS != nil && oldPod.Spec.OS.Name == core.Windows && pod level resources are set {
    return field.ErrorList....
    }

  • Kubelet Admission: The Kubelet running on a Windows node would reject the pod, with pod-level resources, during admission.

    Add IsPodLevelResourcesAllowed in features_windows.go, features_linux.go and features_unsupported.go (example - ref
    and call this method from SyncPod) if pod level resources are set in the spec

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.sig/nodeCategorizes an issue or PR as relevant to SIG Node.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

Status

Triaged

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions