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

Openstack fixes #9554

Merged
merged 7 commits into from
Jul 23, 2020
Merged

Openstack fixes #9554

merged 7 commits into from
Jul 23, 2020

Conversation

olemarkus
Copy link
Member

The refactoring done lately have created cyclic dependencies in cloudup tasks when provisioning clusters that use floating or fixed ips for accessing the master API.
This PR breaks this cycle by provisioning floating IPs before the instances.

Using fixed IPs for the API is probably not possible to fix since they are created together with the instance, so one will always have the bootstrapscript -> instance -> bootstrapscript cycle. I think that should be removed in a later PR.

/cc @zetaab

Ole Markus With added 5 commits July 12, 2020 21:08
Openstack can use floating IPs as master API address. Setting these defauls and using floating ips ends up in a nil pointer error somewhere in the lbaasv2 code
Needed somewhere anyway. Failing to create this one errors with missing task
Originally, floating ips depended on instances, but this causes a dependency cycle now that bootstrap scripts require all IPs for the API cert.
This also requires using networking API for creating floating ips instead of compute so that we can name (and later tag) the floating IPs, which is necessary to know which floating IP belongs to which instance prior to association
@k8s-ci-robot k8s-ci-robot requested a review from zetaab July 12, 2020 19:33
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/api area/provider/openstack Issues or PRs related to openstack provider labels Jul 12, 2020
Copy link
Member

@zetaab zetaab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do want test this before it is merged to master. In my opinion it is quite big change and can break things

So after this PR we should still have working clusters with loadbalancer (octavia) and without loadbalancer (3 masters should have floatingips attached to port and then hopefully port is attached to instance)

I try to test this when I have time (I am currently on vacation still)

/hold

}
default:
if !b.UsesSSHBastion() {
if b.Cluster.Spec.Topology.Nodes == "public" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change backwards compatible to old clusters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I added this was that I got floating IPs on all nodes otherwise. Even with private topology.
There is a lot of validation missing for configuring an openstack cluster, where e.g private topology on masters + floating ips on masters should be conflicting. In addition there is ig.spec.associatePublicIP that comes into play too, where floating IPs should be added regardless.

Happy to amend this any other way.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 12, 2020
@olemarkus
Copy link
Member Author

Thanks for the early feedback. Yeah, I am hoping to get a cluster with Octavia to test this as well. Multi-master clusters were broken until just now, so didn't have chance to test that, but single master works just fine.

@johngmyers
Copy link
Member

If the instance can figure out its fixed IP, then nodeup can add that IP into the cert.

@zetaab
Copy link
Member

zetaab commented Jul 12, 2020

fixed ip is available in OpenStack metadata API in each Instance (and that also should match to interface ip address in that instance)

@olemarkus
Copy link
Member Author

That should work.
The HasAddress implementation can also be moved from instance then.

I think that is a largely independent change from this one, so I can see if I can do a parallel PR on that.

@@ -45,6 +46,7 @@ type Instance struct {
Metadata map[string]string
AvailabilityZone *string
SecurityGroups []string
FloatingIP *FloatingIP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Find() needs to fill in this field.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that at some point Find should fill in this. But right now, there is a CheckChanges that only returns true when the instance doesn't exist. So an instance will basically never be updated once created. That is, if I understand fi.task correctly.

One can easily run into an issue where floating IP and instance is created, but association fails for some reason, and it would be nice to have kops detect and amend that. But that's the case for a number of things here. Had a plan to clean that part up later as well.

@johngmyers
Copy link
Member

Looks okay, but I don't know OpenStack.

@zetaab
Copy link
Member

zetaab commented Jul 18, 2020

I will test this when I get internet to my apartment (next week)

@zetaab
Copy link
Member

zetaab commented Jul 23, 2020

I cannot get this PR working

https://gist.github.com/zetaab/e0990214a939830a36c16c022fcb600b

@zetaab
Copy link
Member

zetaab commented Jul 23, 2020

@olemarkus thanks a lot! This will fix all other cases than LB use-case.

Anyway lets make separate PR from that.

/approve
/lgtm

@zetaab
Copy link
Member

zetaab commented Jul 23, 2020

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 23, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 23, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olemarkus, zetaab

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2020
@k8s-ci-robot k8s-ci-robot merged commit a00268d into kubernetes:master Jul 23, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api area/provider/openstack Issues or PRs related to openstack provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants