{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/10176","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/10176/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/10176/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/10176/events","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/10176","id":90091312,"number":10176,"title":"RFC: Use containers to mount Kubernetes volumes","user":{"login":"jsafrane","id":1745006,"avatar_url":"https://avatars.githubusercontent.com/u/1745006?v=3","gravatar_id":"","url":"https://api.github.com/users/jsafrane","html_url":"https://github.com/jsafrane","followers_url":"https://api.github.com/users/jsafrane/followers","following_url":"https://api.github.com/users/jsafrane/following{/other_user}","gists_url":"https://api.github.com/users/jsafrane/gists{/gist_id}","starred_url":"https://api.github.com/users/jsafrane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsafrane/subscriptions","organizations_url":"https://api.github.com/users/jsafrane/orgs","repos_url":"https://api.github.com/users/jsafrane/repos","events_url":"https://api.github.com/users/jsafrane/events{/privacy}","received_events_url":"https://api.github.com/users/jsafrane/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones/11","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/milestones/v1.0-post","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/milestones/11/labels","id":1035380,"number":11,"title":"v1.0-post","description":"Things that are triaged and decided not for inclusion to v1.0","creator":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/received_events","type":"User","site_admin":false},"open_issues":479,"closed_issues":91,"state":"open","created_at":"2015-03-23T22:54:17Z","updated_at":"2015-07-16T14:12:01Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2015-06-22T12:57:30Z","updated_at":"2015-07-16T16:22:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/pulls/10176","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/10176","diff_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/10176.diff","patch_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/10176.patch"},"body":"On limited docker hosts, such as CoreOS or Atomic Host, one cannot easily install utilities that are necessary to mount various filesystems such as Gluster. This PR contains a proof of concept how to use containerized mount tools to mount Kubernetes volumes. It's just to gather some feedback, some parts are missing on Docker side (see below).\r\n\r\n## Design\r\nIn order to mount a Kubernetes volume from a container we must:\r\n1. Find a way, how a container can mount stuff, which is then visible to the host and other pods/containers.\r\n  - There is [a little container](https://github.com/rootfs/install-glusterfs-on-fc21) with 'magic' ld.preload.so. This is pretty ugly solution, but it's good enough to test this proof of concept.\r\n  - There is [Docker PR](https://github.com/docker/docker/pull/14097) to implement a new Docker option not to fork mount namespace, so all mounts done by a container will be visible to the host.\r\n\r\n2. Kubernetes need to maintain so-called mount pods, where the mount utilities like `mount.gluster` or `mount.ceph` will be installed. It must run these pod(s) on every node.\r\n  - [Static pods](https://github.com/GoogleCloudPlatform/kubernetes/pull/10093) were used for testing of this proof of concept.\r\n  - Any other way can be used, e.g. #1518 when it's implemented.\r\n\r\n3. Kubernetes must be taught to use these mount pods to mount volumes. **That's the code in this PR**.\r\n  It's actually quite simple, appropriate mount commands are executed in context of appropriate mount container, like `docker exec <mount container ID> mount -t <fs> <what> <where>`. Some new kubelet command line options were introduced to tell kubelet what pods/containers to use for what filesystems. E.g. for mounting of Gluster stuff using the pod with label `name=mounter` and container named `glusterfs`, one would start kubelet in this way:\r\n  \r\n  ```\r\n  kubelet --volume-mounter=container --mount-container=glusterfs:name=mounter:glusterfs\r\n  ```\r\n  \r\n    \r\n\r\n## Further steps\r\n\r\nThis code is just a proof of concept. Some steps may be necessary to make it production ready:\r\n- Kubelet configuration is ugly, is there a way, how to configure them globally?\r\n- Think hard about security.\r\n- Combine it with NsenterMounter when kubelet itself runs inside a container. Now `kubelet` does plain `/bin/unmount` to destroy volumes, we may need `nsenter /bin/umount`."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/122009861","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/pull/10176#issuecomment-122009861","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/10176","id":122009861,"user":{"login":"pmorie","id":366488,"avatar_url":"https://avatars.githubusercontent.com/u/366488?v=3","gravatar_id":"","url":"https://api.github.com/users/pmorie","html_url":"https://github.com/pmorie","followers_url":"https://api.github.com/users/pmorie/followers","following_url":"https://api.github.com/users/pmorie/following{/other_user}","gists_url":"https://api.github.com/users/pmorie/gists{/gist_id}","starred_url":"https://api.github.com/users/pmorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmorie/subscriptions","organizations_url":"https://api.github.com/users/pmorie/orgs","repos_url":"https://api.github.com/users/pmorie/repos","events_url":"https://api.github.com/users/pmorie/events{/privacy}","received_events_url":"https://api.github.com/users/pmorie/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T16:22:47Z","updated_at":"2015-07-16T16:22:47Z","body":"@jsafrane Okay, you've got me on the fence.  I'm trying to think about whether there's any reason not to just try to make this work by running the container in the host's mount ns."}}