Skip to content

Change root_maxkeys#23182

Merged
thaJeztah merged 1 commit intomoby:masterfrom
crosbymichael:maxkeys
Jun 27, 2016
Merged

Change root_maxkeys#23182
thaJeztah merged 1 commit intomoby:masterfrom
crosbymichael:maxkeys

Conversation

@crosbymichael
Copy link
Copy Markdown
Contributor

Fixes #22865

Most modern distros have the limit for the maximum root keys at 1000000
but some do not. Because we are creating a new key for each container
we need to bump this up as the older distros are having this limit at
200.

Using 1000000 as the limit because that is that most distros are setting
this to now. If someone has this value configured over that we do not
change it.

Signed-off-by: Michael Crosby [email protected]

Comment thread daemon/keys.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@crosbymichael I don't like this, because we're changing global distribution policy. There's almost certainly some side-effects -- I'd prefer if we made the keyring joining optional (as you mentioned in opencontainers/runc#818).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

optional but default so we still need something like this .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Basically the kernel shipped with the wrong policy and fixed it, but old distros won't change, so we should just fix it.

@crosbymichael
Copy link
Copy Markdown
Contributor Author

@justincormack what do you think about doing this change?

@justincormack
Copy link
Copy Markdown
Contributor

I wonder if the rpm or deb for the affected distros could have a file in
/etc/sysctl.d/dockerd instead? Plus docs for people doing installs
themselves and a warning? That seems the right place really, I don't really
like just changing it at startup much either, although there are precedents
(changing max file descriptors).
On 2 Jun 2016 22:52, "Michael Crosby" [email protected] wrote:

@justincormack https://github.com/justincormack what do you think about
doing this change?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#23182 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAdcPN5N5xs6e64kaxvuI1I_Pol4AS_hks5qH1CegaJpZM4IsGnt
.

@cyphar
Copy link
Copy Markdown
Contributor

cyphar commented Jun 3, 2016

@justincormack Changing max file descriptors isn't a global option. The root key limit is a global option. We'd probably be fine with packaging an /etc/sysctl.d/docker for SUSE (though we'd have to see what maintenance thinks about it).

@justincormack
Copy link
Copy Markdown
Contributor

Yes true, it is overriding policy set for our process though because we are
root and can, which I also don't like that much, even if it just affects us.
On 3 Jun 2016 08:42, "Aleksa Sarai" [email protected] wrote:

@justincormack https://github.com/justincormack Changing max file
descriptors isn't a global option. The root key limit is a global
option. We'd probably be fine with packaging an /etc/sysctl.d/docker for
SUSE (though we'd have to see what maintenance thinks about it).


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#23182 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAdcPNSsvBPkUPjlL3v1vZsg8Dbj21f1ks5qH9rigaJpZM4IsGnt
.

@crosbymichael
Copy link
Copy Markdown
Contributor Author

We change global network options at boot.

@crosbymichael
Copy link
Copy Markdown
Contributor Author

crosbymichael commented Jun 3, 2016

What is a better alternative then? I'm not sure i see it being too big of a problem because other distros are shipping with these limits, it seems like something is just being overlooked. What if we only bump with from 200 to something like 1024 and provide a flag on the daemon to change it?

dockerd --root-key-limit 2048

I don't think going from an overlooked 200 to 1k-2k is not going to destroy the world, no one even knew this existed until we turned on the feature and containers were capped.

@thaJeztah
Copy link
Copy Markdown
Member

Alternatively, we could output a warning when running docker info, providing the instructions to set this value (like we do for other features not being available / set)?

@justincormack
Copy link
Copy Markdown
Contributor

justincormack commented Jun 8, 2016

Yes, lets just do this, the other options are worse. SGTM.

Comment thread daemon/keys.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

missing a space "at least"

@crosbymichael crosbymichael force-pushed the maxkeys branch 2 times, most recently from 8463943 to 1ce7c58 Compare June 17, 2016 23:02
@crosbymichael
Copy link
Copy Markdown
Contributor Author

Modified this to also update the maxbytes for the root keys because you need both. The multiplier is a common 25 bytes per key

@justincormack
Copy link
Copy Markdown
Contributor

I think we can move this to code review as i was the only person unsure and I changed my mind...

@justincormack
Copy link
Copy Markdown
Contributor

LGTM when green

@crosbymichael
Copy link
Copy Markdown
Contributor Author

green

@thaJeztah thaJeztah added this to the 1.12.0 milestone Jun 18, 2016
@jessfraz
Copy link
Copy Markdown
Contributor

looks good to me

Comment thread daemon/keys.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: s/rootKeyByteMultiplyer/rootKeyByteMultiplier/ ?

@thaJeztah
Copy link
Copy Markdown
Member

one nit, but LGTM otherwise

Most modern distros have the limit for the maximum root keys at 1000000
but some do not.  Because we are creating a new key for each container
we need to bump this up as the older distros are having this limit at
200.

Using 1000000 as the limit because that is that most distros are setting
this to now.  If someone has this value configured over that we do not
change it.

Signed-off-by: Michael Crosby <[email protected]>
@crosbymichael
Copy link
Copy Markdown
Contributor Author

@thaJeztah fixed

@mlaventure
Copy link
Copy Markdown
Contributor

experimental is actually 💚 (that false reporting should be fixed by #24002)

@thaJeztah
Copy link
Copy Markdown
Member

you're right, let's merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants