Thank you for your interest in contributing! This guide will help you get started with development.
- Go 1.23 or later
- Docker or Podman (for building images)
- Kubernetes cluster (kind, k3d, minikube, or cloud provider)
kubectlconfigured to access your clusterkubebuilder(for Helm chart generation)
-
Clone the repository
git clone https://github.com/nebari-dev/nebari-operator.git cd nebari-operator -
Install dependencies
go mod download make controller-gen # Install code generation tools -
Verify your setup
make test # Run unit tests
When you modify the NebariApp CRD (in api/v1/nebariapp_types.go):
-
Make your changes to the Go types
-
Regenerate CRDs and code:
make generate-dev
This will:
- Generate DeepCopy methods
- Update CRD manifests in
config/crd/bases/
-
Commit both source and generated files:
git add api/ config/crd/bases/ git commit -m "feat: add new field to NebariApp"
Important: Always run make generate-dev after API changes. CI will fail if generated files are out of sync.
When you modify controller logic (in internal/controller/):
-
Make your changes
-
Run tests:
make test-unit # Unit tests make test-e2e # End-to-end tests (requires cluster)
-
Commit:
git add internal/controller/ git commit -m "fix: improve reconciliation logic"
# Build and deploy
make docker-build IMG=nebari-operator:dev
make deploy IMG=nebari-operator:dev
# Check logs
kubectl logs -f deployment/nebari-operator-controller-manager \
-n nebari-operator-system \
-c manager# Install CRDs
make install
# Run controller (watches cluster)
make run| Command | Description |
|---|---|
make generate-dev |
Generate CRDs and DeepCopy code (run after API changes) |
make generate-all |
Generate CRDs, manifests, and Helm chart (comprehensive) |
make test |
Run all unit tests |
make test-unit |
Run controller unit tests with coverage |
make test-e2e |
Run end-to-end tests |
make build |
Build the operator binary |
make docker-build |
Build Docker image |
make deploy |
Deploy to cluster |
make lint |
Run linter |
make help |
Show all available targets |
-
Create a branch:
git checkout -b feat/my-new-feature
-
Make changes and test:
# Make your changes make generate-dev # If you modified the API make test # Run tests make lint # Check code quality
-
Commit with clear messages:
git commit -m "feat: add support for custom domains"Use conventional commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changeschore:- Maintenance taskstest:- Test updates
-
Push and create PR:
git push origin feat/my-new-feature
Then open a PR on GitHub.
-
CI Checks: Your PR must pass:
- ✅ Unit tests
- ✅ E2E tests
- ✅ Linter checks
- ✅ Generated files are up-to-date
- Edit
api/v1/nebariapp_types.go - Add kubebuilder markers for validation
- Run
make generate-dev - Update controller logic in
internal/controller/ - Add tests
- Document in
docs/configuration-reference.md
Enable verbose logging:
kubectl set env deployment/nebari-operator-controller-manager \
LOGLEVEL=debug \
-n nebari-operator-systemCheck resource events:
kubectl describe nebariapp my-app
kubectl get events --sort-by='.lastTimestamp'Check controller logs:
kubectl logs -f deployment/nebari-operator-controller-manager \
-n nebari-operator-system \
-c managerPlease note that this project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.