简体   繁体   中英

Kubernetes pods: how to get pod stats?

I have some pods running a server:

NAME                            READY   STATUS    RESTARTS   AGE
hello-python-6c7b478cf5-hxfvb   1/1     Running   0          7m16s
hello-python-6c7b478cf5-rczp9   1/1     Running   0          7m16s
hello-python-6c7b478cf5-snww5   1/1     Running   0          7m16s
hello-python-6c7b478cf5-wr8gf   1/1     Running   0          7m16s

I would like to get some "stats" for a given pod. For example, what percentage of requests has a given pod been handling.

How do I do this with kubectl ?

What you can do is running kubectl describe pod <pod_name> -n <namespace_name> , but this won't you give the percentage of requests that have been handled through this pod (that should be divided quite evenly among the pods to be honest).

For more detailed stats, you can use something like metrics-server or prometheus . See some more information about monitoring Kube.netes resources in the documentation .

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