Welcome to Kubernetes. We are excited about the prospect of you joining our community! The Kubernetes community abides by the CNCF code of conduct. Here is an excerpt:
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We have full documentation on how to get started contributing here:
- Contributor License Agreement Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
- Kubernetes Contributor Guide - Main contributor documentation, or you can just jump directly to the contributing section
- Contributor Cheat Sheet - Common resources for existing developers
- Go (see
Makefilefor the required version) - Docker
make- Access to a Kubernetes cluster (for E2E tests)
# Build the operator binary
make build
# Build the Docker image
make docker-build# Run unit tests
make test
# Run linters
make lint
# Run E2E tests (requires a cluster)
make test-e2eAfter modifying API types in api/v1alpha2/, regenerate code and manifests:
make generate manifestsFor a fast inner-loop development cycle using Tilt:
- Clone cluster-api alongside this repository
- Configure
tilt-settings.yamlin the cluster-api directory:provider_repos: - "../cluster-api-operator" enable_providers: - capi-operator enable_core_provider: false
- Run
make tilt-upfrom the cluster-api directory
See docs/local-development.md for more details.
| Directory | Description |
|---|---|
api/v1alpha2/ |
CRD type definitions and interfaces |
internal/controller/ |
Controller implementations |
internal/webhook/ |
Admission webhook implementations |
config/ |
Kustomize manifests (CRDs, RBAC, webhooks) |
test/e2e/ |
End-to-end tests |
util/ |
Shared utilities |
- Follow Kubernetes coding conventions
- Use
ctrl.LoggerFrom(ctx)for structured logging - Wrap errors with
fmt.Errorf("context: %w", err) - All new code must pass
make lint
- Fork the repository and create a feature branch
- Write tests for new functionality
- Ensure
make lintandmake testpass locally - PR titles must follow Conventional Commits format (e.g.,
fix:,feat:,docs:) - PRs require at least one approving review from a maintainer listed in OWNERS
- CI must pass before merge (linting, unit tests, E2E)
- Mentoring Initiatives - We have a diverse set of mentorship programs available that are always looking for volunteers!
- Slack: #cluster-api-operator on Kubernetes Slack
- Documentation