Markdown Editor

Enhancement Proposal (KEP) Template

Kubernetes KEP: release signoff checklist, summary, motivation, proposal, design, test plan, graduation, version skew, PRR questionnaire, history

软件与工程完整Kubernetes KEP template (kubernetes/enhancements, 2026)Apache-2.0kep

使用方法: Use it for a Kubernetes enhancement or any feature that ships behind flags across versioned releases. Fill Summary and Motivation first and get them merged, then Design Details and the Production Readiness Review answers needed for the target stage. The main pitfall is beta criteria phrased as rollout percentages: beta must already include all functional, security, monitoring and testing requirements.

预览

KEP-NNNN: [Short, descriptive enhancement title]

Kubernetes Enhancement Proposal (KEP). The section order and the Production Readiness Review questions follow the current template in the kubernetes/enhancements repository (keps/NNNN-kep-template/README.md and kep.yaml, checked October 2026), with original guidance, a metadata table and worked examples added. Use it for changes to Kubernetes itself, or as a rigorous proposal format for any project that ships features behind flags across versioned releases. Replace every [bracketed] value and every row marked Example. Worked examples use a fictional feature gate, ExampleDrainHints, that lets a Pod declare how long it needs to finish in-flight work before a node drain evicts it.

Document control

FieldValue
KEP number[NNNN] (the enhancement issue number)
Title[Short, descriptive title]
Owning SIG[sig-xyz] (Example: sig-node)
Participating SIGs[sig-aaa, sig-bbb] (Example: sig-apps, sig-scheduling)
Status[provisional / implementable / implemented / deferred / rejected / withdrawn / replaced]
Authors[@author]
Reviewers[@reviewer-1], [@reviewer-2]
Approvers[@sig-approver]
PRR approver[@prod-readiness-approver]
Creation dateYYYY-MM-DD
Last updatedYYYY-MM-DD
Stage (target this cycle)[alpha / beta / stable]
Latest milestone[v1.xx]
Milestonesalpha [v1.xx], beta [v1.yy], stable [v1.zz]
Feature gate(s) and components[Example: ExampleDrainHints: kube-apiserver, kubelet]
Disable supported[true / false]
See also / replaces[/keps/sig-aaa/1234-related-kep]

The same metadata in kep.yaml form:

title: "[Short, descriptive title]"
kep-number: NNNN
authors:
  - "@author"
owning-sig: sig-xyz
participating-sigs:
  - sig-aaa
status: provisional
creation-date: YYYY-MM-DD
reviewers:
  - "@reviewer-1"
approvers:
  - "@sig-approver"
see-also: []
replaces: []
stage: alpha
latest-milestone: "v1.xx"
milestone:
  alpha: "v1.xx"
  beta: "v1.yy"
  stable: "v1.zz"
feature-gates:
  - name: ExampleDrainHints
    components:
      - kube-apiserver
      - kubelet
disable-supported: true
metrics:
  - example_drain_hint_wait_seconds

Revision history

VersionDateAuthorChange
0.1 (Example)YYYY-MM-DD[@author]Summary and Motivation merged as provisional
0.2 (Example)YYYY-MM-DD[@author]Proposal, Design Details and PRR answers for alpha; status implementable
[x.y]YYYY-MM-DD[@name][Change summary]

Contents

  • Release Signoff Checklist
  • Summary
  • Motivation (Goals, Non-Goals)
  • Proposal (User Stories, Notes/Constraints/Caveats, Risks and Mitigations)
  • Design Details (Test Plan, Graduation Criteria, Upgrade / Downgrade Strategy, Version Skew Strategy)
  • Production Readiness Review Questionnaire
  • Implementation History
  • Drawbacks
  • Alternatives
  • Infrastructure Needed (Optional)
  • Glossary and references
  • Standard and licence note

Release Signoff Checklist

  • (R) Enhancement issue in the release milestone, linking to the KEP directory in kubernetes/enhancements (not to the first KEP pull request)
  • (R) KEP approvers have approved the KEP status as implementable
  • (R) Design details are documented
  • (R) Test plan is in place, taking SIG Architecture and SIG Testing input into account
    • e2e tests for all beta API operations (endpoints)
    • (R) GA e2e tests meet the conformance test requirements
    • (R) A window of at least two weeks shows the GA e2e tests are free of flakes
  • (R) Graduation criteria are in place
    • (R) All GA endpoints are hit by conformance tests within one minor version of promotion to GA
  • (R) Production readiness review completed
  • (R) Production readiness review approved
  • Implementation History is up to date for this milestone
  • User-facing documentation is written in kubernetes/website for publication on kubernetes.io
  • Supporting documentation (extra design documents, links to mailing list or SIG meeting discussions, related pull requests and issues, release notes) is linked

Summary

[One paragraph: what changes for users and operators, and why it matters. Avoid implementation detail.]

Example: This KEP adds an optional field that lets a Pod declare a drain hint: the time it needs to finish in-flight work once its node is cordoned for maintenance. The kubelet reports the hint, and eviction tooling can wait for it before evicting, within the limits set by the cluster operator. Today workloads such as queue consumers lose in-flight work or rely on long termination grace periods that also slow ordinary deletes.

Motivation

[Describe the problem, who has it, how often, and what they do today. Link the evidence.]

Example: Issues filed by operators of batch and streaming workloads show that node maintenance interrupts long-running message handlers. The workaround, a long terminationGracePeriodSeconds, delays every Pod deletion, not only drains, and does not tell drain tools how long to wait.

Goals

List what the KEP will achieve and how you will know it succeeded.

IDGoalSuccess signal
G-01 (Example)Pods can declare a drain hint without changing their termination grace periodField accepted by the API server and visible in Pod status
G-02 (Example)Drain tooling can read the hint and wait, bounded by an operator limitkubectl drain honours the hint in e2e tests
[G-nn][Goal][Signal]

Non-Goals

List what is out of scope, so that reviews stay focused.

  • Example: Changing how terminationGracePeriodSeconds works for ordinary deletes.
  • Example: Coordinating drains across nodes (left to cluster autoscalers and external tools).
  • [Non-goal]

Proposal

[Describe the proposal in plain language: the new behaviour, who uses it and how it is switched on.]

Example: Add an optional drainHint duration to the Pod spec, guarded by the ExampleDrainHints feature gate. When the gate is on, kubelet copies the hint into Pod status once its node is cordoned. kubectl drain gains a flag that waits up to the lower of the hint and an operator maximum before evicting.

User Stories (Optional)

Describe what people will be able to do once the KEP is implemented, concretely enough that readers can picture it.

Story 1

Example: As an operator of a queue consumer, I set a drain hint of 90 seconds so that a node drain lets my Pod finish the current batch before eviction, while normal deletes stay fast.

Story 2

Example: As a cluster administrator, I cap all drain hints at 5 minutes so that a misconfigured workload cannot block maintenance for hours.

Notes/Constraints/Caveats (Optional)

Record details that did not fit above and that readers must know: core concepts, interactions with other features, and edge cases.

  • Example: The hint is advisory. PodDisruptionBudgets still apply and take precedence.
  • [Caveat]

Risks and Mitigations

Think broadly, including security, user experience and the wider ecosystem. Say how security and UX will be reviewed, and by whom; include reviewers outside the SIG where useful.

IDRiskMitigationReviewer
RSK-01 (Example)A large hint blocks node maintenanceOperator maximum enforced by drain tooling; default maximum documented[@sig-node-reviewer]
RSK-02 (Example)Users confuse the hint with the termination grace periodField documentation and a warning when the hint exceeds the grace period[@sig-docs-reviewer]
[RSK-nn][Risk][Mitigation][@name]

Design Details

[Describe the API changes, validation rules, component behaviour and data flow.]

Example: PodSpec.drainHint is an optional duration in seconds, validated as 0 to 3600. When the feature gate is off, the API server drops the field on create and keeps it on update if it is already set, so that disabling the gate does not destroy stored data.

Test Plan

  • I/we understand that the owners of the involved components may require updates to existing tests before this enhancement can be implemented.
Prerequisite testing updates

List tests that reviewers asked for before implementation starts, so that the change rests on a solid base.

Unit tests

Every added line of code should have unit test coverage; if full coverage is not possible, explain why that is acceptable. For alpha, list the core packages touched and their current coverage.

PackageDateCoverage
pkg/kubelet/... (Example)YYYY-MM-DD[nn.n%]
[<package>]YYYY-MM-DD[nn.n%]
Integration tests

Integration tests can start components with non-default and conflicting options, which e2e tests cannot. List each test with a link to its job and a triage search, or explain why none are needed.

  • [Example: test/integration/pods: drain hint dropped when gate disabled on create, kept on update]
e2e tests

List each e2e test with a link to its periodic job and a triage search. As a GA criterion, expect no flakes other than infrastructure flakes in the last month. If e2e tests are not useful, explain why.

  • [Example: [sig-node] Drain hints should delay eviction up to the hint: link to job, link to triage search]

Graduation Criteria

Stage meanings used in this KEP (from the Kubernetes feature gate and API versioning documentation):

StageFeature gate defaultWhat it means
AlphaOffMay be buggy and may change or be dropped without notice; for short-lived test clusters
BetaUsually on (built-in beta API versions stay off by default, except beta APIs introduced before v1.22)Well tested and considered safe to enable; details may still change
GA (stable)Always on, cannot be disabledThe gate is locked on and removed in a later release
Alpha
  • Feature implemented behind the [FeatureGateName] feature gate, off by default
  • Initial e2e tests completed and enabled
  • PRR sections "Feature Enablement and Rollback" answered and approved
  • [Other alpha criteria]
Beta

Beta must include every functional, security, monitoring and testing requirement. GA may not add new ones.

  • All functionality completed, including features [A, B, C]
  • All security enforcement completed
  • All monitoring requirements completed (metrics in kep.yaml exist and are documented)
  • All testing requirements completed, including downgrade and scalability tests where relevant
  • Additional tests are in Testgrid and linked in this KEP
  • All known pre-release issues and gaps resolved
  • Feedback gathered from developers and users, for example through surveys
  • PRR sections for beta answered and approved
GA
  • [N] examples of real-world usage and [N] installs (Example: three production users reporting through the SIG)
  • Time allowed for feedback: generally at least two releases between beta and GA
  • All issues and gaps raised as feedback during beta resolved
  • For a non-optional feature: conformance tests added
  • Feature gate locked on; removal planned per the deprecation policy
Deprecation

Fill this only when the KEP deprecates or replaces something.

  • Deprecation and support policy of the existing flag or API announced
  • Two versions passed since the replacing functionality was introduced (to cover version skew)
  • Feedback on usage and changed behaviour addressed
  • Flag or API deprecated, then removed per the Kubernetes deprecation policy

Upgrade / Downgrade Strategy

[What existing clusters must change, if anything, on upgrade and on downgrade.]

Example: No change is needed to keep current behaviour: the field is optional and the gate is off in alpha. To use the feature, enable the gate on kube-apiserver and kubelet and set the field. On downgrade to a release without the field, stored values are ignored and drains behave as before.

Version Skew Strategy

Answer each question, and add the cases to the test plan.

  • Does the enhancement coordinate behaviour between the control plane and nodes?
  • How does a kubelet or kube-proxy up to three minor versions older, without the feature, behave when it is used?
  • How does a kube-controller-manager or kube-scheduler one minor version older, without the feature, behave when it is used?
  • Do other node components (CSI, CRI, CNI) need an update before the kubelet?

Example: An older kubelet ignores the field and does not copy it into status, so drain tooling sees no hint and evicts as today. The behaviour degrades to the current one, never to a failure.

Production Readiness Review Questionnaire

PRR sectionRequired when targeting
Feature Enablement and RollbackAlpha
Rollout, Upgrade and Rollback PlanningBeta
Monitoring RequirementsBeta (confirmed with field experience at GA)
DependenciesBeta
ScalabilityEncouraged at alpha, required at beta, confirmed at GA
TroubleshootingBeta (confirmed at GA)

Feature Enablement and Rollback

How can this feature be enabled or disabled in a live cluster?

  • Feature gate (also fill in kep.yaml)
    • Feature gate name: [Example: ExampleDrainHints]
    • Components depending on the gate: [Example: kube-apiserver, kubelet]
  • Other
    • Mechanism: [describe]
    • Does enabling or disabling require control plane downtime? [yes / no]
    • Does enabling or disabling require node downtime or reprovisioning? [yes / no]

Does enabling the feature change any default behaviour? Any change of default behaviour can break existing automation. [Answer]

Can the feature be disabled after it has been enabled (rollback)? Describe the effect on running workloads. Set disable-supported in kep.yaml. [Example: Yes. Set the gate to false and restart the components; stored hints are kept but ignored.]

What happens if the feature is re-enabled after a rollback? [Answer]

Are there tests for enabling and disabling the feature? Unit tests should cover data written with and without the feature, and switching the gate off after objects with the new field exist. [Answer with links]

Rollout, Upgrade and Rollback Planning

How can a rollout or rollback fail, and can it affect running workloads? Consider components restarting mid-rollout and highly available clusters where some API servers have the gate on and others off. [Answer]

