-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
kubelet's cAdvisor binds to all interfaces #11710
Comments
What type of cluster are you running (GKE, or what instructions did you use to setup your cluster?) A short term solution might be to try adding Doing this may the UI and heapster which expect to be able to poll the cadvisor port. I think @dchen1107 probably knows if there is a longer term solution planned, such as:
|
Self deployed cluster, the kubelet is started via
|
We are working on improving the kubelet APIs which will subsume cadvisor APIs. Until then setting cadvisor port to '0' is probably the way to go. |
@vishh Is there an issue and target date for doing this? |
Filed #12483. The current plan is to complete this for v1.1. cc @dchen1107 |
@philips Do you mean the read-only kubelet port (10255 by default IIRC)? If so, then we really need to disable this & provide authorisation options on the kubelet to be able to retrieve stats fro the kubelet via the normal port with a restricted token/cert/auth options. We've discussed this for OpenShift (openshift/origin#3020) too. |
@philips Sorry I didn't realise that cadvisor was bound to port 4194 as well. Thought this was all embedded inside the kubelet process without exposing any ports. |
@vmarmol @vishh Any reason why we start up cadvisor http server at all? https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/cadvisor/cadvisor_linux.go#L99-L103 Seems unnecessary now kubernetes embeds cadvisor & exposes via |
Couldn't we just add cadvisor as a handler in the kubelet anyway? No need for separate http server & would mean access to raw data is available if anyone wants it. |
Indeed that is an option. But we need a better stats API in kubelet anyways for reasons mentioned in #12483. |
Absolutely agree but thinking quick win. |
+1 on a quick win. We just disabled it by default instead: https://github.com/coreos/coreos-overlay/blob/master/app-admin/kubelet/files/kubelet.service Which reminds me it would be great to have #12418 so we could make it easy to turn on/off stuff like this w/o rewriting the entire command-line in a service file. |
cc @timstclair |
@vishh it's not 100% clear to me whether or not #12483 made it safe to use
|
Ahh. That's a bug that the new component config based defaulting scheme introduced. |
I think we can change this. The KubeletConfiguration type is still technically alpha, so it should be ok to make this field a pointer and keep the current default when it's not provided (but allow 0). This won't affect anyone who presently omits the flag and expects port 4194. Theoretically people could be explicitly passing 0 and expecting 4194... I guess... but that's sort of an insane case, and I'd consider that behavior a bug. |
Thanks for clarifying guys 👍 |
Yeah. We can get cAdvisor to bind to the interface that kubelet uses. cc
@dashpole
…On Tue, May 30, 2017 at 2:12 PM, Antoine Cotten ***@***.***> wrote:
Thanks for clarifying guys 👍
The original problem remains though: enabling the cAdvisor port makes the
kubelet listen on all interfaces.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11710 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGvIKGIzE7fl8peIbwTD58hk4wBv0r8_ks5r_IZKgaJpZM4Fd8NE>
.
|
Automatic merge from submit-queue (batch tested with PRs 46787, 46876, 46621, 46907, 46819) Fix cAdvisorPort, 0 is a valid option wrt #11710, this maintains the current default if nobody provides the flag, but allows explicitly passing 0. /cc @farcaller @vishh @liggitt @antoineco @philips /assign @liggitt @vishh ```release-note Fixes a bug with cAdvisorPort in the KubeletConfiguration that prevented setting it to 0, which is in fact a valid option, as noted in issue #11710. ```
cAdvisor currently binds to all interfaces. Currently the only solution is to use iptables to block access to the port. We are better off making cAdvisor to bind to the interface that kubelet uses for better security. Fixes kubernetes#11710
/assign |
Automatic merge from submit-queue (batch tested with PRs 47922, 47195, 47241, 47095, 47401) Run cAdvisor on the same interface as kubelet **What this PR does / why we need it**: cAdvisor currently binds to all interfaces. Currently the only solution is to use iptables to block access to the port. We are better off making cAdvisor to bind to the interface that kubelet uses for better security. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # Fixes #11710 **Special notes for your reviewer**: **Release note**: ```release-note cAdvisor binds only to the interface that kubelet is running on instead of all interfaces. ```
cAdvisor provides potentially sensitive data and there's currently no way to block access with anything other than iptables.
The text was updated successfully, but these errors were encountered: