-
Notifications
You must be signed in to change notification settings - Fork 1.9k
How to read metrics kubectl top nodes/pods
?
#193
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
Comments
ok, so on the subject of milliunits: https://github.com/DirectXMan12/k8s-prometheus-adapter/blob/master/docs/walkthrough.md#quantity-values or https://github.com/kubernetes-incubator/custom-metrics-apiserver/blob/master/docs/getting-started.md#quantities explains. on the subject of what the values actually mean:
|
@DirectXMan12 thanks for the explanation, that makes more sense now. However, I would be happy if the documentation for metrics server could contain a description of the units. |
I'd be happy to accept a PR to update the docs :-). |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@DirectXMan12 , I would like to update the docs, I looked in this repo and also in https://github.com/DirectXMan12/k8s-prometheus-adapter/tree/master/docs but I'm not sure if that is the correct place. |
Since this thread appears in search results, the docs seem to be updated at: |
I can understand the concept of units, requests, limits and actuals, but have a hard time to reconcile the 'kubectl top' output with that of "traditional linux commands", e.g., uptime (load everages of past 1, 5, and 15 minutes), free (memory used, free, shared, buff/cache, available), top ('uptime' + 'free -k', then VIRT/RES/SHR memory and %CPU/%MEM on processes). One question on the kubectl top commands is for what time period it is reporting? When samples are taken and what samples are rolled up for the output? On the other hand, Linux commands always report the state at the time the command is executed, and they include non-kubernetes processes. The understanding would have impact on managing the resource utilization and the stability of kubernetes. We have random node crashes, suspecting resource crunch, but the utilization numbers are usually low. Kubernetes require us to turn off swapping, which can be a contributing factor because no swapping means no wiggle room in memory overruns, and wasted inactive contents occupying memory. |
Hey @wu105, Main purpose of metrics pipeline is delivering metrics for autoscaling purposes. Values exposed are curated to autoscaling and OOM detection. Building autoscaling pipeline that can scale to thousands of nodes has different requirements than collecting accurate resource usage that you talk about. Please take a look at new FAQ section for metrics server. https://github.com/kubernetes-sigs/metrics-server |
I would encourage you to look into monitoring systems like Prometheus that are closer to what your describing. |
Submitted #447 |
How to read the metrics created by
kubectl top nodes
andkubectl top pods --all-namespaces
?Environment
I am running an AWS EKS cluster on a single EC2 t3.large instance (VM). The instance has 2 vCPU and 8 GiB Memory. vCPUs are virtual CPUs. T3 instances can burst for some time above the baseline. Meaning, they use a credit based scheduler and get more physical CPU time if needed.
kubectl top nodes
I run the
kubectl top nodes
command three times in a row and received three different outputs:m
? The aspect I do not understand is, I am using 1-2% of CPU. However, percent is a relative unit. What is a 100% CPU?kubectl top pods --all-namespaces
Different from the
kubectl top nodes
thekubectl top pods --all-namespaces
actually produces the same output. However, there is not much going on in my Kubernetes cluster. The following is a sample output:m
stand for?kubectl top nodes
, shows me a MEMORY(bytes) usage of approx. 410Mi. But if I add all the MEMORY(bytes) of the pods together I end up at10+20+7+7+12+10+13+12+29 = 120Mi
. Where are the other410-120 = 290Mi
used?The text was updated successfully, but these errors were encountered: