Contributing¶
We welcome contributions from the community. This page explains how to get started and where to find help.
Getting started¶
Before contributing, please read the project's Contributing Guidelines in the repository. In particular:
- Contributor License Agreement (CLA) — You must sign the Kubernetes CLA before we can accept your pull requests.
- Kubernetes Contributor Guide — Main contributor documentation; you can jump to the contributing page.
- Contributor Cheat Sheet — Common resources for existing developers.
The Kubernetes community abides by the CNCF Code of Conduct.
Development workflow¶
From the repository root:
- Build:
make build - Format:
make fmt - Lint / vet:
make lint - Tests:
make test(writescover.outfor coverage) - Test coverage:
make testwritescover.out. Runmake test-coverto refresh tests and emitout/coverage.htmlandout/coverage.txt(go tool cover). Withcover.outpresent,make cover-funcprints a per-function summary andmake cover-htmlopens the interactive HTML report in a browser (local). Remove generated artifacts withmake cover-clean. - CI coverage: The test workflow uploads
cover.outto Codecov on pull requests and pushes tomain, tagged with theunittestsflag. Codecov enforces a minimum project coverage of 70% (with 1% slack) and 80% coverage on changed lines in each PR. - E2E code coverage: In addition to unit-test coverage, the E2E suite can measure how much production code the end-to-end tests exercise. This runs against a live Kind cluster with a coverage-instrumented operator image, so it is scheduled nightly (and can be triggered via
workflow_dispatch) rather than on every PR. To reproduce locally:make deploy-test-e2e-coverthenmake test-e2e-cover. This builds thecoverageimage target (go build -coveron a busybox base), deploys it via theconfig/coverageoverlay (which adds a writableGOCOVERDIRvolume), runs the E2E tests, copies the coverage data out of the running pod withkubectl cp, and writes a profile toout/e2e-coverage.out. The manager flushes coverage counters once at startup and then every 10s while running, because a-coverbinary otherwise only emits data on clean exit; the upfront flush also means collection (which copies data out of the still-running pod) works even for a short suite. This flushing logic lives incmd/coverage.gobehind thee2ecoveragebuild tag and is compiled only into the coverage image; the production build compiles the no-op stub incmd/coverage_noop.go, so it carries no coverage code orruntime/coverageimport.make testruns the untagged production build (which compilescmd/coverage_noop.go) and then a second, tag-scopedgo test -tags e2ecoverage ./cmd/...socmd/coverage.gois unit-tested too; both profiles (cover.outandcover-e2ecoverage.out) are uploaded under theunittestsflag. In CI the E2E profile is uploaded to Codecov under thee2eflag, so E2E and unit coverage can be compared side by side. The coverage data lives on anemptyDirvolume, so if the operator pod restarts mid-run (e.g. OOM) the pre-restart coverage is lost; the collected numbers reflect only the current pod's lifetime. See #177. - Generate manifests:
make manifests generate
After making changes, open a pull request on GitHub. Ensure CI passes and address any review feedback.
Mentorship¶
- Mentoring Initiatives — Kubernetes offers mentorship programs and is always looking for volunteers.
Bug reports¶
Bug reports should be filed as GitHub Issues on this repo.
Communications¶
For meeting schedules and additional community information, see the SIG Apps README.