Prerequisites
Before you begin, ensure you have the following installed:- Go 1.25.7 or later
- Docker for building images
- kubectl for interacting with Kubernetes clusters
- Git for version control
- Make for running build commands
For macOS users, you may need
gsed for some Makefile operations:Forking the Repository
Fork on GitHub
Navigate to the KubeLB repository and click the “Fork” button to create your own copy.
Building KubeLB
KubeLB consists of two main components that can be built separately or together.Build All Components
bin/ directory.
Build Individual Components
bin/kubelb- KubeLB Managerbin/ccm- KubeLB Cloud Controller Manager
Development Workflow
Code Formatting and Linting
Before committing code, ensure it’s properly formatted and passes linting:Running Unit Tests
Run the test suite with coverage:Generating Code
After modifying CRD types or adding kubebuilder markers, regenerate the code:- DeepCopy methods
- CRD manifests
- RBAC configurations
- Helm documentation
- Metrics documentation
Running Locally
Prerequisites for Local Testing
-
Generate CRDs and manifests:
-
Install CRDs into your cluster:
Running the Manager
~/.kube/config.
Running the CCM
When running locally, the controllers use your current kubeconfig context. Make sure you’re connected to the correct cluster.
Building Docker Images
To build Docker images for both components:quay.io/kubermatic/kubelb-manager:<IMAGE_TAG>quay.io/kubermatic/kubelb-ccm:<IMAGE_TAG>
IMAGE_TAG is automatically generated from your git commit hash.
Environment Variables
KubeLB’s build system respects several environment variables:| Variable | Description | Default |
|---|---|---|
GOPATH | Go workspace path | $(go env GOPATH) |
CGO_ENABLED | Enable CGO | 0 |
GOPROXY | Go module proxy | https://proxy.golang.org |
GOFLAGS | Go build flags | -mod=readonly -trimpath |
GIT_TAG | Git tag for version | Auto-detected |
KUBELB_IMG | Manager image name | quay.io/kubermatic/kubelb-manager |
KUBELB_CCM_IMG | CCM image name | quay.io/kubermatic/kubelb-ccm |
Next Steps
Now that you have your environment set up:Architecture
Learn about KubeLB’s code organization and patterns
Testing
Write and run tests for your changes
Code Generation
Understand the code generation workflow
Contributing Guide
Read the full contribution guidelines
Getting Help
If you encounter issues:- Check the GitHub Issues
- Join the Kubermatic Slack (#kubermatic channel)
- Post to the mailing list
