-
Notifications
You must be signed in to change notification settings - Fork 270
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
importer pod Permission denied for Block storage #2638
Comments
Hello @yuntianfeijing, thanks for opening this issue. I think you are right in pointing out You can also check https://kubernetes.io/blog/2021/11/09/non-root-containers-and-devices/ for more context. Let us know if that helps! |
How can I config device_ownership_from_security_context = true in Docker? |
Hi @caijian76, That really depends on your container runtime, probably containerd since you are using Docker. You can check https://github.com/containerd/containerd/blob/main/docs/PLUGINS.md for more information about plugins in containerd. Remember, you need to add: [plugins]
[plugins."io.containerd.grpc.v1.cri"]
device_ownership_from_security_context = true |
Hi @alromeros version = 2 systemctl restart containerd.service but ,still show Permission denied |
Is your error the same as the one reported in this issue? (some information about your case and how you reproduce it could be helpful). If you do |
if your kubelet is using dockershim ,is not support the flag. containerd use the flag in cri server,but docker will not call it. |
THK all , I recommend that the development team indicate the operating environment in the manual to avoid confusion. |
Hi @caijian76, documenting all non-CRI compliant container runtimes might be out of scope for CDI, but I'll discuss with the team to see if we can improve that documentation. |
Why not use securityContext/fsGroup parameter to chown the volume? |
It's not recommended for reasons that could or couldn't be relevant to your case (see https://kubernetes.io/blog/2021/11/09/non-root-containers-and-devices/ for more information, the example there references issues with GPUs, not block devices). Still, I guess it's possible to workaround this with fsGroup as you mentioned. |
So fsGroup does not apply to block devices. We do in fact set fsGroup and the appropriate securityContext for the pods. But the fsGroup doesn't apply to block devices as noted in the blog post. |
Right, @awels thanks for the clarification! |
Are you suggesting to change the default CRI settings to make CDI work?? |
fsGroup like the name suggests applies to |
It perfectly applies to block devices in jupyterhub running in my cluster.
In which version? I just upgraded from 1.52.2 to 1.56.0, and I still don't see it in my securityContext:
|
I see now, it works when setting |
When I say block device I mean |
Hello, I got the same issue. And being blocked. Here is my error
|
And here is
|
Which CRI are you using? containerd? Also which version of CDI |
Hi @awels , Thx for your quick reply here is my env info: OS: linux (amd64) CDI status: |
Please read this article https://kubernetes.io/blog/2021/11/09/non-root-containers-and-devices/ it is highly likely that is your problem. Essentially there is no |
Hi @awels , add following plugin works for me. Thanks again.
For later ones who have same issue. |
It seems that this issue has been resolved so I will close it. |
What happened:
when I set pvc as:
the importer pod get error:
What you expected to happen:
I think This is caused by securityContext setting runAsNonRoot: true and runAsUser: 107
How to reproduce it (as minimally and precisely as possible):
Steps to reproduce the behavior.
Additional context:
Add any other context about the problem here.
Environment:
kubectl get deployments cdi-deployment -o yaml
): v1.56.0kubectl version
): N/Auname -a
): N/AThe text was updated successfully, but these errors were encountered: