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

Fix MAC filtering in vSphere cloud provider #73721

Merged
merged 1 commit into from
Feb 6, 2019
Merged

Fix MAC filtering in vSphere cloud provider #73721

merged 1 commit into from
Feb 6, 2019

Conversation

frapposelli
Copy link
Member

@frapposelli frapposelli commented Feb 4, 2019

vSphere cloud provider patches node ips only if they're from a mac address that is associated to the VMware OUI, the previous list was missing two allocated OUIs, this led to cloud provider not patching node ips correctly.

What type of PR is this?

/kind bug

/sig cloud-provider
/sig vmware

/assign @andrewsykim @SandeepPissay @dougm

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

MAC Address filter has been fixed in vSphere Cloud Provider, it no longer ignores `00:1c:14` and `00:05:69` prefixes

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Feb 4, 2019
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. area/provider/vmware Issues or PRs related to vmware provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 4, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frapposelli

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 Feb 4, 2019
@frapposelli
Copy link
Member Author

this fix should be backported as well.

@frapposelli
Copy link
Member Author

Official list of OUIs: http://standards-oui.ieee.org/oui.txt

Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

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

Note that a MAC can be manually set with an OUI other than VMware's.

Another option to consider is using the vSphere API instead of net.Interfaces, this method only returns IP address that have a corresponding vSphere virtual NIC device:

https://github.com/vmware/govmomi/blob/e560c7bb1e709826a897c9da4baad0944c2cdda0/object/virtual_machine.go#L254-L259

Though I suppose this isn't an option for in-tree, since nodes don't require vSphere credentials. Maybe something for out-of-tree provider to consider?

@frapposelli
Copy link
Member Author

@dougm AFAIK out-of-tree does not perform this check at all, exactly because MAC addresses can be completely arbitrary on the platform. Performing some form of reconciliation between the vSphere API and the local machine is a very good idea for out-of-tree.

@timothysc timothysc added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Feb 5, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Feb 5, 2019
@joshrosso
Copy link

I've validated that, without larger code changes, MAC-based OUI filtering is required.

Using https://github.com/joshrosso/kubernetes/commit/5ef48f8d1de112ae56a77f6f20f61fafc9a49855, I built a kubelet image and the result is every interface's IP address was picked up. Including the docker bridge.

After matching similar functionality to this PR via https://github.com/joshrosso/kubernetes/commit/8ecf6cd9b9f75985002de2d805239c8a8b4860c0 I was able to verify the IP was set correctly.

As discussed above this is fragile as non-VMware OUIs could come through the system. Reconciliation against vCenter is highly preferred. However, I understand the constraints making that only plausible for the external provider.

@frapposelli
Copy link
Member Author

/retest

@andrewsykim
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Feb 5, 2019
@andrewsykim
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Feb 5, 2019
Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

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

/lgtm

@frapposelli
Copy link
Member Author

/test pull-kubernetes-e2e-gce-100-performance

@frapposelli
Copy link
Member Author

/test pull-kubernetes-integration

@andrewsykim
Copy link
Member

andrewsykim commented Feb 7, 2019

This needs to be cherry-picked to previous versions
v1.11: #73825
v1.12: #73826
v1.13: #73827

k8s-ci-robot added a commit that referenced this pull request Feb 8, 2019
…73721-upstream-release-1.11

Automated cherry pick of #73721: fix mac filtering in vsphere cloud provider
k8s-ci-robot added a commit that referenced this pull request Feb 8, 2019
…73721-upstream-release-1.13

Automated cherry pick of #73721: fix mac filtering in vsphere cloud provider
k8s-ci-robot added a commit that referenced this pull request Feb 11, 2019
…73721-upstream-release-1.12

Automated cherry pick of #73721: fix mac filtering in vsphere cloud provider
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/provider/vmware Issues or PRs related to vmware provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants