Hi,
I’m trying to dynamically add subdomain routing entries to my loadbalancer as containers and services are created.
ie:
visiting vpn.example.com should connect me to vpn container port 80
visting vpc.example.com should connect me to vpc container port 8081
The static label syntax looks like:
io.rancher.loadbalancer.target.vpn/app: vpn.example.com=80
What I’m trying to do should be solved by https://github.com/rancher/rancher/issues/2288
But for now it looks like I’m going to have to create an agent that will update my load balancer dynamically as services are created.
To that effect, I’m trying to figure out how to create an Advanced Load Balancing link (L7 type) using the API.
From what i’ve figured out so far, I need to create a loadBalancerServiceLink type object and post it to the http://localhost:5000/v1/loadbalancerservices/1s2/?action=setservicelinks endpoint, however I’m not really sure of the structure of a loadBalancerServiceLink object.
“serviceId”: {
“type”: “reference[service]”,
“create”: true,
“update”: false,
“required”: true,
“readOnCreateOnly”: false,
},
“ports”: {
“type”: “array[string]”,
“create”: true,
“update”: false,
“nullable”: true,
“readOnCreateOnly”: false,
},
What is the structure for serviceId and ports? or am I completely down the rabbit hole and missing some other obvious API endpoint?