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

Bug 1935473: Include LB members for Machines created on day-2 operation #1002

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion pkg/platform/openstack/kuryr_bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,12 @@ func BootstrapKuryr(conf *operv1.NetworkSpec, kubeClient client.Client) (*bootst
// the API. With healthchecks enabled for the pool we'll get masters added automatically
// when they're up and ready.
log.Print("Creating OpenShift API loadbalancer pool members")
r, _ := regexp.Compile(fmt.Sprintf("^%s-(master-port-[0-9]+|bootstrap-port)$", clusterID))
r, _ := regexp.Compile(fmt.Sprintf("^%s-(master-port-[0-9]+|bootstrap-port|master-[0-9]+)$", clusterID))
portList, err := listOpenStackPortsMatchingPattern(client, tag, r)
if err != nil {
return nil, errors.Wrap(err, "failed to list openstack master ports")
}

addresses := make([]string, 0)
for _, port := range portList {
if len(port.FixedIPs) > 0 {
Expand All @@ -603,6 +607,10 @@ func BootstrapKuryr(conf *operv1.NetworkSpec, kubeClient client.Client) (*bootst
}
}

if len(portList) == 0 {
return nil, errors.New("No master ports found. Load Balancer members not ensured.")
}

err = purgeOpenStackLbPoolMember(lbClient, poolId, addresses)
if err != nil {
return nil, errors.Wrap(err, "Failed on purging invalid LB members from LB pool")
Expand Down