-
Notifications
You must be signed in to change notification settings - Fork 1k
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
cannot use Bidirectional mountPropagation #1680
Comments
/cc @william-wang Please help take a look. THX. |
Hello 👋 Looks like there was no activity on this issue for last 90 days. |
We also meet the same problem in our production environment. It seems the reason is the validation in admission controller, i.e this block in admit_job.go: // Skip verify container SecurityContex.Privileged as it depends on
// the kube-apiserver `allow-privileged` flag.
for i, container := range coreTemplateSpec.Spec.Containers {
if container.SecurityContext != nil && container.SecurityContext.Privileged != nil {
coreTemplateSpec.Spec.Containers[i].SecurityContext.Privileged = nil
}
} It will will return an error at privileged := container.SecurityContext != nil && container.SecurityContext.Privileged != nil && *container.SecurityContext.Privileged
if *mountPropagation == core.MountPropagationBidirectional && !privileged {
allErrs = append(allErrs, field.Forbidden(fldPath, "Bidirectional mount propagation is available only to privileged containers"))
} And we have temporarily solved this problem in our internal environment. func init() {
capabilities.Initialize(capabilities.Capabilities{
AllowPrivileged: true,
PrivilegedSources: capabilities.PrivilegedSources{
HostNetworkSources: []string{},
HostPIDSources: []string{},
HostIPCSources: []string{},
},
})
} But I'm not sure about is there any risk in this solution. Why volcano would skip verify container Is there any suggestions ? @Thor-wl |
Same problem encountered, temporarily set |
Thanks for the report. I've added important label for this issue. Will take a priority to do a check. |
Hello 👋 Looks like there was no activity on this issue for last 90 days. |
Hi, I'm sorry for reply late. I've taken a look at releated history of the commits. Just as @LuBingtan mentioned above, it takes a check about priviledged containers. It depends on the configuration of kube-apiserver. I agree with @LuBingtan 's advice. Perhaps we can add a flag such as |
I've added a parameter |
Besides, I notice that issue2123 has discussed about this problem. Another approach is to ignore privilege container check in volcano admission webhook for it has already been checked by kube-apiserver before. What do you think about the 2 solutions? @junhuihuang @LuBingtan @yuyue9284 |
As the kube-apiserver already check it. No need to check it in Volcano. It's inconvient for some users to check the api-server configuration and then keep volcano the same with apiserver, e.g. user use the k8s managed by cloud provider. |
I'm a little confiused about this issue? Did we skip "privilege" in Volcano right now? If skipped, why do we still have such kind of erro? |
We skiped "privilege" by setting |
Because of the the force convert from privilege containers to common containers, which are introduced from PR411 and PR2125, |
What happened:
Error from server: error when creating "helloworld.yaml": admission webhook "validatejob.volcano.sh" denied the request: spec.task[0].template.spec.containers[1].volumeMounts.mountPropagation: Forbidden: Bidirectional mount propagation is available only to privileged containers.
What you expected to happen:
Can be created
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
pkg/webhooks/admission/jobs/validate/admit_job.go#validateTaskTemplate()
reset privileged to nilEnvironment:
kubectl version
):uname -a
):The text was updated successfully, but these errors were encountered: