This uses the Downward API to inject the runtime namespace of the
controller as an env var, rather than hard-coding it as 'vino-system'.
It then uses the runtime namespace to lookup the default DaemonSet
template, and then to co-locate the generated DaemonSet and bound
ConfigMap with the controller, so that a static service account can
be used by the DaemonSet, regardless of which namespace Vino CRs are
created in. The names of the generated objects are now uniquely
identified by the namespace/name of the Vino CR to avoid conflicts.
Some other future use cases for the injected runtime namespace could
include:
- create ipam CRs in the same namespace as the controller
- tenant namespacing, e.g. add a flag to limit the controller to only
watch for Vino CRs in the runtime namespace
Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: I47994782342c9c4ef749054017969386cefad3b8