From 513153eee95e84ed8546a2e4ab660be98834d61a Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Fri, 19 Sep 2025 11:50:05 -0500 Subject: [PATCH 01/11] Copy KEP template --- .../README.md | 830 ++++++++++++++++++ .../kep.yaml | 51 ++ 2 files changed, 881 insertions(+) create mode 100644 keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md create mode 100644 keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml diff --git a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md new file mode 100644 index 00000000000..590a43e28b7 --- /dev/null +++ b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md @@ -0,0 +1,830 @@ + +# KEP-NNNN: Your short, descriptive title + + + + + + +- [Release Signoff Checklist](#release-signoff-checklist) +- [Summary](#summary) +- [Motivation](#motivation) + - [Goals](#goals) + - [Non-Goals](#non-goals) +- [Proposal](#proposal) + - [User Stories (Optional)](#user-stories-optional) + - [Story 1](#story-1) + - [Story 2](#story-2) + - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional) + - [Risks and Mitigations](#risks-and-mitigations) +- [Design Details](#design-details) + - [Test Plan](#test-plan) + - [Prerequisite testing updates](#prerequisite-testing-updates) + - [Unit tests](#unit-tests) + - [Integration tests](#integration-tests) + - [e2e tests](#e2e-tests) + - [Graduation Criteria](#graduation-criteria) + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) + - [Version Skew Strategy](#version-skew-strategy) +- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) + - [Feature Enablement and Rollback](#feature-enablement-and-rollback) + - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning) + - [Monitoring Requirements](#monitoring-requirements) + - [Dependencies](#dependencies) + - [Scalability](#scalability) + - [Troubleshooting](#troubleshooting) +- [Implementation History](#implementation-history) +- [Drawbacks](#drawbacks) +- [Alternatives](#alternatives) +- [Infrastructure Needed (Optional)](#infrastructure-needed-optional) + + +## Release Signoff Checklist + + + +Items marked with (R) are required *prior to targeting to a milestone / release*. + +- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) +- [ ] (R) KEP approvers have approved the KEP status as `implementable` +- [ ] (R) Design details are appropriately documented +- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) + - [ ] e2e Tests for all Beta API Operations (endpoints) + - [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) + - [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free +- [ ] (R) Graduation criteria is in place + - [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) within one minor version of promotion to GA +- [ ] (R) Production readiness review completed +- [ ] (R) Production readiness review approved +- [ ] "Implementation History" section is up-to-date for milestone +- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] +- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes + + + +[kubernetes.io]: https://kubernetes.io/ +[kubernetes/enhancements]: https://git.k8s.io/enhancements +[kubernetes/kubernetes]: https://git.k8s.io/kubernetes +[kubernetes/website]: https://git.k8s.io/website + +## Summary + + + +## Motivation + + + +### Goals + + + +### Non-Goals + + + +## Proposal + + + +### User Stories (Optional) + + + +#### Story 1 + +#### Story 2 + +### Notes/Constraints/Caveats (Optional) + + + +### Risks and Mitigations + + + +## Design Details + + + +### Test Plan + + + +[ ] I/we understand the owners of the involved components may require updates to +existing tests to make this code solid enough prior to committing the changes necessary +to implement this enhancement. + +##### Prerequisite testing updates + + + +##### Unit tests + + + + + +- ``: `` - `` + +##### Integration tests + + + + + +- [test name](https://github.com/kubernetes/kubernetes/blob/2334b8469e1983c525c0c6382125710093a25883/test/integration/...): [integration master](https://testgrid.k8s.io/sig-release-master-blocking#integration-master?include-filter-by-regex=MyCoolFeature), [triage search](https://storage.googleapis.com/k8s-triage/index.html?test=MyCoolFeature) + +##### e2e tests + + + +- [test name](https://github.com/kubernetes/kubernetes/blob/2334b8469e1983c525c0c6382125710093a25883/test/e2e/...): [SIG ...](https://testgrid.k8s.io/sig-...?include-filter-by-regex=MyCoolFeature), [triage search](https://storage.googleapis.com/k8s-triage/index.html?test=MyCoolFeature) + +### Graduation Criteria + + + +### Upgrade / Downgrade Strategy + + + +### Version Skew Strategy + + + +## Production Readiness Review Questionnaire + + + +### Feature Enablement and Rollback + + + +###### How can this feature be enabled / disabled in a live cluster? + + + +- [ ] Feature gate (also fill in values in `kep.yaml`) + - Feature gate name: + - Components depending on the feature gate: +- [ ] Other + - Describe the mechanism: + - Will enabling / disabling the feature require downtime of the control + plane? + - Will enabling / disabling the feature require downtime or reprovisioning + of a node? + +###### Does enabling the feature change any default behavior? + + + +###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)? + + + +###### What happens if we reenable the feature if it was previously rolled back? + +###### Are there any tests for feature enablement/disablement? + + + +### Rollout, Upgrade and Rollback Planning + + + +###### How can a rollout or rollback fail? Can it impact already running workloads? + + + +###### What specific metrics should inform a rollback? + + + +###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested? + + + +###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.? + + + +### Monitoring Requirements + + + +###### How can an operator determine if the feature is in use by workloads? + + + +###### How can someone using this feature know that it is working for their instance? + + + +- [ ] Events + - Event Reason: +- [ ] API .status + - Condition name: + - Other field: +- [ ] Other (treat as last resort) + - Details: + +###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? + + + +###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? + + + +- [ ] Metrics + - Metric name: + - [Optional] Aggregation method: + - Components exposing the metric: +- [ ] Other (treat as last resort) + - Details: + +###### Are there any missing metrics that would be useful to have to improve observability of this feature? + + + +### Dependencies + + + +###### Does this feature depend on any specific services running in the cluster? + + + +### Scalability + + + +###### Will enabling / using this feature result in any new API calls? + + + +###### Will enabling / using this feature result in introducing new API types? + + + +###### Will enabling / using this feature result in any new calls to the cloud provider? + + + +###### Will enabling / using this feature result in increasing size or count of the existing API objects? + + + +###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? + + + +###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? + + + +###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)? + + + +### Troubleshooting + + + +###### How does this feature react if the API server and/or etcd is unavailable? + +###### What are other known failure modes? + + + +###### What steps should be taken if SLOs are not being met to determine the problem? + +## Implementation History + + + +## Drawbacks + + + +## Alternatives + + + +## Infrastructure Needed (Optional) + + diff --git a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml new file mode 100644 index 00000000000..5dfddc15e73 --- /dev/null +++ b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml @@ -0,0 +1,51 @@ +title: KEP Template +kep-number: NNNN +authors: + - "@jane.doe" +owning-sig: sig-xyz +participating-sigs: + - sig-aaa + - sig-bbb +status: provisional|implementable|implemented|deferred|rejected|withdrawn|replaced +creation-date: yyyy-mm-dd +reviewers: + - TBD + - "@alice.doe" +approvers: + - TBD + - "@oscar.doe" + +see-also: + - "/keps/sig-aaa/1234-we-heard-you-like-keps" + - "/keps/sig-bbb/2345-everyone-gets-a-kep" +replaces: + - "/keps/sig-ccc/3456-replaced-kep" + +# The target maturity stage in the current dev cycle for this KEP. +# If the purpose of this KEP is to deprecate a user-visible feature +# and a Deprecated feature gates are added, they should be deprecated|disabled|removed. +stage: alpha|beta|stable + +# The most recent milestone for which work toward delivery of this KEP has been +# done. This can be the current (upcoming) milestone, if it is being actively +# worked on. +latest-milestone: "v1.19" + +# The milestone at which this feature was, or is targeted to be, at each stage. +milestone: + alpha: "v1.19" + beta: "v1.20" + stable: "v1.22" + +# The following PRR answers are required at alpha release +# List the feature gate name and the components for which it must be enabled +feature-gates: + - name: MyFeature + components: + - kube-apiserver + - kube-controller-manager +disable-supported: true + +# The following PRR answers are required at beta release +metrics: + - my_feature_metric From 444c9d6a558c92f732591b22da48017776d2a772 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Fri, 19 Sep 2025 14:25:39 -0500 Subject: [PATCH 02/11] amend! Copy KEP template KEP-5322: DRA: Handle permanent driver allocation failures --- .../README.md | 54 ++++++++++++++++--- .../kep.yaml | 47 ++++++---------- 2 files changed, 62 insertions(+), 39 deletions(-) diff --git a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md index 590a43e28b7..7e14f3e30ce 100644 --- a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md +++ b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md @@ -65,7 +65,7 @@ If none of those approvers are still appropriate, then changes to that list should be approved by the remaining approvers and/or the owning SIG (or SIG Architecture for cross-cutting KEPs). --> -# KEP-NNNN: Your short, descriptive title +# KEP-5322: DRA: Handle permanent driver allocation failures +For Dynamic Resource Allocation (DRA), the kubelet interfaces with a separate +driver component via gRPC which is responsible for attaching devices to +containers based on scheduler outcomes. When drivers indicate to the kubelet +that a failure occurred during that process, the kubelet will try again later. +This strategy enables the kubelet to overcome transient failures in drivers, but +is wasteful when the error is deterministic based on unchanged inputs. + +This KEP proposes additions to the gRPC interface between the kubelet and DRA +drivers to enable drivers to report permanent failures, and updates to the +kubelet to respond to those errors by ceasing to continuously retry invoking the +DRA driver. + ## Motivation +Several failure modes of the DRA driver's `NodePrepareResources` gRPC method are +not possible to resolve by trying again with the same input the way the kubelet +currently handles all failures: + +- The opaque `config` associated with a request in a ResourceClaim may be + invalid +- A device allocated by the scheduler may have just been found by the driver to + be unusable + +Pods with unfulfillable DRA allocations will stay stuck in a non-erroneous +pending state until manual intervention is taken to identify the cause for the +lack of progress and ultimately delete and recreate the Pod. In the meantime, +the kubelet will waste time retrying an operation that is known will fail the +same way as it did previously. Making the permanent nature of the error known as +soon as possible allows the quickest path for remediation. + ### Goals +- Minimize the amount of unnecessary work done by the kubelet and DRA drivers. +- Enable workloads to more responsively reschedule Pods in a permanent failure + state. + ### Non-Goals -### User Stories (Optional) +### User Stories -#### Story 1 +#### Efficiency + +As a cluster administrator, I want to minimize the amount of unnecessary work +done by critical components like the kubelet and DRA drivers to maximize their +availability for more important work. + +#### Visibility of Errors -#### Story 2 +As a workload administrator, I want to ensure that my workloads are able to +start up as quickly and reliably as possible by proactively rescheduling Pods +when their allocated DRA resources cannot be fulfilled. ### Notes/Constraints/Caveats (Optional) diff --git a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml index 5dfddc15e73..abe170199da 100644 --- a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml +++ b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml @@ -1,51 +1,34 @@ -title: KEP Template -kep-number: NNNN +title: "DRA: Handle permanent driver allocation failures" +kep-number: 5322 authors: - - "@jane.doe" -owning-sig: sig-xyz -participating-sigs: - - sig-aaa - - sig-bbb -status: provisional|implementable|implemented|deferred|rejected|withdrawn|replaced -creation-date: yyyy-mm-dd + - "@nojnhuh" +owning-sig: sig-node +participating-sigs: [] +status: provisional +creation-date: 2025-09-19 reviewers: - TBD - - "@alice.doe" approvers: - TBD - - "@oscar.doe" see-also: - - "/keps/sig-aaa/1234-we-heard-you-like-keps" - - "/keps/sig-bbb/2345-everyone-gets-a-kep" -replaces: - - "/keps/sig-ccc/3456-replaced-kep" + - "/keps/sig-scheduling/5055-dra-device-taints-and-tolerations" +replaces: [] -# The target maturity stage in the current dev cycle for this KEP. -# If the purpose of this KEP is to deprecate a user-visible feature -# and a Deprecated feature gates are added, they should be deprecated|disabled|removed. -stage: alpha|beta|stable +stage: alpha # The most recent milestone for which work toward delivery of this KEP has been # done. This can be the current (upcoming) milestone, if it is being actively # worked on. -latest-milestone: "v1.19" +latest-milestone: "v1.35" -# The milestone at which this feature was, or is targeted to be, at each stage. milestone: - alpha: "v1.19" - beta: "v1.20" - stable: "v1.22" + alpha: "v1.35" -# The following PRR answers are required at alpha release -# List the feature gate name and the components for which it must be enabled feature-gates: - - name: MyFeature + - name: DRAHandlePermanentDriverFailures components: - - kube-apiserver - - kube-controller-manager + - kubelet disable-supported: true -# The following PRR answers are required at beta release -metrics: - - my_feature_metric +metrics: [] From 34f83e4bdd7e31101e94dc503ab17d6a1da0dfdf Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Mon, 29 Sep 2025 16:28:56 -0500 Subject: [PATCH 03/11] fixup! Copy KEP template Fill out the rest of the doc --- .../README.md | 194 +++++++++++++++--- 1 file changed, 170 insertions(+), 24 deletions(-) diff --git a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md index 7e14f3e30ce..95e66f17b0b 100644 --- a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md +++ b/keps/sig-node/5322-dra-driver-permanent-allocation-failure/README.md @@ -10,26 +10,26 @@ updates. To get started with this template: -- [ ] **Pick a hosting SIG.** +- [X] **Pick a hosting SIG.** Make sure that the problem space is something the SIG is interested in taking up. KEPs should not be checked in without a sponsoring SIG. -- [ ] **Create an issue in kubernetes/enhancements** +- [X] **Create an issue in kubernetes/enhancements** When filing an enhancement tracking issue, please make sure to complete all fields in that template. One of the fields asks for a link to the KEP. You can leave that blank until this KEP is filed, and then go back to the enhancement and add the link. -- [ ] **Make a copy of this template directory.** +- [X] **Make a copy of this template directory.** Copy this template into the owning SIG's directory and name it `NNNN-short-descriptive-title`, where `NNNN` is the issue number (with no leading-zero padding) assigned to your enhancement above. -- [ ] **Fill out as much of the kep.yaml file as you can.** +- [X] **Fill out as much of the kep.yaml file as you can.** At minimum, you should fill in the "Title", "Authors", "Owning-sig", "Status", and date-related fields. -- [ ] **Fill out this file as best you can.** +- [X] **Fill out this file as best you can.** At minimum, you should fill in the "Summary" and "Motivation" sections. These should be easy if you've preflighted the idea of the KEP with the appropriate SIG(s). -- [ ] **Create a PR for this KEP.** +- [X] **Create a PR for this KEP.** Assign it to people in the SIG who are sponsoring this process. - [ ] **Merge early and iterate.** Avoid getting hung up on specific details and instead aim to get the goals of @@ -93,15 +93,19 @@ tags, and then generate with `hack/update-toc.sh`. - [User Stories](#user-stories) - [Efficiency](#efficiency) - [Visibility of Errors](#visibility-of-errors) - - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional) - [Risks and Mitigations](#risks-and-mitigations) - [Design Details](#design-details) + - [API](#api) + - [Kubelet Handling](#kubelet-handling) - [Test Plan](#test-plan) - [Prerequisite testing updates](#prerequisite-testing-updates) - [Unit tests](#unit-tests) - [Integration tests](#integration-tests) - [e2e tests](#e2e-tests) - [Graduation Criteria](#graduation-criteria) + - [Alpha](#alpha) + - [Beta](#beta) + - [GA](#ga) - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) - [Version Skew Strategy](#version-skew-strategy) - [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) @@ -114,7 +118,6 @@ tags, and then generate with `hack/update-toc.sh`. - [Implementation History](#implementation-history) - [Drawbacks](#drawbacks) - [Alternatives](#alternatives) -- [Infrastructure Needed (Optional)](#infrastructure-needed-optional) ## Release Signoff Checklist @@ -230,6 +233,9 @@ What is out of scope for this KEP? Listing non-goals helps to focus discussion and make progress. --> +- Automatically attempt to mitigate permanent errors, such as by deleting or + rescheduling Pods. That should be left to higher-level controllers. + ## Proposal +By retrying in all error cases, the current implementation is resilient to +transient errors. Adding a path that does not retry opens up the possibility +for miscategorized errors to cause a Pod to terminally fail even when a +subsequent attempt might allow the Pod's startup to progress. + ## Design Details +Broadly, two changes are required to enable permanent errors to skip being +retried: + +1. Allow DRA drivers to annotate errors encountered during the + `NodePrepareResources` gRPC call as being permanent. +1. Update the kubelet to skip retrying to allocate resources for a Pod when a + previous request for that Pod failed permanently. + +### API + +The kubelet's DRA gRPC interface will be updated to allow drivers to express +that an error is permanent with a new `permanent_error` field: + +```proto +message NodePrepareResourceResponse { + // These are the additional devices that kubelet must + // make available via the container runtime. A claim + // may have zero or more requests and each request + // may have zero or more devices. + repeated Device devices = 1; + // If non-empty, preparing the ResourceClaim failed. + // Devices are ignored in that case. + string error = 2; + // When true and a non-empty error is returned, indicates that the + // error is permanent. Permanent errors are expected to fail + // consistently for a given request and should not be retried. + bool permanent_error = 3; +} +``` + +### Kubelet Handling + +Once the kubelet receives a permanent error from a DRA driver for a given Pod, +it must take the appropriate action to give up on the Pod permanently. More +concretely, the kubelet will set the Pod's `status.phase` to `Failed`. The +kubelet already knows not to continue reconciling `Failed` Pods and many other +Pod controllers already handle `Failed` Pods. + ### Test Plan -[ ] I/we understand the owners of the involved components may require updates to +[X] I/we understand the owners of the involved components may require updates to existing tests to make this code solid enough prior to committing the changes necessary to implement this enhancement. @@ -339,7 +388,9 @@ This can inform certain test coverage improvements that we want to do before extending the production code to implement this enhancement. --> -- ``: `` - `` +- `k8s.io/kubernetes/pkg/kubelet`: `2025-09-29` - `72.6%` +- `k8s.io/kubernetes/pkg/kubelet/cm/dra`: `2025-09-29` - `81.7%` +- `k8s.io/kubernetes/pkg/kubelet/kuberuntime`: `2025-09-29` - `69.5%` ##### Integration tests @@ -365,7 +416,9 @@ This can be done with: - a search in the Kubernetes bug triage tool (https://storage.googleapis.com/k8s-triage/index.html) --> -- [test name](https://github.com/kubernetes/kubernetes/blob/2334b8469e1983c525c0c6382125710093a25883/test/integration/...): [integration master](https://testgrid.k8s.io/sig-release-master-blocking#integration-master?include-filter-by-regex=MyCoolFeature), [triage search](https://storage.googleapis.com/k8s-triage/index.html?test=MyCoolFeature) +These changes are focused on interactions between third-party DRA drivers and +the kubelet. Since integration tests generally focus on interactions with etcd +and the API server, integration tests for this feature will not be added. ##### e2e tests @@ -384,7 +437,12 @@ We expect no non-infra related flakes in the last month as a GA graduation crite If e2e tests are not necessary or useful, explain why. --> -- [test name](https://github.com/kubernetes/kubernetes/blob/2334b8469e1983c525c0c6382125710093a25883/test/e2e/...): [SIG ...](https://testgrid.k8s.io/sig-...?include-filter-by-regex=MyCoolFeature), [triage search](https://storage.googleapis.com/k8s-triage/index.html?test=MyCoolFeature) +E2E tests will be added to verify that Pods referencing ResourceClaims which +fail to allocate permanently transition to the `Failed` `status.phase`. + +Likewise, Pods referencing ResourceClaims which fail to allocate transiently +should remain in the `Pending` phase until the transient error is overcome and +the Pod reaches the `Running` phase. ### Graduation Criteria @@ -461,6 +519,22 @@ in back-to-back releases. - Deprecate the flag --> +#### Alpha + +- Feature implemented behind a feature flag +- Initial e2e tests completed and enabled + +#### Beta + +- Gather feedback from developers and surveys +- Additional tests are in Testgrid and linked in KEP + +#### GA + +- 3 examples of real-world usage +- Allowing time for feedback +- All issues and gaps identified as feedback during beta are resolved + ### Upgrade / Downgrade Strategy +When the kubelet is a newer version which implements this KEP and a DRA driver +is an older version whose gRPC interface does not yet include the +`permanent_error` field, the kubelet will observe that all errors coming from a +DRA driver's `NodePrepareResources` response are transient. This matches the +current behavior where the kubelet does not yet implement this KEP. + +When the inverse is true and a DRA driver responds to `NodePrepareResources` +with a permanent error to a kubelet that does not implement this KEP, then the +error will be treated as a transient error. DRA drivers therefore should expect +that identical requests may be made even when a permanent error was given in a +prior response. + ## Production Readiness Review Questionnaire -- [ ] Feature gate (also fill in values in `kep.yaml`) - - Feature gate name: +- [X] Feature gate (also fill in values in `kep.yaml`) + - Feature gate name: DRAHandlePermanentDriverFailures - Components depending on the feature gate: -- [ ] Other - - Describe the mechanism: - - Will enabling / disabling the feature require downtime of the control - plane? - - Will enabling / disabling the feature require downtime or reprovisioning - of a node? + - kubelet ###### Does enabling the feature change any default behavior? @@ -549,6 +630,8 @@ Any change of default behavior may be surprising to users or break existing automations, so be extremely careful here. --> +No + ###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)? +Yes, setting the feature gate to `false` will immediately cause all errors from +DRA drivers to be handled by the kubelet the same way as they were previously. +DRA drivers should not need to be aware of whether or not the kubelet implements +or enables this feature in order to behave in a correct way. + ###### What happens if we reenable the feature if it was previously rolled back? +When the feature is reenabled, new errors that are classified as permanent will +be handled the same way as if the feature were enabled initially. This feature +does not require any persisted state. + ###### Are there any tests for feature enablement/disablement? +This will be covered with unit tests for the kubelet. + ### Rollout, Upgrade and Rollback Planning +Will be considered for beta. + ###### How can a rollout or rollback fail? Can it impact already running workloads? +Will be considered for beta. + ###### What specific metrics should inform a rollback? +Will be considered for beta. + ###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested? +Will be considered for beta. + ###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.? +Will be considered for beta. + ### Monitoring Requirements +Will be considered for beta. + ###### How can someone using this feature know that it is working for their instance? - [ ] Events - Event Reason: @@ -653,6 +758,9 @@ Recall that end users cannot usually observe component logs or access metrics. - Other field: - [ ] Other (treat as last resort) - Details: +--> + +Will be considered for beta. ###### What are the reasonable SLOs (Service Level Objectives) for the enhancement? @@ -671,11 +779,12 @@ These goals will help you determine what you need to measure (SLIs) in the next question. --> +Will be considered for beta. + ###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service? - [ ] Metrics - Metric name: @@ -683,6 +792,9 @@ Pick one more of these and delete the rest. - Components exposing the metric: - [ ] Other (treat as last resort) - Details: +--> + +Will be considered for beta. ###### Are there any missing metrics that would be useful to have to improve observability of this feature? @@ -691,6 +803,8 @@ Describe the metrics themselves and the reasons why they weren't added (e.g., co implementation difficulties, etc.). --> +Will be considered for beta. + ### Dependencies +Will be considered for beta. + ### Scalability +Depending on the exact implementation, permanent errors will result in at most +one extra API call per Pod to PATCH pods/status. + ###### Will enabling / using this feature result in introducing new API types? +No + ###### Will enabling / using this feature result in any new calls to the cloud provider? +No + ###### Will enabling / using this feature result in increasing size or count of the existing API objects? +No + ###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? +No. Startup latency is not affected because Pods affected by this feature never +finish starting up. + ###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? +No + ###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)? +No + ### Troubleshooting +Will be considered for beta. + ###### What steps should be taken if SLOs are not being met to determine the problem? +Will be considered for beta. + ## Implementation History +- 1.35: Initial proposal and implementation + ## Drawbacks +While this feature makes it more convenient to determine when a Pod needs to be +rescheduled, it does not unlock any brand new use cases. It is already possible +for a higher-level controller to determine that a Pod taking too much time to +start up and act accordingly. The complexity of this change might outweigh the +benefits. + ## Alternatives + -# KEP-5322: DRA: Handle permanent driver allocation failures +# KEP-5322: DRA: Handle permanent driver failures E2E tests will be added to verify that Pods referencing ResourceClaims which -fail to allocate permanently transition to the `Failed` `status.phase`. +receive permanent errors from DRA drivers transition to the `Failed` `status.phase`. -Likewise, Pods referencing ResourceClaims which fail to allocate transiently +Likewise, Pods referencing ResourceClaims which cause drivers to fail transiently should remain in the `Pending` phase until the transient error is overcome and the Pod reaches the `Running` phase. diff --git a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml b/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml similarity index 91% rename from keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml rename to keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml index abe170199da..f3056ebc653 100644 --- a/keps/sig-node/5322-dra-driver-permanent-allocation-failure/kep.yaml +++ b/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml @@ -1,4 +1,4 @@ -title: "DRA: Handle permanent driver allocation failures" +title: "DRA: Handle permanent driver failures" kep-number: 5322 authors: - "@nojnhuh" From 0aa4687993789ee14db43d6c7b81c711c532e96c Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Wed, 1 Oct 2025 11:20:46 -0500 Subject: [PATCH 06/11] fixup! Copy KEP template Address Patrick's other comments --- .../sig-node/5322-dra-driver-permanent-failure/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/keps/sig-node/5322-dra-driver-permanent-failure/README.md b/keps/sig-node/5322-dra-driver-permanent-failure/README.md index b7fe512d381..bb065ab7bda 100644 --- a/keps/sig-node/5322-dra-driver-permanent-failure/README.md +++ b/keps/sig-node/5322-dra-driver-permanent-failure/README.md @@ -213,7 +213,7 @@ currently handles all failures: Pods with unfulfillable DRA allocations will stay stuck in a non-erroneous pending state until manual intervention is taken to identify the cause for the lack of progress and ultimately delete and recreate the Pod. In the meantime, -the kubelet will waste time retrying an operation that is known will fail the +the kubelet will waste time retrying an operation that is known to fail the same way as it did previously. Making the permanent nature of the error known as soon as possible allows the quickest path for remediation. @@ -367,12 +367,13 @@ expected to fail again the same way. When [device taints and tolerations](https://kep.k8s.io/5055) are available, DRA drivers should consider adding a taint for the device with the `NoSchedule` effect if it determines other requests for that device are also likely to fail. -When a permanent error is caused by invalid configuration in the ResourceClaim's -request and not by a faulty device, drivers may not taint the device if another -request for the same device with different parameters is expected to succeed. When device taints are not available, DRA drivers may instead consider removing a device from the ResourceSlice to remove it from the pool. +When a permanent error is caused by invalid configuration in the ResourceClaim's +request and not by a faulty device, drivers should not taint the device if another +request for the same device with different parameters is expected to succeed. + ### Diagnosing Permanent Errors The kubelet already logs errors returned from DRA drivers' From 14338168b6d67f96808436d35a4f3e798da6f5a1 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Sat, 4 Oct 2025 00:55:06 -0500 Subject: [PATCH 07/11] fixup! Copy KEP template Add PRR YAML --- keps/prod-readiness/sig-node/5322.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 keps/prod-readiness/sig-node/5322.yaml diff --git a/keps/prod-readiness/sig-node/5322.yaml b/keps/prod-readiness/sig-node/5322.yaml new file mode 100644 index 00000000000..23866f15cde --- /dev/null +++ b/keps/prod-readiness/sig-node/5322.yaml @@ -0,0 +1,5 @@ +kep-number: 5322 +alpha: + approver: "@jpbetz" +beta: + approver: "@jpbetz" From 66bb7717e7cf177c8960b617e86a7d62ab3d45aa Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Fri, 10 Oct 2025 13:27:25 -0500 Subject: [PATCH 08/11] fixup! Copy KEP template Remove beta PRR approver --- keps/prod-readiness/sig-node/5322.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/keps/prod-readiness/sig-node/5322.yaml b/keps/prod-readiness/sig-node/5322.yaml index 23866f15cde..2a00193b513 100644 --- a/keps/prod-readiness/sig-node/5322.yaml +++ b/keps/prod-readiness/sig-node/5322.yaml @@ -1,5 +1,3 @@ kep-number: 5322 alpha: approver: "@jpbetz" -beta: - approver: "@jpbetz" From 80d86ce1f72551137f2c640516758aec61430e8d Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Mon, 13 Oct 2025 15:04:23 -0500 Subject: [PATCH 09/11] fixup! Copy KEP template Update kep.yaml --- keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml b/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml index f3056ebc653..fb641786591 100644 --- a/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml +++ b/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml @@ -4,10 +4,11 @@ authors: - "@nojnhuh" owning-sig: sig-node participating-sigs: [] -status: provisional +status: implementable creation-date: 2025-09-19 reviewers: - - TBD + - "@pohly" + - "@SergeyKanzhelev" approvers: - TBD From 36e43465909173d71d4d2bfa7edc39fb174d317c Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Tue, 14 Oct 2025 11:29:24 -0500 Subject: [PATCH 10/11] fixup! Copy KEP template Add @mrunalp as an approver --- keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml b/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml index fb641786591..466a00d3b59 100644 --- a/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml +++ b/keps/sig-node/5322-dra-driver-permanent-failure/kep.yaml @@ -10,7 +10,7 @@ reviewers: - "@pohly" - "@SergeyKanzhelev" approvers: - - TBD + - "@mrunalp" see-also: - "/keps/sig-scheduling/5055-dra-device-taints-and-tolerations" From 1806f5d3eea59beac8d0a5a8d088706d3c3d37d4 Mon Sep 17 00:00:00 2001 From: Jon Huhn Date: Tue, 14 Oct 2025 11:29:47 -0500 Subject: [PATCH 11/11] fixup! Copy KEP template `bool permanent_error` -> `error_type` enum --- .../README.md | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/keps/sig-node/5322-dra-driver-permanent-failure/README.md b/keps/sig-node/5322-dra-driver-permanent-failure/README.md index bb065ab7bda..78baf143ed9 100644 --- a/keps/sig-node/5322-dra-driver-permanent-failure/README.md +++ b/keps/sig-node/5322-dra-driver-permanent-failure/README.md @@ -317,8 +317,8 @@ retried: ### API -The kubelet's DRA gRPC interface will be updated to allow drivers to express -that an error is permanent with a new `permanent_error` field: +The kubelet's DRA gRPC interface will be updated to allow drivers to +classify errors with a new `error_type` field: ```proto message NodePrepareResourceResponse { @@ -330,10 +330,17 @@ message NodePrepareResourceResponse { // If non-empty, preparing the ResourceClaim failed. // Devices are ignored in that case. string error = 2; - // When true and a non-empty error is returned, indicates that the - // error is permanent. Permanent errors are expected to fail - // consistently for a given request and should not be retried. - bool permanent_error = 3; + // When a non-empty error is returned, indicates the + // type of error that occurred. + NodePrepareResourceResponseErrorType error_type = 3; +} + +enum NodePrepareResourceResponseErrorType { + // Unknown errors are unclassified. + Unknown = 0; + // Permanent errors are expected to fail consistently + // for a given request and should not be retried. + Permanent = 1; } ``` @@ -613,7 +620,7 @@ enhancement: When the kubelet is a newer version which implements this KEP and a DRA driver is an older version whose gRPC interface does not yet include the -`permanent_error` field, the kubelet will observe that all errors coming from a +`error_type` field, the kubelet will observe that all errors coming from a DRA driver's `NodePrepareResources` response are transient. This matches the current behavior where the kubelet does not yet implement this KEP.