Skip to content

Commit

Permalink
Configure private or public loadbalancer (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-K-N committed Mar 12, 2024
1 parent fca955e commit 1cc2bc3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
3 changes: 2 additions & 1 deletion api/v1beta2/ibmpowervscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ type IBMPowerVSClusterSpec struct {
TransitGateway *TransitGateway `json:"transitGateway,omitempty"`

// loadBalancers is optional configuration for configuring loadbalancers to control plane or data plane nodes.
// when omitted system will create a public loadbalancer with name CLUSTER_NAME-loadbalancer.
// when omitted system will create a default public loadbalancer with name CLUSTER_NAME-loadbalancer.
// when specified a vpc loadbalancer will be created and controlPlaneEndpoint will be set with associated hostname of loadbalancer.
// ControlPlaneEndpoint will be set with associated hostname of public loadbalancer.
// when LoadBalancers[].ID is set, its expected that there exist a loadbalancer with ID or else system will give error.
// when LoadBalancers[].Name is set, system will first check for loadbalancer with Name, if not exist system will create new loadbalancer.
// For each loadbalancer a default backed pool and front listener will be configured with port 6443.
// +optional
LoadBalancers []VPCLoadBalancerSpec `json:"loadBalancers,omitempty"`

Expand Down
2 changes: 1 addition & 1 deletion api/v1beta2/ibmvpccluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type VPCLoadBalancerSpec struct {
// +optional
Public bool `json:"public,omitempty"`

// AdditionalListeners sets the additional listeners for the control plane load balancer. .
// AdditionalListeners sets the additional listeners for the control plane load balancer.
// +listType=map
// +listMapKey=port
// +optional
Expand Down
4 changes: 2 additions & 2 deletions cloud/scope/powervs_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ func (s *PowerVSClusterScope) createLoadBalancer(lb infrav1beta2.VPCLoadBalancer
}

options.SetName(lb.Name)
options.SetIsPublic(true)
options.SetIsPublic(lb.Public)
options.SetResourceGroup(&vpcv1.ResourceGroupIdentity{
ID: &resourceGroupID,
})
Expand Down Expand Up @@ -1361,7 +1361,7 @@ func (s *PowerVSClusterScope) createLoadBalancer(lb infrav1beta2.VPCLoadBalancer
ID: loadBalancer.ID,
State: lbState,
Hostname: loadBalancer.Hostname,
ControllerCreated: pointer.Bool(lb.Public),
ControllerCreated: pointer.Bool(true),
}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,23 @@ spec:
loadBalancers:
description: loadBalancers is optional configuration for configuring
loadbalancers to control plane or data plane nodes. when omitted
system will create a public loadbalancer with name CLUSTER_NAME-loadbalancer.
system will create a default public loadbalancer with name CLUSTER_NAME-loadbalancer.
when specified a vpc loadbalancer will be created and controlPlaneEndpoint
will be set with associated hostname of loadbalancer. ControlPlaneEndpoint
will be set with associated hostname of public loadbalancer. when
LoadBalancers[].ID is set, its expected that there exist a loadbalancer
with ID or else system will give error. when LoadBalancers[].Name
is set, system will first check for loadbalancer with Name, if not
exist system will create new loadbalancer.
exist system will create new loadbalancer. For each loadbalancer
a default backed pool and front listener will be configured with
port 6443.
items:
description: VPCLoadBalancerSpec defines the desired state of an
VPC load balancer.
properties:
additionalListeners:
description: AdditionalListeners sets the additional listeners
for the control plane load balancer. .
for the control plane load balancer.
items:
description: AdditionalListenerSpec defines the desired state
of an additional listener on an VPC load balancer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,23 +274,24 @@ spec:
loadBalancers:
description: loadBalancers is optional configuration for configuring
loadbalancers to control plane or data plane nodes. when
omitted system will create a public loadbalancer with name
CLUSTER_NAME-loadbalancer. when specified a vpc loadbalancer
will be created and controlPlaneEndpoint will be set with
associated hostname of loadbalancer. ControlPlaneEndpoint
omitted system will create a default public loadbalancer
with name CLUSTER_NAME-loadbalancer. when specified a vpc
loadbalancer will be created and controlPlaneEndpoint will
be set with associated hostname of loadbalancer. ControlPlaneEndpoint
will be set with associated hostname of public loadbalancer.
when LoadBalancers[].ID is set, its expected that there
exist a loadbalancer with ID or else system will give error.
when LoadBalancers[].Name is set, system will first check
for loadbalancer with Name, if not exist system will create
new loadbalancer.
new loadbalancer. For each loadbalancer a default backed
pool and front listener will be configured with port 6443.
items:
description: VPCLoadBalancerSpec defines the desired state
of an VPC load balancer.
properties:
additionalListeners:
description: AdditionalListeners sets the additional
listeners for the control plane load balancer. .
listeners for the control plane load balancer.
items:
description: AdditionalListenerSpec defines the desired
state of an additional listener on an VPC load balancer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ spec:
properties:
additionalListeners:
description: AdditionalListeners sets the additional listeners
for the control plane load balancer. .
for the control plane load balancer.
items:
description: AdditionalListenerSpec defines the desired state
of an additional listener on an VPC load balancer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
properties:
additionalListeners:
description: AdditionalListeners sets the additional listeners
for the control plane load balancer. .
for the control plane load balancer.
items:
description: AdditionalListenerSpec defines the desired
state of an additional listener on an VPC load balancer.
Expand Down

0 comments on commit 1cc2bc3

Please sign in to comment.