Skip to content

Commit 9b475dc

Browse files
authored
Merge pull request kubernetes#3338 from sanposhiho/beta
[KEP-3022] Write the production readiness requirements to graduate to beta
2 parents bf60847 + 2c50304 commit 9b475dc

File tree

3 files changed

+138
-17
lines changed

3 files changed

+138
-17
lines changed

keps/prod-readiness/sig-scheduling/3022.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
kep-number: 3022
55
alpha:
66
approver: "@wojtek-t"
7+
beta:
8+
approver: "@johnbelamaric"

keps/sig-scheduling/3022-min-domains-in-pod-topology-spread/README.md

Lines changed: 134 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# KEP-3022: min domains in Pod Topology Spread
22

33
<!-- toc -->
4-
54
- [Release Signoff Checklist](#release-signoff-checklist)
65
- [Summary](#summary)
76
- [Motivation](#motivation)
@@ -14,6 +13,10 @@
1413
- [Implementation details](#implementation-details)
1514
- [How user stories are addressed](#how-user-stories-are-addressed)
1615
- [Test Plan](#test-plan)
16+
- [Prerequisite testing updates](#prerequisite-testing-updates)
17+
- [Unit tests](#unit-tests)
18+
- [Integration tests](#integration-tests)
19+
- [e2e tests](#e2e-tests)
1720
- [Graduation Criteria](#graduation-criteria)
1821
- [Alpha (v1.24):](#alpha-v124)
1922
- [Beta (v1.25):](#beta-v125)
@@ -198,6 +201,13 @@ With the flow, this deployment will be spread over at least 5 Nodes while protec
198201

199202
### Test Plan
200203

204+
205+
[x] I/we understand the owners of the involved components may require updates to
206+
existing tests to make this code solid enough prior to committing the changes necessary
207+
to implement this enhancement.
208+
209+
##### Prerequisite testing updates
210+
201211
To ensure this feature to be rolled out in high quality. Following tests are mandatory:
202212

203213
- **Unit Tests**: All core changes must be covered by unit tests.
@@ -207,6 +217,59 @@ To ensure this feature to be rolled out in high quality. Following tests are man
207217
using this feature, but it shouldn't impose penalty to users who are not using
208218
this feature. We will verify it by designing some benchmark tests.
209219

220+
##### Unit tests
221+
222+
<!--
223+
In principle every added code should have complete unit test coverage, so providing
224+
the exact set of tests will not bring additional value.
225+
However, if complete unit test coverage is not possible, explain the reason of it
226+
together with explanation why this is acceptable.
227+
-->
228+
229+
<!--
230+
Additionally, for Alpha try to enumerate the core package you will be touching
231+
to implement this enhancement and provide the current unit coverage for those
232+
in the form of:
233+
- <package>: <date> - <current test coverage>
234+
The data can be easily read from:
235+
https://testgrid.k8s.io/sig-testing-canaries#ci-kubernetes-coverage-unit
236+
This can inform certain test coverage improvements that we want to do before
237+
extending the production code to implement this enhancement.
238+
-->
239+
240+
- `k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread`: `2022-06-17` - `86%`
241+
- `k8s.io/kubernetes/pkg/api/pod`: `2022-06-17` - `66.7%`
242+
- `k8s.io/kubernetes/pkg/apis/core/validation`: `2022-06-17` - `82.1%`
243+
244+
##### Integration tests
245+
246+
<!--
247+
This question should be filled when targeting a release.
248+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
249+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
250+
https://storage.googleapis.com/k8s-triage/index.html
251+
-->
252+
253+
test: https://github.com/kubernetes/kubernetes/blob/19c8a2127177b43effb9bfe1de272d6f08ea56e8/test/integration/scheduler/filters/filters_test.go#L1060
254+
k8s-triage: https://storage.googleapis.com/k8s-triage/index.html?sig=scheduling&test=TestPodTopologySpreadFilter
255+
256+
##### e2e tests
257+
258+
<!--
259+
This question should be filled when targeting a release.
260+
For Alpha, describe what tests will be added to ensure proper quality of the enhancement.
261+
For Beta and GA, add links to added tests together with links to k8s-triage for those tests:
262+
https://storage.googleapis.com/k8s-triage/index.html
263+
We expect no non-infra related flakes in the last month as a GA graduation criteria.
264+
-->
265+
266+
N/A
267+
268+
--
269+
270+
This feature doesn't introduce any new API endpoints and doesn't interact with other components.
271+
So, E2E tests doesn't add extra value to integration tests.
272+
210273
### Graduation Criteria
211274

212275
#### Alpha (v1.24):
@@ -292,13 +355,23 @@ rollout. Similarly, consider large clusters and how enablement/disablement
292355
will rollout across nodes.
293356
-->
294357

358+
It shouldn't impact already running workloads. It's an opt-in feature,
359+
and users need to set `pod.spec.topologySpreadConstraints.minDomains` field to use this feature.
360+
361+
When this feature is disabled by the feature flag, the already created Pod's `pod.spec.topologySpreadConstraints.minDomains` field is preserved,
362+
but, the newly created Pod's `pod.spec.topologySpreadConstraints.minDomains` field is silently dropped.
363+
364+
295365
###### What specific metrics should inform a rollback?
296366

297367
<!--
298368
What signals should users be paying attention to when the feature is young
299369
that might indicate a serious problem?
300370
-->
301371

372+
- A spike on metric `schedule_attempts_total{result="error|unschedulable"}` when pods using this feature are added.
373+
- A spike on metric `plugin_execution_duration_seconds{plugin="PodTopologySpread"}` or `scheduling_algorithm_duration_seconds` when pods using this feature are added.
374+
302375
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
303376

304377
<!--
@@ -307,12 +380,35 @@ Longer term, we may want to require automated upgrade/rollback tests, but we
307380
are missing a bunch of machinery and tooling and can't do that now.
308381
-->
309382

383+
Yes. The behavior is changed as expected.
384+
385+
Test scenario:
386+
1. start kube-apiserver v1.24 where `MinDomains` feature is disabled.
387+
2. create three nodes and pods spread across nodes as 2/2/1
388+
3. create new Pod that has a TopologySpreadConstraints: maxSkew is 1, topologyKey is `kubernetes.io/hostname`, and minDomains is 4 (larger than the number of domains (= 3)).
389+
4. the Pod created in (3) is scheduled because `MinDomain` is disabled.
390+
5. delete the Pod created in (3).
391+
6. recreate kube-apiserver v1.25 where `MinDomains` feature is enabled.
392+
7. create the same Pod as (3).
393+
8. the Pod created in (7) isn't scheduled because `MinDomain` is enabled and minDomains is larger than the number of domains (= 3)).
394+
9. delete the Pod created in (7).
395+
10. recreate kube-apiserver v1.24 where `MinDomains` feature is disabled.
396+
11. create the same Pod as (3).
397+
12. the Pod created in (11) is scheduled because `MinDomain` is disabled.
398+
13. delete the Pod created in (11).
399+
14. recreate kube-apiserver v1.25 where `MinDomains` feature is enabled.
400+
15. create the same Pod as (3).
401+
16. the Pod created in (15) isn't scheduled because `MinDomain` is enabled and minDomains is larger than the number of domains (= 3)).
402+
17. delete the Pod created in (15).
403+
310404
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
311405

312406
<!--
313407
Even if applying deprecation policies, they may still surprise some users.
314408
-->
315409

410+
No.
411+
316412
### Monitoring Requirements
317413

318414
<!--
@@ -327,6 +423,8 @@ checking if there are objects with field X set) may be a last resort. Avoid
327423
logs or events for this purpose.
328424
-->
329425

426+
The operator can query pods with `pod.spec.topologySpreadConstraints.minDomains` field set.
427+
330428
###### How can someone using this feature know that it is working for their instance?
331429

332430
<!--
@@ -338,13 +436,13 @@ and operation of this feature.
338436
Recall that end users cannot usually observe component logs or access metrics.
339437
-->
340438

341-
- [ ] Events
342-
- Event Reason:
343-
- [ ] API .status
344-
- Condition name:
345-
- Other field:
346-
- [ ] Other (treat as last resort)
347-
- Details:
439+
- [x] Other (treat as last resort)
440+
- Details:
441+
The feature MinDomains in Pod Topology Sprad plugin doesn't cause any logs, any events, any pod status updates.
442+
If a Pod using `pod.spec.topologySpreadConstraints.minDomains` was successfully assigned a Node,
443+
nodeName will be updated.
444+
And if not, `PodScheduled` condition will be false and an event will be recorded with a detailed message
445+
describing the reason including the failed filters. (Pod Topology Spread plugin could be one of them.)
348446

349447
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
350448

@@ -363,18 +461,18 @@ These goals will help you determine what you need to measure (SLIs) in the next
363461
question.
364462
-->
365463

464+
- Metric `plugin_execution_duration_seconds{plugin="PodTopologySpread"}` <= 100ms on 90-percentile.
465+
366466
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
367467

368468
<!--
369469
Pick one more of these and delete the rest.
370470
-->
371471

372-
- [ ] Metrics
373-
- Metric name:
374-
- [Optional] Aggregation method:
375-
- Components exposing the metric:
376-
- [ ] Other (treat as last resort)
377-
- Details:
472+
- [x] Metrics
473+
- Component exposing the metric: kube-scheduler
474+
- Metric name: `plugin_execution_duration_seconds{plugin="PodTopologySpread"}`
475+
- Metric name: `schedule_attempts_total{result="error|unschedulable"}`
378476

379477
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
380478

@@ -383,6 +481,10 @@ Describe the metrics themselves and the reasons why they weren't added (e.g., co
383481
implementation difficulties, etc.).
384482
-->
385483

484+
Yes. It would be useful if we could see which filter plugin affected Pod's scheduling results in metrics.
485+
486+
Issue: https://github.com/kubernetes/kubernetes/issues/110643
487+
386488
### Dependencies
387489

388490
<!--
@@ -406,6 +508,8 @@ and creating new ones, as well as about cluster-level services (e.g. DNS):
406508
- Impact of its degraded performance or high-error rates on the feature:
407509
-->
408510

511+
No.
512+
409513
### Scalability
410514

411515
###### Will enabling / using this feature result in any new API calls?
@@ -466,8 +570,13 @@ details). For now, we leave it here.
466570

467571
###### How does this feature react if the API server and/or etcd is unavailable?
468572

573+
The feature isn't affected because Pod Topology Spread plugin doesn't communicate with kube-apiserver or etcd
574+
during Filter phase.
575+
469576
###### What are other known failure modes?
470577

578+
N/A
579+
471580
<!--
472581
For each of them, fill in the following information by copying the below template:
473582
- [Failure mode brief description]
@@ -483,6 +592,12 @@ For each of them, fill in the following information by copying the below templat
483592

484593
###### What steps should be taken if SLOs are not being met to determine the problem?
485594

595+
- Check `plugin_execution_duration_seconds{plugin="PodTopologySpread"}` to see if latency increased.
596+
- In this case, the metrics showes literally the feature is slow.
597+
- You should stop using `MinDomains` in your Pods and may need to disable `MinDomains` feature by feature flag `MinDomainsInPodTopologySpread`.
598+
- Check `schedule_attempts_total{result="error|unschedulable"}` to see if the number of attempts increased.
599+
- In this case, your use of `MinDomains` may be incorrect or not appropriate for your cluster.
600+
486601
## Implementation History
487602

488603
<!--
@@ -496,6 +611,11 @@ Major milestones might include:
496611
- when the KEP was retired or superseded
497612
-->
498613

614+
- 2021-11-02: Initial KEP sent for review
615+
- 2022-01-14: Initial KEP is merged.
616+
- 2022-03-16: The implementation PRs are merged.
617+
- 2022-05-03: The MinDomain feature is released as alpha feature with Kubernetes v1.24 release.
618+
499619
## Drawbacks
500620

501621
<!--

keps/sig-scheduling/3022-min-domains-in-pod-topology-spread/kep.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ reviewers:
1414
approvers:
1515
- "@alculquicondor"
1616
- "@Huang-Wei"
17-
stage: alpha
18-
latest-milestone: "v1.24"
17+
stage: beta
18+
latest-milestone: "v1.25"
1919
milestone:
2020
alpha: "v1.24"
2121
beta: "v1.25"
22-
stable: "v1.26"
2322
disable-supported: true
2423
feature-gates:
2524
- name: MinDomainsInPodTopologySpread

0 commit comments

Comments
 (0)