Skip to content
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

About CRI metrics of virtlet-based pod. #723

Closed
miaoyq opened this issue Jul 17, 2018 · 8 comments
Closed

About CRI metrics of virtlet-based pod. #723

miaoyq opened this issue Jul 17, 2018 · 8 comments

Comments

@miaoyq
Copy link
Contributor

miaoyq commented Jul 17, 2018

Now, k8s mainly uses cAdvisor to collect container performance metrics, and the runtimes that are not included in the cAdvisor, if they have implemented ContainerStats of CRI, also can collect some of metrics.

At present, we need to autoscale Virtlet Pods according to the resource usage of VM. However, virtlet has not yet implemented the ContainerStats of CRI, and there is no Virtlet Pod metrics data collection in cAdvisor also.

Are we going to implement the CRI metrics in the near future?
At present, how can I get the ContainerStats(VM metrics) of Virtlet-Based Pod?

In addition, k8s achieves the Images garbage collection by collecting the disk usage of the container/image. Is there any way to collect the Virtlet image?

Hope to get someone's help, thank you very much!

@guangxuli
Copy link

@jellonek Any suggestion?

@jellonek
Copy link
Contributor

We don't have at the moment this topic on our agenda, but contributions are welcomed.

CPU stats could be probably gathered from libvirt in similar manner to https://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Guest_Domains-Monitoring-vCPU.html
Memory is also very similar: https://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Guest_Domains-Monitoring-Memory.html
At the moment I don't know if they have equivalents in used by us https://github.com/libvirt/libvirt-go-xml

As for image, imo we should return only Allocation value of root disk.

@jellonek
Copy link
Contributor

Ok, we have that on our agenda (i missed it) and probably in near future i'll start working on that.

@jellonek
Copy link
Contributor

Filesystem stats were implemented in #735
Runtime part is in PoC form in #743 - and should be finished in more proper way soon.

Can you verify if that works for you, by testing mirantis/virtlet:jell_rtstats image from docker hub? (it's poc because it has a little simplifications if few places and lacks a proper coverage which i'm doing right now, but core functionality should work).

@miaoyq
Copy link
Contributor Author

miaoyq commented Aug 23, 2018

@jellonek OK, Thanks for this feature. :-)

@jellonek
Copy link
Contributor

All of that is already merged and included in last release.

@lukaszo
Copy link
Contributor

lukaszo commented Sep 20, 2018

@MiaoY please note that when Virtlet is used together with docker you still will not be able to get VMs stats using Kubelet Summary API. It's because how kubelet is designed.

If you want to get Virtlet VMs stats using Summary API then you need to switch to containerd. You can also just directly call ContainerStats then it will work everywhere.

@jellonek
Copy link
Contributor

jellonek commented Sep 20, 2018

Directly - means on the node using CRI call on virtlet unix socket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants