Skip to content

Conversation

euank
Copy link
Contributor

@euank euank commented Dec 2, 2016

After discussion with @philips and @vishh we settled on running the Kubelet in a chroot as being a fairly sane way to solve the problem of mount utility availability (among a couple others).

This proposal outlines a few more details of that idea and provides some alternatives.

Related issues: https://issues.k8s.io/19765, https://issues.k8s.io/16508, https://issues.k8s.io/35224, https://issues.k8s.io/35249 and others I'm sure.

cc @vishh @philips


Moved from kubernetes/kubernetes#35328 due to repo reorgianization, some context remains there.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 2, 2016
@philips
Copy link
Contributor

philips commented Dec 2, 2016

LGTM

hostPath volumes are managed entirely by the docker daemon process, including
SELinux context applying), so Kubelet makes no operations at those paths). This
will likely change in the future, at which point a shared bindmount of `/` will
be made available at a known path in the Kubelet chroot. This change will
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you think such a change will be intrusive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will require special-casing in kubelet code which isn't needed until then. I've tried to clarify this a little more.


#### Waiting for Flexv2 + port-forwarding changes

The CRI effort plans to change how [port-forward](https://github.com/kubernetes/kubernetes/issues/29579) works, towards a method which will not depend explicitly on socat or other networking utilities.
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't kubelet depend on other tools in addition to socat? ebtools is an example I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, as I call out in the downsides to this one with:

Finally, it's likely there are dependencies that neither of these proposals cover.

I've worded the downside more strongly and referenced issue 26093


#### Timeframe

1.6?
Copy link
Contributor

Choose a reason for hiding this comment

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

We can get started with testing right away. We can decide on a release based on the testing results.

@philips
Copy link
Contributor

philips commented Dec 20, 2016

@euank can you finish this up?

@philips
Copy link
Contributor

philips commented Dec 20, 2016

cc @lucab @jonboulle

@euank
Copy link
Contributor Author

euank commented Dec 20, 2016

Addressed @vishh's comments.

xref kubernetes/kubernetes#35249 which is one of the prerequisite steps for this. I'll pick that PR up again soon.

@@ -0,0 +1,199 @@
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need these warnings in this repo anymore.

Copy link
Member

Choose a reason for hiding this comment

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

please - I keep sending PRs to remove it..


#### Hyperkube Image Packaging

The Hyperkube image is distributed as part of an official release to the `gcr.io/google_containers` registry, but is not included along with the `kube-up` artifacts used for deployment.
Copy link
Contributor

Choose a reason for hiding this comment

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

See kubernetes/kubernetes#16508. Some of the current thinking here is to split the hyperkube container into a control-plane version and a node version. I'm thinking that this would be the node version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, the node version is relevant here, but I don't think there's any need to codify this observation here; it reads clearly enough either way and hyperkube has not been split yet.


This is different than running the Kubelet as a pod. Rather than using namespaces, it uses only a chroot and shared bind mounts.

## Alternatives
Copy link
Contributor

Choose a reason for hiding this comment

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

Another option/enhancement is to set up some simple resource cgroups so that we can ensure that we can be sure that the kubelet can keep running. On a heavily loaded system it would be nice to carve out some guaranteed elbow room for the kubelet. Full containerization (namespace+cgroup) wouldn't be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This proposal is primarily about handling kubelet dependencies, not resource management.

The kubelet should have appropriately configured cgroups, oom_score, etc, but that's out of scope of this proposal.

@vishh
Copy link
Contributor

vishh commented Dec 21, 2016 via email

@euank
Copy link
Contributor Author

euank commented Jan 20, 2017

@vishh any open issues on this from your side?

@vishh
Copy link
Contributor

vishh commented Jan 20, 2017

Nope. Let's get this done!! Thanks for spearheading @euank!

@vishh vishh added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2017
@vishh
Copy link
Contributor

vishh commented Jan 20, 2017

LGTM

@vishh vishh merged commit c64fdbf into kubernetes:master Jan 20, 2017
shyamjvs pushed a commit to shyamjvs/community that referenced this pull request Sep 22, 2017
Improve readability of rendered exception questionnaire
MadhavJivrajani pushed a commit to MadhavJivrajani/community that referenced this pull request Nov 30, 2021
proposals: add proposal for a chrooted kubelet
danehans pushed a commit to danehans/community that referenced this pull request Jul 18, 2023
According to valentine, Geeknoid has access, too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants