-
Notifications
You must be signed in to change notification settings - Fork 374
"docker run --sysctl ..." not supported #185
Comments
I think this could be good start point for contributors, adding a "help wanted" label 😄 |
Is this duplicate of #163 ? |
@caoruidong it looks the same to me. I think #163 has more info, and also has the |
The problem is that this issue is referenced by https://github.com/kata-containers/documentation/blob/master/Limitations.md#docker-run-and-sysctl. |
Ah, yeah, OK - let me copy some stuff over from #163 then, and then we can close that one instead... |
Copying info from #163, as a duplicate: From @sameo on May 11, 2017 13:57 From @mcastelino on April 12, 2017 0:46 Docker supports setting namespaced kernel parameters at runtime, runc honors this. We do not honor the same and report success
Copied from original issue: intel/cc-oci-runtime#817 Copied from original issue: containers/virtcontainers#246 From @sameo on May 11, 2017 13:57 From @mcastelino on April 12, 2017 1:8 Note that we can actually support the setting of more kernel configuration variables with clear containers as we have an independent instance of the kernel running inside the virtual machine. However we also need to communicate that the sysctl settings for Clear Containers are not propagated from the host. This non propagation will matter in the case of kubernetes (https://kubernetes.io/docs/concepts/cluster-administration/sysctl-cluster/) where certian unsafe sysctl settings can be safely performed in the case of clear containers. Also there are some parameters that are not namespaced for example
|
So we design to set the host's config or per container's? |
I took a look at this issue, to see what would be needed to support this. For k8s: Both allow only namespaced sysctls to be set. Broadly, those supported in k8s : (docker supports fewer I think) I have verified that since we simply pass the sysctl conf in the OCI spec file, all the kernel *sysctl are applied by the agent using the libcontainer library. For the net.* sysctls, libcontainer checks if a new network namespace has been created and only then applies the net* systcls. If it sees that if the container process is not running in a new net namespace, and a oci spec contains a net* sysctls, then it errors out. There are certain sysctls (eg sys.vm.map_cpu_count) that are not namespaced, so both docker and kubernetes dont whitelist them. @egernst Is this something, that has been already discussed/implemented for Runtime classes? |
@amshinde - no this has not come up yet -- runtimeClass has pretty limited capability right now. You're right that this would be an interesting advantage, though how to expose this to the end user will be difficult. These would be considered "node level" sysctls, AFAICT, and wouldn't be available to set explicitly via pod.spec? Can the end user just run a privileged container utilizing a kata runtimeClass in order to set in the guest, as a workaround? /cc @tallclair |
Yeah, I agree with @egernst. I'd recommend using a privileged init container to do this. |
Closing this, as we now support sysctls with Kata. |
Previously raised as clearcontainers/runtime#15.
The text was updated successfully, but these errors were encountered: