Skip to content

consider making MCD a component of the host #24

Closed

Description

@sdemos

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

  1. ashcrow commented on Aug 22, 2018

    @ashcrow
    Member

    /cc: @lucab

  2. ashcrow commented on Aug 22, 2018

    @ashcrow
    Member

    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?

    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 nsenter w/ chroot in 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.

  3. added
    triage/support
    on Aug 22, 2018
  4. dustymabe commented on Aug 22, 2018

    @dustymabe
    Member

    unless there are technical chicken/egg "gotcha" scenarios I'd be a fan of having it in the host.

  5. jlebon commented on Aug 22, 2018

    @jlebon
    Member

    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.

  6. lucab commented on Aug 23, 2018

    @lucab

    For context for casual readears, this discussion is stemming from this PR review.

    Things that we implicitly get from running as a k8s pod:

    • up-to-date secrets/client-config to talk to the API server
    • taint and annotation aware scheduling
    • cluster-wide network policing (e.g. for the /metrics endpoint)
    • log collection, discovery for telemetry
    • any kind of in-cluster customization/settings (e.g. proxy templating, CA store injection)

    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.

  7. eparis commented on Aug 23, 2018

    @eparis
    Member

    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.

  8. ashcrow commented on Aug 23, 2018

    @ashcrow
    Member

    Tangential:
    @eparis in terms of MCD on BYOH is there a group working on getting that functionality added?

    @lucab

    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.

    True. There is also the matter of the kubelet running on the host instead of in a container as well :-/

  9. ashcrow commented on Aug 23, 2018

    @ashcrow
    Member

    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.

  10. ashcrow commented on Aug 23, 2018

    @ashcrow
    Member

    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 chroot pattern made the most sense at this point in time. I'm going to create a new set of work for executing an early chroot in 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

  11. smarterclayton commented on Aug 23, 2018

    @smarterclayton
    Contributor

    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.:

    1. would update and reboot just be the same pattern on both
    2. when RHCoS hits a crazy failure mode that is unrecoverable, what does MCD do? If we assume BYOH would have more failure modes, is the only difference between the two a matter of how often it would happen (but use the same pattern for "halt catch fire")?
    3. can the code be structured so that it's about actions (update, rollback, converge, etc) and becomes a shell for a BYOH MCD just because it's the natural way to structure it?

    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.

  12. sdemos commented on Aug 23, 2018

    @sdemos
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/support

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions