|
| 1 | +# Guidelines for contributing API changes |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Modifications to the core Kubernetes API have a material impact on the Kubernetes project, and |
| 6 | +undergo thorough review and discussion before they are accepted. This document outlines the |
| 7 | +review process and what is expected of API contributors. |
| 8 | + |
| 9 | +## Process overview |
| 10 | + |
| 11 | +*Proposal process* |
| 12 | + |
| 13 | +All API changes require a formal proposal to be made, reviewed and accepted. The proposal will be |
| 14 | +considered accepted once the proposal PR has been merged. |
| 15 | + |
| 16 | +*Feature process* |
| 17 | + |
| 18 | +All API changes require an issue to be filed in the [kubernetes/features] repo. The |
| 19 | +issue will be used by release coordinators to track which features are slated for a |
| 20 | +release milestone. |
| 21 | + |
| 22 | +## Changes that qualify as API changes |
| 23 | + |
| 24 | +All changes to existing or new APIs are subject to the process outlined in this document. |
| 25 | + |
| 26 | +The following qualify as API changes: |
| 27 | + |
| 28 | +- Adding, removing, or modifying API types (e.g. through types.go, or by defining a new annotation) |
| 29 | +- Changing the version of an existing type (e.g. v1alpha1 to v1beta1) |
| 30 | +- Adding, removing, or modifying subresources for existing types. (e.g. /scale) |
| 31 | +- Material changes to how fields on existing types are interpreted / used - including, but not limited to |
| 32 | + validation and defaulting of the fields. |
| 33 | + |
| 34 | +The following on their own do not qualify as API changes, but should follow the process defined by the related |
| 35 | +[special interest groups]. |
| 36 | + |
| 37 | +- Adding or changing a command or flag to kubectl: See [contributing to SIG cli] |
| 38 | +- Building new command line tools: See [contributing to SIG cli] |
| 39 | +- Adding or changing a flag to kubelet: sig-node |
| 40 | +- Adding or changing a flag to apiserver: sig-api-machinery |
| 41 | +- Refactoring code |
| 42 | +- Building extensions |
| 43 | + |
| 44 | +## Life of an API change |
| 45 | + |
| 46 | +1. Start a discussion |
| 47 | +2. Write a short description |
| 48 | +3. Write a detailed design proposal in the [kubernetes/community] repo |
| 49 | +4. Schedule a design review |
| 50 | +5. File an issue in the [kubernetes/features] repo that links to the proposal |
| 51 | +6. Implement the proposal in the [kubernetes/kubernetes] repo |
| 52 | +7. Write user facing documentation on [kubernetes/kubernetes.github.io] |
| 53 | + |
| 54 | +### Start a discussion. |
| 55 | + |
| 56 | +Expected time for decision: 1-4 weeks (depending on the SIG and feature) |
| 57 | + |
| 58 | +Start a discussion with the relevant [special interest groups] that will [own] the changes. |
| 59 | +Depending on the SIG, this may be done via SIG meetings, email groups, slack channel, etc. |
| 60 | + |
| 61 | +### Write a short description |
| 62 | + |
| 63 | +Expected time for decision: 2 weeks |
| 64 | + |
| 65 | +Write a short description of the API changes by copying the [design summary template] |
| 66 | +into a new issue, and [@mention] @kubernetes/api-reviewers and the owning SIG reviewers |
| 67 | +group. |
| 68 | + |
| 69 | +Determine whether @kubernetes/api-reviewers is willing to accept a design proposal |
| 70 | +for your feature. The answer could be "no, we don't want to solve this problem this way." |
| 71 | +or "no, this is something we want, but cannot commit the resources to reviewing it this release." |
| 72 | + |
| 73 | +### Write a detailed design proposal |
| 74 | + |
| 75 | +Expected time for initial feedback: 3-6 weeks |
| 76 | + |
| 77 | +Write a detailed design proposal PR using the [design proposal PR template]. [@mention] |
| 78 | +@kubernetes/api-reviewers and the appropriate SIGs on the PR and reference the original |
| 79 | +issue in the PR description. |
| 80 | + |
| 81 | +### Schedule a design review |
| 82 | + |
| 83 | +Expected time for next slot: 4-8 weeks |
| 84 | + |
| 85 | +Schedule a time for your design to be reviewed. |
| 86 | + |
| 87 | +See the current list of [design approvers](https://github.com/orgs/kubernetes/teams/api-approvers) |
| 88 | + |
| 89 | +**Note**: these are the current reviewers, we are still figuring out how to |
| 90 | +add/remove people to this list. For more information, see the |
| 91 | +[governance discussion](https://groups.google.com/forum/#!topic/kubernetes-dev/4e8WOnMvZC0) |
| 92 | + |
| 93 | +### Implement the proposal |
| 94 | + |
| 95 | +Once the proposal has been accepted an merged, you can begin implementing the solution. |
| 96 | + |
| 97 | +## How to escalate |
| 98 | + |
| 99 | +Escalation should be done through the owning SIG. If you need help getting attention, reach out to your |
| 100 | +SIG. |
| 101 | + |
| 102 | +## API change considerations |
| 103 | + |
| 104 | +First read the [API changes] document for background on how to make changes in the API. |
| 105 | + |
| 106 | +When writing a design proposal, you must consider the following: |
| 107 | + |
| 108 | +### API versions |
| 109 | + |
| 110 | +See [API versions] for details on the semantic meaning of the API versions. Changes to how |
| 111 | +existing fields are validated, defaulted, or interpreted requires an API version change. |
| 112 | + |
| 113 | +### API groups |
| 114 | + |
| 115 | +It is important to pick the correct API group for your API. This will ensure that it is discoverable |
| 116 | +by users and is maintained in concert with related APIs. Current API groups: |
| 117 | + |
| 118 | +| Group | Description | |
| 119 | +| ------ | ----------- | |
| 120 | +| abac | | |
| 121 | +| apps | | |
| 122 | +| authentication | | |
| 123 | +| authorization | | |
| 124 | +| autoscaling | | |
| 125 | +| batch | | |
| 126 | +| certificates | | |
| 127 | +| imagepolicy | | |
| 128 | +| policy | | |
| 129 | +| rbac | | |
| 130 | +| settings | | |
| 131 | +| storage | | |
| 132 | + |
| 133 | + |
| 134 | +## Related documents |
| 135 | + |
| 136 | +- [API changes] |
| 137 | +- [API conventions] |
| 138 | +- [OARP roles model](https://stumblingabout.com/tag/oarp/) |
| 139 | +- [RACI roles model](http://www.valuebasedmanagement.net/methods_raci.html) |
| 140 | + |
| 141 | +[API versions]: https://github.com/kubernetes/community/blob/master/contributors/devel/api_changes.md#alpha-beta-and-stable-versions |
| 142 | +[@mention]: https://help.github.com/articles/basic-writing-and-formatting-syntax/#mentioning-users-and-teams |
| 143 | +[own]: https://github.com/kubernetes/community/blob/master/contributors/sig-ownership.md |
| 144 | +[special interest groups]: https://github.com/kubernetes/community/blob/master/README.md#special-interest-groups-sig |
| 145 | +[design proposal PR template]: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-proposal-design-template.md |
| 146 | +[design summary template]: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-proposal-issue-template.md |
| 147 | +[API changes]: https://github.com/kubernetes/community/blob/master/contributors/devel/api_changes.md |
| 148 | +[contributing to SIG cli]: https://github.com/kubernetes/community/blob/master/sig-cli/contributing.md |
| 149 | +[kubernetes/kubernetes]: https://github.com/kubernetes/kubernetes/ |
| 150 | +[kubernetes/features]: https://github.com/kubernetes/features/ |
| 151 | +[kubernetes/kubernetes.github.io]: https://github.com/kubernetes/kubernetes.github.io/ |
| 152 | +[kubernetes/community]: https://github.com/kubernetes/community/ |
| 153 | +[API changes]: https://github.com/kubernetes/community/blob/master/contributors/devel/api_changes.md |
| 154 | +[API conventions]: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md |
0 commit comments