vexxhost / magnum-cluster-api

Cluster API driver for OpenStack Magnum
Apache License 2.0
41 stars 17 forks source link

Include member-subnet-id in cloud-controller-manager config #306

Open robincron opened 5 months ago

robincron commented 5 months ago

Problem: When a service with type loadbalancer is created in a cluster that shares the same subnet-CIDR as another subnet in the same scope (either same project or same domain if created by an admin), the cloud controller manager seems to choose a subnet at random instead of using the correct subnet for its workers. This results in the services not working. A manual fix for this is to add the following to the cloud-controller-manager config on the control plane nodes:

[LoadBalancer]
member-subnet-id = {subnet_id}

The cloud_controller_manager_config seems to contain the value for the subnet (among others)

https://github.com/vexxhost/magnum-cluster-api/blob/c40f84871dc742a00f554a5691efab9f62f0234a/magnum_cluster_api/objects.py#L138-L160

But apparently the generator does not write these values to the config file.

https://github.com/vexxhost/magnum-cluster-api/blob/c40f84871dc742a00f554a5691efab9f62f0234a/magnum_cluster_api/utils.py#L96-L123

This is easy to circumvent but it would be nicer if the users wouldn't have to worry about this behaviour at all. Is this intended behaviour or am I not understanding something right?