Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

question from:https://stackoverflow.com/questions/65865924/measure-resource-utilization-per-container-in-a-kubernetes-cluster

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
443 views
Welcome To Ask or Share your Answers For Others

1 Answer

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...