Repository navigation
Conversation
There was a problem hiding this comment.
Two things. This test doesn't compile, and seems it should be net.ipv4.ip_forward=1
|
design ok for me |
There was a problem hiding this comment.
This field in the daemon configuration is not necessary, is it?
There was a problem hiding this comment.
No removed. Patch built off of Ulimits patch and don't think we need options for the daemon. Left this by mistake.
|
Tests should be fixed. |
|
net.ipv4.ip_forward=1 makes more sense but the other form worked also. |
|
@rhatdan Yup, you're right. It's bug though. |
There was a problem hiding this comment.
This should be strongly typed.
There was a problem hiding this comment.
This I would still prefer to see at least as a map[string]string rather than splitting on = to hand off to the exec driver.
Thoughts from anyone else?
There was a problem hiding this comment.
I have no problem changing it to this, if others agree.
|
Is there a list somewhere of namespaced sysctl's? |
|
@mrunalp Cool, thanks! |
|
@cpuguy83 Yeah, we could expose a list of valid sysctls via a utility function that could be used both here and in runc/libcontainer. |
|
@mrunalp Also, I think that sysctls with |
|
Once we have a libcontainer function for docker to call to verify the validity of the syscall, I will add it to this code. One problem with the validation, is that the list is likely to change depending on the kernel you are using. We could end up blocking valid sysctl's, and eventually allowing some that will not work on the kernel. Most cases the kernel will probably reject the sysctl. |
|
@jeremyeder do syscalls take anything other then integers? Do they ever take strings? |
|
@cpuguy83 Seems like sysctl can pass strings. So not sure we can strongly type the values. But we can check if the syscall is supported. |
|
oh yes they take strings. for example modify kernel.core_pattern in RHEL. |
|
@cpuguy83 IMO, having a string to string hash makes the most sense. If there is an invalid value, then we get back invalid argument error trying to write it under /proc/sys |
|
This makes sense. |
|
#4717 has other examples. |
|
See #4717 |
|
We have another customer requesting
File descriptor settings, both via ulimit settings and fs.file-max parameter. Network parameters as well, at least: net.ipv4.tcp_rmem |
|
We also need shmmax / shmall. |
|
@crosbymichael Any word on this? |
This patch will allow users to specify namespace specific "kernel parameters" for running inside of a container. Dan Walsh <[email protected]> Signed-off-by: Dan Walsh <[email protected]>
|
I'm -1 on this. There is currently too much room for user error to mess things up. If you know what settings to make on these then you can exec into your container and set them yourself. |
|
That's true, now that we have |
|
Using exec is racy though as the container process could fail due to not having the right ipc sysctls set for e.g. before the exec is even called. |
|
So is there no road forward on this? There is potential race conditions, where you could not get in, on time to set the sysctl, if pid 1 needed the access. |
|
Seems to lots of ways for users to screw up their system, if they do not know what they are doing. Not sure why I would block just this way. |
|
I think there is a general agreement that this is potentially dangerous for users. It looks like other maintainers also agree with that feeling. Sorry, but I'm going to close this PR and we won't move it forward. |
|
We are hearing a lot from customers about the need for this. If we add validation would the pull request be reconsidered? @calavera @crosbymichael Reopen opencontainers/runc#303 for runc and then add validation on the cli side also. |
|
I think opencontainers/runc#303 is a good list and should open up setting many sysctls that are useful in a container. |
|
Hi. This is one customer that thinks that this is an absolutely needed feature. Otherwise, some technologies like redis are at risk of DoS when running in a container. |
|
I still believe this is going to be a cause for user confusion when they realize sysctls are not namespaced |
|
@jfrazelle We are proposing that there be a whitelist like in the runc PR and then we can return a nice error message to the user when they try to set something that isn't namespaced. A lot of container applications need to tune the network sysctls (which are namespaced) and not allowing this feature is an adherent to containerizing such applications. |
|
ok that seems more reasonable :) On Mon, Jan 11, 2016 at 4:45 PM, Mrunal Patel [email protected]
|
|
Right we can document the sysctls that are currently available and then expand the list as the kernel evolves. Can we get this pull request reopened, or should I open a new one? |
|
@rhatdan looks like the branch was updated/force-pushed while it was closed, so GitHub doesn't allow me to reopen the PR |
|
Ok I will open a new pull request |
|
Is there an issue to support the |
|
@mnp If you test these out and find that they are namespaced (which I doubt they are, but maybe), then you can create an issue. |
|
@cpuguy83 Yes, by testing only, it does not seem that fs.* are namespaced in our 3.10 centos kernel at least. Containers inherit the host settings. Thanks. |
This patch will allow users to specify namespace specific "kernel parameters"
for running inside of a container.
Dan Walsh [email protected]
Signed-off-by: Dan Walsh [email protected]