Skip to content

Commit

Permalink
Specify semantics of SelectorSpreadingPriority
Browse files Browse the repository at this point in the history
Signed-off-by: Aldo Culquicondor <acondor@google.com>
  • Loading branch information
alculquicondor committed Oct 7, 2019
1 parent 4d55c62 commit 18a12eb
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions keps/sig-scheduling/20190926-default-even-pod-spreading.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,22 @@ may not be the intention of an operator. On the other hand, a proper Default for
could provide the same priority as `SelectorSpreadingPriority`. Thus, there's no need for the
features to co-exist.

Give that we guard Default `topologySpreadConstraints` behind a feature flag,
these would be its semantics:

- If the feature is enabled, `SelectorSpreadingPriority` is removed from the default set of priorities.
K8s provides the Default `topologySpreadConstraints` that matches the priority given by
`SelectorSpreading` if the cluster operator doesn't specify one.
- If the cluster operator provides a Policy that includes `SelectorSpreadingPriority` and
`EvenPodsSpreadPriority`, K8s provides an empty Default `topologySpreadConstraints`.
The cluster operator can still specify Default `topologySpreadConstraints`,
in which case both priorities run.
K8s will set Default `topologySpreadConstraints` and remove `SelectorSpreadingPriority`
from the k8s providers (`DefaultProvider` and `ClusterAutoscalerProvider`). The set
[default](#default-rules) will have a similar effect.

If an operator sets a Policy, these are the semantics of the presence of `SelectorSpreadingPriority`
and/or `EvenPodsSpreadPriority`:

| SelectorSpreading | EvenPodsSpread | Valid | Pod spread constraints |
| :---------------: | :------------: | :---: | :---------------------------------------: |
| [ ] | [x] | Yes | provided or [k8s default](#default-rules) |
| [x] | [x] | Yes | provided or [k8s default](#default-rules) |
| [ ] | [ ] | Yes | None |
| [x] | [ ] | No | - |

Selecting `SelectorSpreadingPriority` but not `EvenPodsSpreadPriority` in a policy is an invalid
configuration, because the latter is a requirement for the former.

### Risks and Mitigations

Expand Down

0 comments on commit 18a12eb

Please sign in to comment.