k8s cloud vendor load balancing controller
After the user creates a service service through the kubectl command and the type is load balancing,
the controller will automatically pull the available ip segment from cmdb and fill it into the service
The project is divided into two modules. For demonstration purposes, cloud provider services are also integrated.
The name is: cloud-provider-manager
# Configure the relevant database
cat cmd/cloud-provider-manager/cloud-provider-manager.yml
db:
user: xxx
host: xxx
port: xxx
password: xxx
name: cloud_privoder
cd cmd/cloud-provider-manager/
go run main.go --config cloud-provider-manager.yml
# Configure the cloud provider interface address
cat cmd/loadbalance-controller/loadbalance.yml
loadbalance:
bind: "http://localhost:9999/api/v1/cloudprovider/loadbalance/bind"
released: "http://localhost:9999/api/v1/cloudprovider/loadbalance/unbind"
list: "http://localhost:9999/api/v1/cloudprovider/loadbalance/list"
region: cdcm21
cd cmd/loadbalance-controller/
go run loadbalance.go --loadbalanceconfig loadbalance.yml --kubeconfig=$HOME/.kube/config