Contributing¶
We welcome contributions to the VNGCloud Load Balancer Controller!
Development Setup¶
Prerequisites¶
- Go 1.25.9+
- Docker
kubectland access to a Kubernetes clustermake
Clone the repository¶
git clone https://github.com/vngcloud/vngcloud-load-balancer-controller.git
cd vngcloud-load-balancer-controller
Local configuration¶
Create the config file at /etc/vngcloud-load-balancer-controller/config.yaml:
chartVersion: 0.0.0
global:
clientID: "your-client-id"
clientSecret: "your-client-secret"
identityURL: "https://iamapis.vngcloud.vn/accounts-api"
vserverURL: "https://hcm-3.api.vngcloud.vn/vserver"
projectID: "pro-your-project-id"
Run locally¶
Running Tests¶
For focused integration tests:
go clean -testcache && go test -v ./internal/controller/networking/... \
-ginkgo.focus="When node status changes from not ready to ready"
Code Generation¶
After modifying CRD types (api/v1alpha1/*.go), regenerate:
After modifying mockery config (.mockery.yml):
Building¶
# Build and push image
make docker-build docker-push IMG=<registry>/vngcloud-load-balancer-controller:<tag>
# Deploy to cluster
make deploy IMG=<registry>/vngcloud-load-balancer-controller:<tag>
Working on Documentation¶
pip install pipenv
pipenv install
# Preview docs locally
pipenv run mkdocs serve
# Build static site
pipenv run mkdocs build
Creating a New Controller¶
kubebuilder create api --group core --version v1 --kind Service --resource=false --controller=true
go mod tidy
make generate
make manifests kustomize helm
Linting¶
Submitting a Pull Request¶
- Fork the repository and create a feature branch
- Make your changes with tests
- Run
make test lint - Open a PR against the
v3branch
For more information see the Kubebuilder Documentation.