Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure private or public loadbalancer #1656

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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