diff --git a/docs/enhancements/312-add-flavorAssignmentStrategy-to-localQueue/README.md b/docs/enhancements/312-add-flavorAssignmentStrategy-to-localQueue/README.md new file mode 100644 index 0000000000..548ceb5a6c --- /dev/null +++ b/docs/enhancements/312-add-flavorAssignmentStrategy-to-localQueue/README.md @@ -0,0 +1,817 @@ + +# KEP-312: Add flavorAssignmentStrategy to localQueue + + + + + + +- [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 for 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) +- [ ] (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 + + + +To better representing the priorities of different flavors under each resource, we'd like to add a new field `priority` for each flavor. + +What's more, when finding satisfied flavors in scheduling, we'll iterate the flavors defined in a golang slice struct in sequence to +find the satisfied ones, this is too primitive so we'd like to support more assigning strategies to meet more scenarios. + +## Motivation + + + +Currently, for flavors under one resource, the indexes of these flavors implicitly represents the flavor priorities. This is not descriptive enough, +like we want to add two flavors with the same priority, this is helpful when we want to apply more assigning policies, like minimum borrowing from +shared clusterQueues with same priority flavors. So we'd like to add a new field `Priority` to `Flavor`. + +As we described in the above section, when finding satisfied flavors, we follow the semantic in-order strategy by iterating the flavors, and we'll +borrow resources whenever we're insufficient of specified resources. This is a simple way but can't meet various scenarios. E.g. we want to borrow +minimum resources from other co-sharing clusterQueues to mitigate the disruptions once preemption is supported. Another case is when borrowing, we'd +like to keep the resource balance within each clusterQueue, or the corresponding pods will stuck in pending for exhausted of several special resources. + +To achieve this, we'll introduce a new field `FlavorAssignmentStrategy` to `LocalQueue`, and we'll implement multiple strategies. + +### Goals + + +- Introduce a new filed `Priority` to `Flavor` +- Introduce a new field `FlavorAssignmentStrategy` to `LocalQueue` +- Support semantic "minimum borrowing" as the default assignment strategy + +### Non-Goals + + +- Support other assignment strategies, like balanced borrowing. + +## Proposal + + + +### User Stories (Optional) + + + +#### Story 1 + +When scheduling with multiple flavors, like Spot ones and On-Demand ones, +I prefer to assign with the Spot ones first for cost consideration. + +#### Story 2 + +We have some critical workloads running in cluster, so I hope them can borrow as less as better +resources when scheduling, in case preempted by other clusterQueue's workloads. + +### Notes/Constraints/Caveats (Optional) + +Whether we should also introduce a plugin framework similar to kube scheduler in cases we want to apply several strategies concurrently, +for example, when applying minimum borrowing strategy, we would also like to keep the resource balance in each clusterQueue. + + + +### 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 + + + +- : + +##### e2e tests + + + +- : + +### 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? (Do not assume `Dynamic Kubelet Config` feature is enabled). + +###### 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? + + + +### 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/docs/enhancements/312-add-flavorAssignmentStrategy-to-localQueue/kep.yaml b/docs/enhancements/312-add-flavorAssignmentStrategy-to-localQueue/kep.yaml new file mode 100644 index 0000000000..d32ad180f0 --- /dev/null +++ b/docs/enhancements/312-add-flavorAssignmentStrategy-to-localQueue/kep.yaml @@ -0,0 +1,22 @@ +title: Add flavorAssignmentStrategy to localQueue +kep-number: 312 +authors: + - "@kerthcet" +status: implementable +creation-date: 2022-09-07 +reviewers: + - "@ahg-g" + - "@alculquicondor" +approvers: + - "@ahg-g" + - "@alculquicondor" + +##### WARNING !!! ###### +# prr-approvers has been moved to its own location +# You should create your own in keps/prod-readiness +# Please make a copy of keps/prod-readiness/template/nnnn.yaml +# to keps/prod-readiness/sig-xxxxx/00000.yaml (replace with kep number) +#prr-approvers: + +# The target maturity stage in the current dev cycle for this KEP. +stage: alpha \ No newline at end of file