Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
436 views
in Technique[技术] by (71.8m points)

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?

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

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

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...