Kubernetes integration with OpenStack networking
Go to file
Ilya Maximets d2b223ffca Set MAC address for VF via netlink message to PF
SR-IOV binding driver uses pyroute2 library to set MAC addresses
to VFs. This is internally implemented via ioctl(SIOCSIFHWADDR)
giving it the name of that device. This is equal to calling
'ip link set dev $VFDEV address $MAC'. However, there is another
way to set MAC address for VF. It works via netlink RTM_SETLINK
message to the PF. This is equal to calling
'ip link set dev $PFDEV vf $VFID mac $MAC'.

How it works:
* ioctl(SIOCSIFHWADDR) asks the VF driver to set the MAC
  --> VF driver asks PF to set MAC for it
  --> PF sets the MAC for VF.
* RTM_SETLINK message asks the PF to set MAC for VF
  --> PF sets the MAC for VF.

In case of setting directly via PF, PF additionally sets an
"administratively changed MAC" flag for that VF in the PF's
driver, and from that point on (until the PF's driver is
reloaded) that VF's MAC address can't be changed using the
method #1.

It's a security feature designed to forbid MAC changing by the
guest OS/app inside the container.

Above leads to the issue where SR-IOV CNI is not able to set MAC
address for VF if its MAC was previously administratively set at
least once (by hands or other software):

  ioctl SIOCSIFHWADDR: Cannot assign requested address

  kernel: igb 0000:05:00.0:
    VF 0 attempted to override administratively set MAC address
    Reload the VF driver to resume operations

After that CNI fails the whole transaction, i.e. fails to change
the interface name as well and subsequently fails the binding.

Netlink PF method to change MAC addresses should be used always.
This will additionally forbid the MAC changing from the inside
of container.

Change-Id: Ic47672e4ce645d9d37b520b6a412a44ae61036e1
Closes-Bug: 1825383
Co-authored-by: Danil Golov <d.golov@samsung.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
2019-04-24 15:25:36 +03:00
.zuul.d OpenDev Migration Patch 2019-04-19 19:44:54 +00:00
contrib Change Pod annotations format to o.vo 2018-08-01 15:30:42 +02:00
devstack Merge "Enable debug logs on Kubernetes services" 2019-04-16 15:47:57 +00:00
doc Fix pod creation diagram in devref 2019-04-23 14:27:34 +02:00
etc Proceed CNI output in format of version 0.3.1 2018-07-04 13:04:35 +00:00
kubernetes_crds Implement NP SG create/delete actions 2018-09-06 10:10:15 -04:00
kuryr_kubernetes Set MAC address for VF via netlink message to PF 2019-04-24 15:25:36 +03:00
playbooks Switch to CentOS Amphora 2019-04-04 12:33:42 +02:00
releasenotes Update master for stable/stein 2019-03-27 18:38:44 +00:00
tools Clean up Dockerfiles and how we build them 2018-12-17 10:40:50 +01:00
.coveragerc tox: fix coverage 2016-11-18 10:14:56 +03:00
.dockerignore Add support to install Kuryr as a network addon 2017-09-14 13:33:53 +02:00
.gitignore ignore Editor tags 2018-09-25 12:16:08 +02:00
.gitreview OpenDev Migration Patch 2019-04-19 19:44:54 +00:00
.pre-commit-config.yaml Add support for pre-commit-hooks 2018-09-27 13:05:43 +02:00
.stestr.conf Switch to using stestr 2018-07-16 15:43:10 +00:00
.testr.conf cookiecutter commit for kuryr-kubernetes 2016-05-22 08:54:07 +03:00
CONTRIBUTING.rst Fix some misspellings within Kuryr-Kubernetes 2019-01-03 07:31:47 -05:00
HACKING.rst Update doc title format 2018-03-01 14:27:13 +08:00
LICENSE cookiecutter commit for kuryr-kubernetes 2016-05-22 08:54:07 +03:00
README.rst Update links in README 2018-08-19 03:47:48 +08:00
babel.cfg cookiecutter commit for kuryr-kubernetes 2016-05-22 08:54:07 +03:00
cni.Dockerfile Clean up Dockerfiles and how we build them 2018-12-17 10:40:50 +01:00
cni_ds_init Remove way of running without kuryr-daemon 2019-02-04 12:53:00 +01:00
cni_py3.Dockerfile Clean up Dockerfiles and how we build them 2018-12-17 10:40:50 +01:00
controller.Dockerfile Clean up Dockerfiles and how we build them 2018-12-17 10:40:50 +01:00
controller_py3.Dockerfile Clean up Dockerfiles and how we build them 2018-12-17 10:40:50 +01:00
lower-constraints.txt Switch Octavia API calls to openstacksdk 2019-03-07 17:38:27 +01:00
requirements.txt Add ipBlock support to NP 2019-04-16 09:22:36 +02:00
setup.cfg Dropping the py35 testing 2019-04-14 22:58:11 +00:00
setup.py Updated from global requirements 2017-03-15 12:44:19 +00:00
test-requirements.txt Switch to using stestr 2018-07-16 15:43:10 +00:00
tox.ini Dropping the py35 testing 2019-04-14 22:58:11 +00:00

README.rst

Team and repository tags

image

Project description

Kubernetes integration with OpenStack networking

The OpenStack Kuryr project enables native Neutron-based networking in Kubernetes. With Kuryr-Kubernetes it's now possible to choose to run both OpenStack VMs and Kubernetes Pods on the same Neutron network if your workloads require it or to use different segments and, for example, route between them.

Contribution guidelines

For the process of new feature addition, refer to the Kuryr Policy