Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mountPropagation: None equates to rprivate, not private #39385

Merged
merged 1 commit into from
Feb 12, 2023

Conversation

AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Feb 10, 2023

Evidences:


This commit also replaces the link to https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt with https://man7.org/linux/man-pages/man8/mount.8.html , as the former one does not mention rprivate .

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 10, 2023
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Feb 10, 2023
@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 10, 2023
@netlify
Copy link

netlify bot commented Feb 10, 2023

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 8355f38
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/63e78602b17be9000899a26c
😎 Deploy Preview https://deploy-preview-39385--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@tengqm
Copy link
Contributor

tengqm commented Feb 10, 2023

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 10, 2023
@sftim
Copy link
Contributor

sftim commented Feb 10, 2023

/sig node

This should have tech review by someone confident to check the evidence.

@k8s-ci-robot k8s-ci-robot added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Feb 10, 2023
@sftim
Copy link
Contributor

sftim commented Feb 10, 2023

/approve

FWIW

@reylejano
Copy link
Member

@kubernetes/sig-node-pr-reviews , can we have a tech review on this PR?

@endocrimes
Copy link
Member

I think we might need to reword this a little more - While cri-o and containerd do use rprivate, Kubernetes implementations that still support dockershim, or use cri-dockerd and forks (or other vendor provided cri's) may still be using private. (https://github.com/Mirantis/cri-dockerd/blob/9a87d6ae274ecf0f23776920964d6484bd679282/libdocker/helpers.go#L236)

This might need to become a "cri-o and containerd use rprivate, other cri's may use private" type change

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2023
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 11, 2023
@AkihiroSuda
Copy link
Member Author

AkihiroSuda commented Feb 11, 2023

I think we might need to reword this a little more - While cri-o and containerd do use rprivate, Kubernetes implementations that still support dockershim, or use cri-dockerd and forks (or other vendor provided cri's) may still be using private. (https://github.com/Mirantis/cri-dockerd/blob/9a87d6ae274ecf0f23776920964d6484bd679282/libdocker/helpers.go#L236)

This might need to become a "cri-o and containerd use rprivate, other cri's may use private" type change

/hold

No, cri-dockerd+dockerd never uses the private propagation. The comment line in cri-dockerd is wrong.

But you are right that the propagation isn't always rprivate, as dockerd conditionally changes the default propagation to rslave when the mount source containers the daemon root (/var/lib/docker):

---
apiVersion: v1
kind: Pod
metadata:
  name: propagation-test1
spec:
  containers:
    - name: sleep
      image: busybox
      command: ['sleep', 'infinity']
      volumeMounts:
        - mountPath: /mnt
          name: mnt
          mountPropagation: None
          # The mount propagation `None` is translated to:
          # - cri-dockerd v0.3.0, with Docker v20.10.23: rprivate
          # - containerd v1.6.15: rprivate
          # - CRI-O v1.24.1: rprivate
  volumes:
    - name: mnt
      hostPath:
        path: /mnt
---
apiVersion: v1
kind: Pod
metadata:
  name: propagation-test2
spec:
  containers:
    - name: sleep
      image: busybox
      command: ['sleep', 'infinity']
      volumeMounts:
        - mountPath: /mnt
          name: mnt
          mountPropagation: None
          # The mount propagation `None` is translated to:
          # - cri-dockerd v0.3.0, with Docker v20.10.23: rslave
          # - containerd v1.6.15: rprivate
          # - CRI-O v1.24.1: rprivate
          #
          # Docker changes the default propagation to "rslave",
          # because the mount source (`/`) contains `/var/lib/docker`.
          # - https://github.com/moby/moby/blob/v20.10.23/daemon/volumes.go#L137-L143
          # - https://github.com/moby/moby/blob/v20.10.23/daemon/volumes_linux.go#L11-L36
          #
          # This behavior was introduced in Docker 18.03: https://github.com/moby/moby/pull/36055
          #
          # containerd and CRI-O do not automatically change the propagation:
          # - https://github.com/containerd/containerd/blob/v1.6.15/pkg/cri/opts/spec_linux.go#L181
          # - https://github.com/cri-o/cri-o/blob/v1.24.1/server/container_create_linux.go#L967
  volumes:
    - name: mnt
      hostPath:
        path: /

Updated the PR to clarify this limitation.

Copy link
Member

@endocrimes endocrimes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 11, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: endocrimes, sftim, tengqm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 083ba25f6fd69dbfed9b566c8e2a7954eeeacd0e

@endocrimes
Copy link
Member

(leaving the unhold to someone from sig-docs)

@tengqm
Copy link
Contributor

tengqm commented Feb 12, 2023

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 12, 2023
@k8s-ci-robot k8s-ci-robot merged commit 17fcb2e into kubernetes:main Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

6 participants