diff --git a/api/v1beta2/ibmvpccluster_types.go b/api/v1beta2/ibmvpccluster_types.go index b4ed7037b..e5feff663 100644 --- a/api/v1beta2/ibmvpccluster_types.go +++ b/api/v1beta2/ibmvpccluster_types.go @@ -127,6 +127,10 @@ type AdditionalListenerSpec struct { // Will default to TCP protocol if not specified. // +optional Protocol *VPCLoadBalancerListenerProtocol `json:"protocol,omitempty"` + + // BootstrapOnly signifies that only the bootstrap IP will be added to this pool. + // +optional + BootstrapOnly bool `json:"bootstrapOnly,omitempty"` } // VPCLoadBalancerBackendPoolSpec defines the desired configuration of a VPC Load Balancer Backend Pool. diff --git a/cloud/scope/powervs_machine.go b/cloud/scope/powervs_machine.go index d907fde52..6e27786a1 100644 --- a/cloud/scope/powervs_machine.go +++ b/cloud/scope/powervs_machine.go @@ -1061,6 +1061,16 @@ func (m *PowerVSMachineScope) CreateVPCLoadBalancerPoolMember() (*vpcv1.LoadBala } } } + + for _, al := range lb.AdditionalListeners { + ib := strings.Contains(m.IBMPowerVSMachine.Name, "-bootstrap") + if al.BootstrapOnly && al.Port == targetPort && !ib { + m.V(3).Info("Skipping PoolMember because BootstrapOnly specified") + alreadyRegistered = true + continue + } + } + if alreadyRegistered { m.V(3).Info("PoolMember already exist", "pool", *pool.Name, "targetip", internalIP, "port", targetPort) continue diff --git a/cloud/scope/vpc_cluster.go b/cloud/scope/vpc_cluster.go index 98197a115..5dabfc300 100644 --- a/cloud/scope/vpc_cluster.go +++ b/cloud/scope/vpc_cluster.go @@ -1967,7 +1967,7 @@ func (s *VPCClusterScope) createLoadBalancer(loadBalancer infrav1beta2.VPCLoadBa for _, additionalListener := range loadBalancer.AdditionalListeners { listener := s.buildLoadBalancerListener(additionalListener) - s.V(3).Info("addd listener to load balancer", "loadBalancerName", loadBalancer.Name, "listenerPort", listener.Port) + s.V(3).Info("added listener to load balancer", "loadBalancerName", loadBalancer.Name, "listenerPort", listener.Port) listeners = append(listeners, listener) } } else { diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml index 85a39fe82..a967a2359 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml @@ -275,6 +275,10 @@ spec: AdditionalListenerSpec defines the desired state of an additional listener on an VPC load balancer. properties: + bootstrapOnly: + description: BootstrapOnly signifies that only the bootstrap + IP will be added to this pool. + type: boolean defaultPoolName: description: defaultPoolName defines the name of a VPC Load Balancer Backend Pool to use for the VPC Load Balancer diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclustertemplates.yaml index f1bd15792..80ceb2de9 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclustertemplates.yaml @@ -305,6 +305,10 @@ spec: AdditionalListenerSpec defines the desired state of an additional listener on an VPC load balancer. properties: + bootstrapOnly: + description: BootstrapOnly signifies that only + the bootstrap IP will be added to this pool. + type: boolean defaultPoolName: description: defaultPoolName defines the name of a VPC Load Balancer Backend Pool to use for diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml index 311704df9..9a7865d06 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml @@ -260,6 +260,10 @@ spec: AdditionalListenerSpec defines the desired state of an additional listener on an VPC load balancer. properties: + bootstrapOnly: + description: BootstrapOnly signifies that only the bootstrap + IP will be added to this pool. + type: boolean defaultPoolName: description: defaultPoolName defines the name of a VPC Load Balancer Backend Pool to use for the VPC Load Balancer @@ -532,6 +536,10 @@ spec: AdditionalListenerSpec defines the desired state of an additional listener on an VPC load balancer. properties: + bootstrapOnly: + description: BootstrapOnly signifies that only the + bootstrap IP will be added to this pool. + type: boolean defaultPoolName: description: defaultPoolName defines the name of a VPC Load Balancer Backend Pool to use for the VPC diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml index ee2a7c366..edea034ec 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclustertemplates.yaml @@ -108,6 +108,10 @@ spec: AdditionalListenerSpec defines the desired state of an additional listener on an VPC load balancer. properties: + bootstrapOnly: + description: BootstrapOnly signifies that only the + bootstrap IP will be added to this pool. + type: boolean defaultPoolName: description: defaultPoolName defines the name of a VPC Load Balancer Backend Pool to use for the @@ -389,6 +393,11 @@ spec: AdditionalListenerSpec defines the desired state of an additional listener on an VPC load balancer. properties: + bootstrapOnly: + description: BootstrapOnly signifies that + only the bootstrap IP will be added to this + pool. + type: boolean defaultPoolName: description: defaultPoolName defines the name of a VPC Load Balancer Backend Pool to use