This commit changes the way we produce kuryr-cni Docker image. Previously we've
distributed the kuryr-driver as pyinstaller binary that contained Python 3
interpreter and all the dependencies. This binary was called from CNI. That
approach had some disadvantages, the major being complicated build procedure
and having to see false-positive BrokenPipeError tracebacks in kubelet
logs.
This commit implements distributing kuryr-driver as a virtualenv with
kuryr-kubernetes and all the dependecies installed. That virtualenv is then
copied onto the host system and CNI can easily activate it and run kuryr-cni
binary. This should solve issues caused by pyinstaller.
Closes-Bug: 1747058
Change-Id: I65b01ba27cbe39b66f0a972d12f3abc166934e62
This commit implements kuryr-daemon support when
KURYR_K8S_CONTAINERIZED_DEPLOYMENT=True. It's done by:
* CNI docker image installs Kuryr-Kubernetes pip package and adds
exectution of kuryr-daemon into entrypoint script.
* Hosts /proc and /var/run/openvswitch are mounted into the CNI
container.
* Code is changed to use /host_proc instead of /proc when in a container
(it's impossible to mount host's /proc into container's /proc).
Implements: blueprint cni-split-exec-daemon
Change-Id: I9155a2cba28f578cee129a4c40066209f7ab543d
Containerized deployment through DevStack had two bugs related to
mismatches in handling environment variables in Dockerfiles:
1. cni.Dockerfile was using ENV vars to define CNI bin and conf
directories, but when DevStack was building them it wasn't setting them
correctly. This resulted in CNI binaries and configs ending up
in wrong directories when deploying through DevStack. This is fixed by
passing $CNI_BIN_DIR and $CNI_CONF_DIR into the build function.
2. cni_builder script used $CNI_BIN_DIR_PATH, but it was only defined in
cni.Dockerfile and was is missing from cni_builder.Dockerfile. This
resulted in malformed kuryr-cni script, that pointed to non-existing
"/kuryr-cni-bin" file. This is fixed by adding those ENV vars to
cni_builder.Dockerfile
Change-Id: I4833124231f256b74f80bd5fee732686bffab77e
Closes-Bug: 1718137