kubernetes-sigs / cluster-api-provider-openstack

Cluster API implementation for OpenStack
https://cluster-api-openstack.sigs.k8s.io/
Apache License 2.0
297 stars 255 forks source link

Loadbalancer not created in its specified subnet #2149

Open mouad-eh opened 3 months ago

mouad-eh commented 3 months ago

/kind bug

What steps did you take and what happened: I am trying to create a cluster where the loadbalancer is in a different subnet from the cluster nodes. The OpenstackCluster CR is defined as follows:

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackCluster
metadata:
  name: capi-test
  namespace: default
spec:
  apiServerLoadBalancer:
    enabled: true
    network:
      id: <MY-NETWORK-ID>
    subnets:
      - id: <LB-SUBNET-ID>
  identityRef:
    cloudName: openstack
    name: capi-test-cloud-config
  network:
    id: <MY-NETWORK-ID> 
  subnets:
    - id: <NODES-SUBNET-ID>
  disableExternalNetwork: true
  disableAPIServerFloatingIP: true

What did you expect to happen: I was expecting the loadbalancer to be created within \<LB-SUBNET-ID> but instead it was created in \<NODES-SUBNET-ID>.

Anything else you would like to add: I think the reason behind this is that the function responsible for creating the loadbalancer is getting the subnet-id from the state and the state in my case is set after the loadbalancer and its subresources (listners, pools ..etc) are created.

Environment:

EmilienM commented 3 months ago

I think that would be a new feature to support that use case. Right now a cluster manages one network and one subnet for both the machines and the LB. I take a deeper look a bit later this week and report back any finding.

k8s-triage-robot commented 2 weeks ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale