-
Notifications
You must be signed in to change notification settings - Fork 647
[occm] Get IP addresses of neutron subports v3 #2306
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
Conversation
Hi @jingczhang. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Rebase caused the creation of this new PR. |
/ok-to-test |
@mdbooth, you probably want to take another look here. |
Hi @mdbooth, I updated the PR per your comment, pls review. I am testing with k8s 1.23, I am unable to retrieve the trunk_details as you expect, I used continue to skip the code changes for now. |
Thanks! This is high on my todo list but unfortunately it doesn't look like I'm going to get to it this week. Hopefully Monday. |
Hi @mdbooth, I managed to test with k8s 1.23, all good, works as expected. It is amazing the master branch works with k8s 1.23. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
pkg/openstack/instances.go
Outdated
for nw, ips := range subportAddresses { | ||
srvAddresses, ok := addresses[nw] | ||
if !ok { | ||
addresses[nw] = ips | ||
} else { | ||
// this is to take care the corner case | ||
// where the same network is attached to the node both directly and via trunk | ||
addresses[nw] = append(srvAddresses, ips...) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: we're already looping over this above (in the FixedIPs loop). You could move this to there and eliminate subportAddresses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will check
/test pull-cloud-provider-openstack-check |
@jingczhang Those test failures were weird. I'm currently assuming they don't relate to the current version of your PR. Please could you squash the commits before merging? |
Oh, nm. I had some stale state locally. Yeah, you need to fix the unit tests. If you do that and also squash the commits this still lgtm. |
Yup, looks good, just needs the unit tests to be fixed. Thanks! |
c2d1c1e
to
9878cab
Compare
Vlan-aware VMs are commonly used in telecom. Those VMs are plugged into flat networks and use neutron trunk. https://docs.openstack.org/neutron/latest/admin/config-trunking.html Currenlty, nodeAddresses() only returns neutron ports directly attached to VM. For vlan-aware VMs, IP addresses are assigned on neutron subports. Subports are attached to the trunk; they are not attached to the VM directly. This pull request changes nodeAddresses() to return IP addresses of neutron subports when they exist. Without this change, Kubernetes is unable to IP addresses of vlan-aware VMs. This change is transparent to VMs not using neturon trunk. Signed-off-by: Jing Zhang <[email protected]>
9878cab
to
3e01293
Compare
Hi @mdbooth, your last comment has been taken care of, please review. |
/approve I am ok with current code but looks the UT only modify existing cases |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jichenjc 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 |
/lgtm |
The last time we looked at this the problem was that it's extremely hard to do without being able to mock OpenStack API calls. We can do this in CAPO now, but the solution was quite intrusive and it's not easy to share. It's on my longer-term todo list to find a way to do this, ideally directly in gophercloud. |
Vlan-aware VMs are commonly used in telecom. Those VMs are plugged into flat networks and use neutron trunk. https://docs.openstack.org/neutron/latest/admin/config-trunking.html Currenlty, nodeAddresses() only returns neutron ports directly attached to VM. For vlan-aware VMs, IP addresses are assigned on neutron subports. Subports are attached to the trunk; they are not attached to the VM directly. This pull request changes nodeAddresses() to return IP addresses of neutron subports when they exist. Without this change, Kubernetes is unable to IP addresses of vlan-aware VMs. This change is transparent to VMs not using neturon trunk. Signed-off-by: Jing Zhang <[email protected]>
Vlan-aware VMs are commonly used in telecom.
Those VMs are plugged into flat networks and use neutron trunk:
https://docs.openstack.org/neutron/latest/admin/config-trunking.html
Currenlty, nodeAddresses() only returns neutron ports directly attached to VM. For vlan-aware VMs, IP addresses are assigned on neutron subports. Subports are attached to the trunk; they are not attached to the VM directly. This pull request changes nodeAddresses() to return IP addresses of neutron subports when they exist. Without this change, Kubernetes is unable to IP addresses of vlan-aware VMs. This change is transparent to VMs not using neturon trunk.
Special notes for reviewers:
This is a rebase of the following PR:
#2270
Release note: