Repository navigation
Description
I'm opening this issue to see if it makes sense to have the MCD be a component of the host operating system.
there are some benefits we would get from this. for one, we are currently discussing the need to have the daemon chroot/nsenter to make sure it can properly make changes to the host. it seems to me like it's a little silly to run a program in a container just to manually nsenter back into the host machine. since the MCD is required to manipulate the host machine in fundamental ways, it needs a lot of permissions and behavior like this to make sure it can, and even then I'm sure we will make mistakes and something won't work right.
there are some downsides as well -
if I understand it correctly, the update flow for openshift is - 1. cvo gets updated -> 2. cvo updates operators -> 3. operators update things under their control -> 4. those things reconcile the state they are responsible for
moving the daemon to the machine would mean that the daemon update moves from step 3 to step 4, but the controller stays in step 3, which means those things are liable to get out of sync, and perhaps forget how to communicate with each other if we are not careful. it seems like it would make us not able (or make it a lot harder) to make incompatible changes to the communication protocol, since the new controller has to update the old daemon. it also kind of subverts the intention of the operator/controller/daemon model we are using, since we move the responsibility of updating the daemon away from the operator to the version of the underlying os that we are using.
also, I don't know how much the daemon is going to get updated when the os is not getting updated, so I'm not sure if this will also increase the burdon on rchos to release more os updates then we would normally.
I guess the question I'm asking in this kind of rambling issue is: if we have to bend over backwards to put the daemon in a container, what is are the benefits, and do the benefits justify the unusual implementation and possible future pain?
/cc: @ashcrow since we had the initial discussion that precipitated this
/cc: @crawford @abhinavdahiya for thoughts (and maybe corrections)
Activity
ashcrow commentedon Aug 22, 2018
/cc: @lucab
ashcrow commentedon Aug 22, 2018
As noted, I share the same question. @lucab worked with me earlier today as we were talking about having MCD run within a container and how we would need to
nsenterw/chrootin golang feels way to magical. I'm not sure it would be worth it if we don't get a large boon from running the MCD in a container.dustymabe commentedon Aug 22, 2018
unless there are technical chicken/egg "gotcha" scenarios I'd be a fan of having it in the host.
jlebon commentedon Aug 22, 2018
Also note that there are gotchas associated with just bind-mounting the whole rootfs, e.g.: https://bugzilla.redhat.com/show_bug.cgi?id=1493267.
lucab commentedon Aug 23, 2018
For context for casual readears, this discussion is stemming from this PR review.
Things that we implicitly get from running as a k8s pod:
/metricsendpoint)In general, we are trying to push to have all non-necessary components handled by k8s so that they can be managed and scheduled in a uniform way. Breaking that barrier means being in a blind-spot (from a cluster point of view) and having to re-invent and catch-up higher level semantics.
This a valid concern though. Other teams are facing the same problems (e.g. the node-exporter needs to monitor the host rootfs) and "move all those things back to the host" is IMHO not a valid long-term solution.
eparis commentedon Aug 23, 2018
While it is easy for us to install the MCD on RHCOS the organization is very very strongly opposed to more things to install on BYOH. Doing the MCD as a container relieves the install/upgrade/maintenance burden from the customer and puts the burden for software management on Red Hat. This is where the burden belongs. If the immutable host team does chose to install the MCD on host, then the ummutable host team will be responsible for writing, maintaining, and supporting the code which will be required for customers to manage this task on BYOH as well.
Many operators and containers have to deal with the pain of mount namespaces, but from an end user perspective this model is consistent and much easier to manage. Unless there is a technical reason that the MCD is unable to run as a container I believe it should follow the architectural direction of openshift, even if that provides technically painful, but known, additional work.
ashcrow commentedon Aug 23, 2018
Tangential:
@eparis in terms of MCD on BYOH is there a group working on getting that functionality added?
@lucab
True. There is also the matter of the kubelet running on the host instead of in a container as well :-/
ashcrow commentedon Aug 23, 2018
I'd like to use the same patterns with other Openshift teams when it comes to solving this problem. In the meantime we may want to follow the path of least resistance. I'm not the biggest fan of copying to the host when the tradition is linking, but that seems a heck of a lot easier to maintain and debug than importing a magic cgo library.
ashcrow commentedon Aug 23, 2018
To close this off, @lucab and I sat down today and enumerated the different options we could use to keep the MCD containerized. Of them the simple
chrootpattern made the most sense at this point in time. I'm going to create a new set of work for executing an earlychrootin the MCD's life cycle so references and paths can be utilized without the additional cgo+magic required to fully enter the mount namespace.In the future we should revisit and find a good way for all Openshift containers which could benifet from switching namespaces without the need to bring an OS along in the container
smarterclayton commentedon Aug 23, 2018
I would expect the learnings from this team on how the MCD works on RHCoS to be the seed for MCD on RHEL. Ideally, the team would be thinking about how the specifics of MCD could apply to both, and then be able to communicate / educate others on it. I.e.:
When you guys are done with MCD, there will be no one in the world who knows it better and how it applies to an operating system. No matter who owns it on BYOH, you're going to be the folks who can make it possible for that to succeed.
sdemos commentedon Aug 23, 2018
Well, this seems to have been sufficiently considered.
I appreciate everyone's input on this! It cleared a lot of things up for me, and now I'm fully on board with having the MCD be containerized.