kubernetes/pkg
Kubernetes Submit Queue d2495b8329
Merge pull request #63143 from jsafrane/containerized-subpath
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Containerized subpath

**What this PR does / why we need it**:
Containerized kubelet needs a different implementation of `PrepareSafeSubpath` than kubelet running directly on the host.

On the host we safely open the subpath and then bind-mount `/proc/<pidof kubelet>/fd/<descriptor of opened subpath>`.

With kubelet running in a container, `/proc/xxx/fd/yy` on the host contains path that works only inside the container, i.e. `/rootfs/path/to/subpath` and thus any bind-mount on the host fails.

Solution:
- safely open the subpath and gets its device ID and inode number
- blindly bind-mount the subpath to `/var/lib/kubelet/pods/<uid>/volume-subpaths/<name of container>/<id of mount>`. This is potentially unsafe, because user can change the subpath source to a link to a bad place (say `/run/docker.sock`) just before the bind-mount.
- get device ID and inode number of the destination. Typical users can't modify this file, as it lies on /var/lib/kubelet on the host.
- compare these device IDs and inode numbers.

**Which issue(s) this PR fixes**
Fixes #61456

**Special notes for your reviewer**:

The PR contains some refactoring of `doBindSubPath` to extract the common code. New `doNsEnterBindSubPath` is added for the nsenter related parts.

**Release note**:

```release-note
NONE
```
2018-06-01 12:12:19 -07:00
..
api remove API dependency on printers 2018-05-21 13:46:53 -04:00
apis Merge pull request #63999 from mikedanese/validatetr 2018-05-31 21:29:17 -07:00
auth add myself as an approver in various auth related directories 2018-05-17 11:32:37 -07:00
capabilities
client Autogenerated code 2018-05-15 21:38:54 +02:00
cloudprovider Merge pull request #64528 from MrHohn/gce-backend-service-beta 2018-05-30 22:54:15 -07:00
controller Merge pull request #63839 from wgliang/master.movepkg 2018-06-01 12:12:15 -07:00
credentialprovider Use new clients in Azure credential provider 2018-04-26 09:38:48 +08:00
features Add feature gate for kubelet plugin watcher 2018-06-01 04:42:30 -04:00
fieldpath
generated Generated 2018-05-12 02:01:09 -04:00
kubeapiserver Merge pull request #64326 from andrewsykim/default-disable-pvl 2018-05-28 03:19:17 -07:00
kubectl Move pkg/scheduler/schedulercache -> pkg/scheduler/cache 2018-05-31 22:55:34 +08:00
kubelet Merge pull request #63143 from jsafrane/containerized-subpath 2018-06-01 12:12:19 -07:00
kubemark Remove signal handler registration from pkg/kubelet 2018-05-24 20:44:12 +01:00
master Merge pull request #63774 from wgliang/master.test-master 2018-05-31 14:12:18 -07:00
printers kubectl: Use apps/v1 Deployment/ReplicaSet. 2018-05-22 13:43:06 -07:00
probe
proxy Merge pull request #61077 from islinwb/fix_ipvs_warninfo 2018-05-31 20:01:26 -07:00
quota Resources prefixed with *kubernetes.io/ should remain unscheduled if they are not exposed on the node. 2018-03-28 17:24:30 -07:00
registry svcacct: validate min and max expiration seconds on TokenRequest 2018-05-30 17:32:49 -07:00
routes
scheduler Move pkg/scheduler/schedulercache -> pkg/scheduler/cache 2018-05-31 22:55:34 +08:00
security Replace UserIDRange/GroupIDRange by IDRange in internal type to reduce difference with external type. 2018-05-04 18:31:42 +02:00
securitycontext remove unused code in securitycontext 2018-03-29 23:32:48 -07:00
serviceaccount add myself as an approver in various auth related directories 2018-05-17 11:32:37 -07:00
ssh Use Dial with context 2018-05-19 08:14:37 +10:00
util Merge pull request #63143 from jsafrane/containerized-subpath 2018-06-01 12:12:19 -07:00
version
volume Merge pull request #63143 from jsafrane/containerized-subpath 2018-06-01 12:12:19 -07:00
watch/json
windows/service
.import-restrictions
BUILD
OWNERS