Community Contribution

Contributing to the thriving Kubernetes community can take many forms, including reporting coding bugs, making problem corrections and feature implementations, adding or fixing documentation, and helping users troubleshoot issues.

Community Structure

The Kubernetes community is divided into three key parts:

A picture is worth a thousand words - have a look at the following chart to understand the Kubernetes community better:

Contributing to the Main Branch through Pull Requests

If changes need to be made to the Kubernetes code, you can submit a Pull Request (PR) to the main branch of Kubernetes. This follows the standard Github workflow:

Here are some strategies to expedite the merging of your PR:

  • Use small, separable commits for different features, and even separate Pull Requests for them.

  • Document logic where necessary to explain changes.

  • Adhere to code conventions, referring to the Coding Conventions, API Conventions and kubectl Conventions guidelines as needed.

  • Ensure the modified part passes local unit and functional tests.

  • Make use of Bot commands to set correct labels or retry failed tests.

Pull Requests to Release Branches

Issues in release branches are usually first fixed in the main branch (sending a Pull Request there and merging it after code review) then cherry-picked into an older branch (like release-1.7).

For the main branch’s PR, once the cherrypick-candidate label is added by the reviewer, the cherry-picking into the older branch can start. But first, you'll need to install hub, a tool provided by Github:

# on macOS
brew install hub

# on others
go get github.com/github/hub

Then run the script below to automatically cherry-pick and send a PR to the desired branch. In this example, upstream/release-1.7 is the target release branch and 51870 is the PR number:

hack/cherry_pick_pull.sh upstream/release-1.7 51870

Follow the instructions in the output afterward. If errors occur during merging, manually merge conflicts in a separate terminal and execute git add . && git am --continue, then continue until the PR is successfully submitted.

Bear in mind: Each PR submitted to a release branch requires routine code reviews and approval from the release manager of the corresponding version. Lists of all release managers for every version can be found here.

Useful Resources

Encountered difficulties in making community contributions? Feel free to refer to these guidelines:

最后更新于