16 Commits

Author SHA1 Message Date
Roman Dobosz
ded6b6debc Removing six library.
Since we already migrated fully to Python3, it's time to also remove
bits needed for Python2. One of those libs is six.

Change-Id: Ib984d7b4b3c1048ed091c78986c634689a8ace8c
2020-02-28 14:45:46 +01:00
Alexey Perevalov
ca222d4f5b Use CNI_IFNAME environment variable
According to CNI spec kubelet expects CNI_IFNAME (the name
inside container) if sandbox is not empty.

Both python and golang implementation was done unconditionally,
IOW we can add both empty sandbox and interface name on the
host and nonempty sandbox and container's iface name.

Closes-Bug: #1835038
Change-Id: I3f21bc0c0790bb79ee81db361cd072609a0a3169
Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
2019-07-11 09:47:43 +03:00
Michał Dulko
3e3ed9dbb3 Remove way of running without kuryr-daemon
Deploying without kuryr-daemon is deprecated since Rocky and we
announced that it will be removed in the Rocky release notes. This
commit removes all the code that allows that, updates the documentation,
DevStack plugin and gates definitions.

Implements: blueprint remove-non-daemon

Change-Id: I65598d4a6ecb5c3dfde04dc5fefd7b02fc72a0cb
2019-02-04 12:53:00 +01:00
Michał Dulko
00eacbec85 Fix definition of CNIRunner.get_container_id()
Seems like base class method definition is missing `params` argument
that's present in it's implementations. This commit fixes that by adding
it.

TrivialFix

Change-Id: Idb4644956ad5c0cf4f6570da6e6e166b0d357f31
2018-11-26 10:52:40 +01:00
Alexey Perevalov
607a249e10 Proceed CNI output in format of version 0.3.1
Kuryr-kubernetes declares, that supported CNI version is 0.3.0, but
it prints to output in format of version 0.2.0.
Kubernetes can't parse it.
This patch modifies CNI output according to 0.3.1, it has a little
difference with version 0.3.0, just in naming of ips field.

Change-Id: I7b6bb5c178035b7c85fc28973f9a0cf1bc1a139e
Closes-Bug: 1779718
Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
2018-07-04 13:04:35 +00:00
Kirill Zaitsev
9115ab2c6b Allow passing multiple VIFs to CNI
This commit alters the format of the annotation, set and read by
controller/CNI. Instead of a single VIF object it now holds a
dictionary, that maps interface names to VIF objects. Controller
currently only sets 'eth0' as the default VIF. The CNI is altered
accordingly to read VIFs from the mapping and add all of them to Pods
namespace.

This commit does not include any mechanism to actually request multiple
IPs/ports for a Pod, but rather lays foundation for future commits, that
would allow that.

Related bp: kuryr-kubernetes-sriov-support
Targets bp: multi-vif-pods

Change-Id: Iaef928e7ab9dc0fce8b7e8fffb7b5a1f6b5ccb17
2018-05-25 16:02:37 +03:00
Luis Tomas Bolivar
bcacff60c9 Move cni plugins to a common folder
This patch moves the cni plugins that were split between api.py,
main.py and daemon/service.py to have then in a unified path.

Change-Id: Ief15e3f8a722237649dd5a1fb8c4e26f51143072
2018-03-02 16:04:00 +01:00
Michał Dulko
2f65d993f3 CNI split - introducing CNI daemon
This commit implements basic CNI daemon service. The aim of this new
entity is to increase scalability of CNI operations by moving watching
for VIF to a separate process.

This commit:
* Introduces kuryr-daemon service
* Implements communication between CNI driver and CNI daemon using HTTP
* Consolidates watching for VIF on CNI side to a single Watcher that
  looks for all the pods on the node it is running on.
* Solves bug 1731485 when running with CNI daemon.
* Enables new service in DevStack plugin
* Provides unit tests for new code.

Follow up patches will include:
- Documentation.
- Support for running in containerized mode.

To test the patch add `enable_service kuryr-daemon` to your DevStack's
local.conf file.

Partial-Bug: 1731485
Co-Authored-By: Janonymous <janonymous.codevulture@gmail.com>
Implements: blueprint cni-split-exec-daemon
Change-Id: I1bd6406dacab0735a94474e146645c63d933be16
2017-11-21 08:50:04 +01:00
Jenkins
c8ccd2ce9a Merge "logging: Improve CNI debug logging:" 2017-05-17 12:58:28 +00:00
Antoni Segura Puimedon
5fdcefba70
logging: Improve CNI debug logging:
Without this patch, when successfully exiting the CNI runner, we'd log
something like:

    2017-05-16 16:45:11.763 32397 DEBUG kuryr_kubernetes.cni.main [-] Exiting with status None run /usr/lib/python2.7/site-packages/kuryr_kubernetes/cni/main.py:96

After this change, we report the real exit status we'll give to the
kubelet:

    2017-05-16 16:56:14.750 33914 DEBUG kuryr_kubernetes.cni.main [-] Exiting with status 0 run /usr/lib/python2.7/site-packages/kuryr_kubernetes/cni/main.py:96

Change-Id: I10045ffa55128fe70151a5427d82535425a90ed4
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
2017-05-17 11:55:52 +02:00
Antoni Segura Puimedon
f2f695ad10
debugging: Add CNI env info to debugging log
Change-Id: Ibebd5f303abbbfd4b6566a29f997ac65f68551ad
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
2017-05-16 19:30:38 +02:00
loooosy
8382f15a85 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable. 2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I8fc14c9d933de74d9711289f441fe0ec4f86efb2
2017-05-10 07:02:06 +00:00
Jenkins
b0072c5816 Merge "Fix KeyError problem at cni/api.py when subnets have dns_nameservers" 2017-04-07 08:18:42 +00:00
Luis Tomas
02fdff72af Fix KeyError problem at cni/api.py when subnets have dns_nameservers
Change-Id: I6b451aaa484fa1bc49f68d59d0d19e57bb417a82
Closes-Bug: #1679719
2017-04-07 07:34:39 +00:00
shihanzhang
1d35146a46 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: If4735fc3ac1803585efd90657539e540d157a59a
2017-03-28 15:13:49 +08:00
Ilya Chukhnakov
fa03953aff Experimental CNI & VIFBridge binding
This patch provides an experimental CNI driver. It's primary purpose
is to enable development of other components (e.g. functional tests,
service/LBaaSv2 support). It is expected to be replaced with daemon
to configure VIF and connect it to the pods and a small lightweight
client to serve as CNI driver called by Kubernetes.

NOTE: unit tests are not provided as part of this patch as it is yet
unclear what parts of it will be reused in daemon-based
implementation.

Change-Id: Iacc8439dd3aee910d542e48ed013d6d3f354786e
Partially-Implements: blueprint kuryr-k8s-integration
2016-12-05 18:05:22 +00:00