-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Standalone cAdvisor for monitoring #18770
Comments
cc @kubernetes/rh-cluster-infra |
if we're going forward with collecting the non-core metrics using a separate cadvisor pod, how will the metrics information be exposed to collectors such as heapster? Will kubelet provide a directory service that helps heapster find where cadvisor pod can be accessed or will kubelet act as a middle-man (similar to the way the code works today) that gets metrics from cadvisor and servicing them out to heapster? |
Heapster will have to get metrics from cAdvisor directly. Heapster can On Fri, Dec 18, 2015 at 2:58 PM, Hai Huang notifications@github.com wrote:
|
So are you expecting cadvisor pod to be a daemon set? |
Yes On Fri, Dec 18, 2015 at 3:07 PM, Jimmi Dyson notifications@github.com
|
How will heapster find the port that cadvisor listens to? If each cadvisor is running in a separate pod, it could be mapped to different host port on different host. |
Host port is not required. Remember Pods can talk to each other directly ;) On Fri, Dec 18, 2015 at 4:45 PM, Hai Huang notifications@github.com wrote:
|
OK, I just saw that you're expecting cadvisor pods to be running as a daemon set, so the host ips are known to the heapster pod collecting the metrics information. Reading how to communicate with a daemon set, I found some information here: https://github.com/kubernetes/kubernetes/blob/master/docs/admin/daemons.md#communicating-with-daemonset-pods, and it says
I take it this means cadvisor will need to listen to the same port on every host, e.g., 4194, so whoever is communicating with it knows how to find it. Or it has to register with DNS. |
I was not suggesting using services. I was instead suggesting using the |
How will the consumer of such metrics get the list of Pod IPs of cadvisor Pods? Sorry if I missed this being already described somewhere. |
I like the idea of making cAdvisor standalone, but I have a few questions:
|
Hi, @feiskyer , Some of my opinions
In my opinion, cAdvisor running as a pod(maybe with daemon set) is more better than running standalone. If a daemon pod is killed or stopped, the DaemonSet will create a new replica of the daemon pod on the node. This pod can be managed by kubernetes.
Maybe, we can get the cAdvisor list by "get" and "describe" commands of "DaemonSet " |
@huangyuqi For some container runtimes, e.g. Hyper, cAdvisor must be running outside of a pod. |
IMHO I would like to do this, if only to cap the CPU usage of the pod for maximum density. |
In #18769 I'm trying to make the metrics/health collector (currently using a built-in cadvisor) a pluggable interface, which allows users to choose if k8s should use cadvisor running in build-in mode, pod mode, or standalone mode. Furthermore, one could also plug in one's favorite monitoring tool, other than cadvisor. That should complement this really well. |
Yeah. The idea is to run it as an optional DaemonSet.
cAdvisor's APIs are not discoverable like that of Kubernetes APIs. We intend to fix that. Until then, heapster will be hardcoded to query specific cAdvisor APIs. |
@timothysc: I assume that cAdvisor will be run by default on all OpenShift clusters. If thats true, it is important to optimize not only the kubelet, but cAdvisor as well. Separating them will help us with performance measurements, but otherwise the work that needs to go in for optimizing resource consumption has to happen anyways. |
On hyper's use case, we have to provide a way to run cAdvisor as a daemon on the host node, similar to Kubelet. |
@dchen1107 to be sure I understand, you're saying that we should make it possible to run directly on the host node, but it's still okay if the default way to run it is as a pod, as discussed above in this issue? As an aside, I suspect that |
We could avoid making Heapster handle two sources if we say that the non-core monitoring agent must supply a super-set of the metrics provided by core cAdvisor (either by fetching from core cAdvisor and merging with its own metrics, or something else). |
xref: #27097 (comment) re @davidopp's comment: Yes, non-core monitoring agent should supply the super-set of the metrics provided by core cAdvisor which is defined at https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/api/v1alpha1/stats/types.go |
re @euank's comment: #18770 (comment) What I mentioned above of running cAdvisor directly on the host node is an intermediate workaround to support hyperContainer before we prioritized today's container runtime effort. But now the story is changed, especially at #27097 (comment), I tried to re-define what the core metrics is: node-level and pod-level. If we agreed upon that (I think we are largely convergent already), I think running containers within a pod in a hyper or as native pod on the host node is punted to hyper runtime implementation, neither part of kubelet core system, nor cAdvisor config. |
Issues go stale after 30d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
As of Kubernetes v1.1, and possibly v1.2 as well, cAdvisor is linked into kubelet.
Kubelet groups detailed cAdvisor metrics into pods and nodes and exposes them via REST endpoints (
/stats
)Monitoring is resource intensive. There are currently several issues filed against kubelet around resource usage which are mostly related to cAdvisor's resource consumption.
Support for custom metrics adds significant resource overhead to kubelet.
Not all users of kubernetes need cAdvisor for monitoring.
Kubelet will need just a few metrics for its functionality. Specifically, cpu usage, memory usage, and filesystem usage for now. These metrics are needed for scheduling and other cluster functionalities.
By separating out cAdvisor monitoring agent from kubelet, users can choose to run cAdvisor as a standalone container and get a lot more detailed metrics.
This split will let us optimize resource impact of kubelet and cadvisor independently.
cAdvisor can expose potentially expensive metrics as well.
For the basic metrics that kubelet needs, it will embed specific libraries from cAdvisor and compute those metrics internally.
cAdvisor needs to be enhanced to support pods. To make this easier, kubelet should expose the pods that it is currently managing via some API. (#9473 talks about one such API)
cc @dchen1107 @timstclair @kubernetes/goog-node @jimmidyson @jszczepkowski
The text was updated successfully, but these errors were encountered: