First off, thank you for considering contributing to the OpenClaw Kubernetes Operator! It's people like you that make this project great.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible using our bug report template.
Great bug reports include:
- A quick summary and/or background
- Steps to reproduce (be specific!)
- What you expected would happen
- What actually happens
- Kubernetes version, operator version, and other relevant environment details
- Notes (possibly including why you think this might be happening)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, use our feature request template and include:
- A clear and descriptive title
- A detailed description of the proposed enhancement
- Explain why this enhancement would be useful
- List any alternatives you've considered
- Fork the repo and create your branch from
main - If you've added code that should be tested, add tests
- If you've changed APIs, update the documentation
- Ensure the test suite passes
- Make sure your code lints
- Issue that pull request!
- Go 1.22+
- Docker
- kubectl
- Kind (for local testing)
- Make
# Clone your fork
git clone https://github.com/YOUR_USERNAME/k8s-operator.git
cd k8s-operator
# Add upstream remote
git remote add upstream https://github.com/OpenClaw-rocks/k8s-operator.git
# Install dependencies
go mod download
# Generate code and manifests
make generate manifests
# Run tests
make test
# Run linter
make lint# Create a Kind cluster
kind create cluster
# Install CRDs
make install
# Run the operator locally (outside the cluster)
make run# Run unit tests
make test
# Run linter
make lint
# Run E2E tests (requires Kind)
make test-e2e# Build the binary
make build
# Build Docker image
make docker-build IMG=my-operator:dev
# Load into Kind
kind load docker-image my-operator:dev
# Deploy to Kind
make deploy IMG=my-operator:dev- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
- Consider using Conventional Commits:
feat:for new featuresfix:for bug fixesdocs:for documentation changeschore:for maintenance taskstest:for test additions/changesrefactor:for code refactoring
- Follow the Effective Go guidelines
- Run
make fmtbefore committing - Run
make lintand fix any issues - Write meaningful comments for exported functions
- Keep functions focused and small
- Follow Kubernetes API conventions
- Use meaningful names for CRD fields
- Provide sensible defaults where appropriate
- Document all CRD fields with
// +kubebuilder:validationmarkers
.
├── api/v1alpha1/ # CRD type definitions
├── cmd/ # Main entrypoint
├── config/ # Kubernetes manifests
│ ├── crd/ # CRD definitions
│ ├── manager/ # Operator deployment
│ ├── rbac/ # RBAC configuration
│ └── samples/ # Example CRs
├── internal/
│ ├── controller/ # Reconciliation logic
│ ├── resources/ # Resource builders
│ └── webhook/ # Admission webhooks
├── charts/ # Helm chart
└── test/e2e/ # E2E tests
- All submissions require review from a maintainer
- We use GitHub pull request reviews
- CI must pass before merging
- At least one approval is required
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Pull Requests: For code contributions
Contributors will be recognized in our releases and in the project's contributors list.
Thank you for contributing!