Which metrics should trigger a rollback? [Example: a rise in example_drain_hint_wait_seconds above the operator maximum, or eviction errors during drains]

Were upgrade and rollback tested, including upgrade, then downgrade, then upgrade? Describe the manual testing and its results. [Answer]

Does the rollout come with deprecations or removals of features, APIs, fields, flags or other items? [Answer]

Monitoring Requirements

How can an operator tell whether workloads use the feature? Prefer a metric; querying API objects is a last resort; avoid logs and events for this. [Answer]

How can a user of the feature see that it works for their instance? End users usually cannot see component logs or metrics.

  • Events (reason: [name])
  • API .status (condition name or other field: [name])
  • Other, as a last resort: [describe]

What are reasonable SLOs for the enhancement? [Example: 99% of drains wait no longer than the lower of the hint and the operator maximum, plus 5 seconds]

Which SLIs can an operator use to judge the health of the service?

  • Metrics: name [name], exposed by [component]
  • Other, as a last resort: [describe]

Are any useful metrics missing? Name them and say why they were not added. [Answer]

Dependencies

Does the feature depend on specific services running in the cluster? Consider cluster-level services and node-level ones. For each, give its usage, the impact of its outage and the impact of its degraded performance. [Answer]

Scalability

Compare the answers with the existing Kubernetes SLIs and SLOs published by SIG Scalability.

QuestionAnswer
Will enabling or using the feature cause new API calls? Give type, estimated volume and originating component.[Answer]
Will it introduce new API types? Give supported number of objects per cluster and per namespace.[Answer]
Will it cause new calls to the cloud provider?[Answer]
Will it increase the size or count of existing API objects?[Example: Pod spec and status grow by one integer field each when set]
Will it increase the time of any operation covered by existing SLIs/SLOs?[Answer]
Will it noticeably increase resource use (CPU, memory, disk, IO) in any component?[Answer]
Can it exhaust node resources such as PIDs, sockets or inodes?[Answer]

Troubleshooting

This section is the playbook for operators.

How does the feature behave if the API server or etcd is unavailable? [Answer]

What other failure modes are known? For each, give:

IDFailure modeDetection (metric or signal)MitigationDiagnostics (log messages and level)Testing
FM-01 (Example)kubelet fails to copy hints into statusexample_drain_hint_wait_seconds absent during drainsDisable the gate on kubelet; drains revert to normal behaviourkubelet log at level 4: "drain hint not recorded"Unit and e2e tests listed in the Test Plan
[FM-nn][Failure mode][Detection][Mitigation][Diagnostics][Testing]

What steps should be taken if SLOs are not met? [Answer]

Implementation History

DateMilestone
YYYY-MM-DD (Example)Summary and Motivation merged; SIG accepts the problem
YYYY-MM-DD (Example)Proposal merged; design agreed
YYYY-MM-DD (Example)First Kubernetes release where an initial version was available (alpha in v1.xx)
YYYY-MM-DD[Graduation, deprecation or status change]

Drawbacks

[Drawbacks.]

Example: A new Pod field is supported for the life of the v1 API. Drain tooling outside kubectl must learn to read the hint or the feature brings no benefit there.

Alternatives

AlternativeWhy not chosen
Example: Reuse terminationGracePeriodSecondsSlows every delete, not only drains
Example: An annotation instead of a fieldNot validated, not versioned, easy to misspell
[Alternative][Reason]

Infrastructure Needed (Optional)

[Infrastructure needs, or "None".]

Glossary and references

TermMeaning
SIGSpecial Interest Group that owns an area of Kubernetes
PRRProduction Readiness Review, approved by the prod-readiness-approvers team
Feature gateA key=value switch that enables or disables a feature in a component
Enhancement FreezeRelease deadline by which enhancements must be tracked for the milestone
Conformance testse2e tests every conformant Kubernetes distribution must pass

References:

Standard and licence note

Structure aligned with the Kubernetes Enhancement Proposal template in the kubernetes/enhancements repository (keps/NNNN-kep-template, README.md and kep.yaml, as published in October 2026), Copyright The Kubernetes Authors, licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Section names, the Release Signoff Checklist items, the graduation examples and the Production Readiness Review questions are adapted from that template; this file was modified from it: guidance was rewritten, and Document control, tables and fictional worked examples were added. Stage meanings and skew limits are summarised from the Kubernetes documentation on kubernetes.io. Check the current template and policies before you file a KEP, because they change between releases. Template licence: Apache-2.0 for the portions adapted from the KEP template; the original text added here is MIT.

相关模板