简体   繁体   中英

measure resource utilization per container in a Kubernetes cluster

I'm planning to launch a Kubernetes cluster with multiple types of images in terms of how compute/memory intensive they are. Also, the same image may use varying levels of cpu/memory depending on the input parameters when running it as a container. These containers are ran in a multi tenant environment that there are multiple users, running multiple containers with different inputs. Is there a way to measure how much resource each container use during it's run so that each user can be charged for the total amount of infrastructural resources their containers use?

To analyze resource usage and performance characteristics of running containers you can use cAdvisor . Is is built-in into kubelet and is already running an all your k8s nodes so you don't need to install it.

It's metrics are exposed using prometheus format, so they can be scraped by prometheus.

You can also check out the prometheus helm charts that can deploy a whole stack for you.

Additionally, you may want to learn promethus query language or search for already made grafana dashboards that display this metrics to you and check out how they query.

Also check out this blog post: managing-your-costs-on-kubernetes

If you are interested in paid solutions checkout the kubecost (I'm not affiliated, just found it and thought you might find it usefull).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM