How to find cpu and ram usage in Kubernetes deployment

5/28/2019

My Kubernetes cluster is failing to deploy new applications with insufficient CPU on the cluster

After digging around rancher and kubectl I have found that I am using 5% of CPU, but Reserved 96% CPU.

This is due to wrongly configured values in my micro-services values.yaml

If there a way to find out how much the micro-services are using when idle and when at load

resources:
  requests:
    memory: {{ .Values.resources.requests.memory | quote}}
    cpu: {{ .Values.resources.requests.cpu | quote}}

  limits:
    memory: {{ .Values.resources.limits.memory | quote}}
    cpu: {{ .Values.resources.requests.cpu | quote}}

I have tried using kubectl to describe the node I am monitoring netdata, but that is real time and hard to gauge limits from that.

If anyone had suggestions, that would be great

-- user3292394
kubectl
kubernetes
kubernetes-helm

1 Answer

5/28/2019

The built in tool is kubectl top but this requires you have metrics-server running, which you probably do if you are using a hosted kube option but might not if running it yourself. Beyond that, Prometheus and tools like node-exporter and cadvisor can get you the data

-- coderanger
Source: StackOverflow