Skip to content

Commit 106e5c3

Browse files
committed
Handle 6443 port
1 parent 6541667 commit 106e5c3

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

cloud/scope/powervs_machine.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,16 @@ func (m *PowerVSMachineScope) CreateVPCLoadBalancerPoolMember(ctx context.Contex
10231023
if loadBalancerListener.DefaultPool != nil {
10241024
loadBalancerListeners[*loadBalancerListener.DefaultPool.Name] = additionalListener
10251025
}
1026+
} else if loadBalancerListener.Port != nil && *loadBalancerListener.Port == int64(6443) {
1027+
// add default pool 6443 to all control plane machines
1028+
log.V(3).Info("loadbalancerlisteners port match", "port", loadBalancerListener.Port)
1029+
1030+
protocol := infrav1beta2.VPCLoadBalancerListenerProtocol(*loadBalancerListener.Protocol)
1031+
listener := infrav1beta2.AdditionalListenerSpec{
1032+
Port: *loadBalancerListener.Port,
1033+
Protocol: &protocol,
1034+
}
1035+
loadBalancerListeners[*loadBalancerListener.DefaultPool.Name] = listener
10261036
}
10271037
}
10281038
// Update each LoadBalancer pool
@@ -1049,6 +1059,7 @@ func (m *PowerVSMachineScope) CreateVPCLoadBalancerPoolMember(ctx context.Contex
10491059
}
10501060

10511061
if selector.Empty() && !util.IsControlPlaneMachine(m.Machine) {
1062+
log.V(3).Info("Skipping listener addition as the selector is empty and not a control plane machine")
10521063
continue
10531064
}
10541065
// Skip adding the listener if the selector does not match

controllers/ibmpowervsmachine_controller.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -400,18 +400,6 @@ func (r *IBMPowerVSMachineReconciler) reconcileNormal(ctx context.Context, machi
400400
return ctrl.Result{RequeueAfter: 2 * time.Minute}, nil
401401
}
402402

403-
// We configure load balancer for only control-plane machines
404-
if !util.IsControlPlaneMachine(machineScope.Machine) {
405-
log.Info("Skipping load balancer configuration for worker machine")
406-
conditions.MarkTrue(machineScope.IBMPowerVSMachine, infrav1beta2.InstanceReadyCondition)
407-
v1beta2conditions.Set(machineScope.IBMPowerVSMachine, metav1.Condition{
408-
Type: infrav1beta2.IBMPowerVSMachineInstanceReadyV1Beta2Condition,
409-
Status: metav1.ConditionTrue,
410-
Reason: infrav1beta2.IBMPowerVSMachineInstanceReadyV1Beta2Reason,
411-
})
412-
return ctrl.Result{}, nil
413-
}
414-
415403
if machineScope.IBMPowerVSCluster.Spec.VPC == nil || machineScope.IBMPowerVSCluster.Spec.VPC.Region == nil {
416404
log.Info("Skipping configuring machine to load balancer as VPC is not set")
417405
conditions.MarkTrue(machineScope.IBMPowerVSMachine, infrav1beta2.InstanceReadyCondition)

0 commit comments

Comments
 (0)