<p>For services, pods, namespaces we don't get CPU utilization, memory Utilization metrics,we get Memory request , CPU request, Memory allocated, CPU allocated using CoreV1Api.
How to get Utilization for above?</p>

<p>For Cluster, we did average of CPU Utilization of nodes (EC2 instances Ids) , so we have cpu/memory utilization for cluster, So can we assume, CPU Utilization for pod will be utilization of node on which it is running?For namespace, on which node ,it exists?</p>

Dhanraj
<p>You can get resources <code>request</code>, <code>limits</code> or <code>utilization</code> for a couple of ways. </p>

<p><code>$ kubectl top pods</code> or <code>$ kubectl top nodes</code>. You can check <a href="https://kubernetes.io/docs/concepts/policy/resource-quotas/" rel="nofollow noreferrer">Quota</a> or <code>kubectl describe node/pod</code> to check information inside.
You can also specify if you need pods form only one namespace like <code>kubectl top pod --namespace=kube-system</code></p>

<p>To do that you will need <a href="https://github.com/kubernetes-sigs/metrics-server" rel="nofollow noreferrer">metric server</a> which is usually installed on the beginning. To check if it is installed you should list your pods in <code>kube-system</code> namespaces.</p>

<pre><code>$ kubectl get pods -n kube-system
NAME
...
metrics-server-v0.3.1-57c75779f-wsmfk                   2/2     Running   0          6h24m
...
</code></pre>

<p>Then you can check current metrics in a few ways. Check <a href="https://github.com/feiskyer/kubernetes-handbook/blob/master/en/addons/metrics.md#metrics-api" rel="nofollow noreferrer">this thread</a>. When you will list <code>raw</code> metrics is good to list it using <code>jq</code>. 
<code>$ /apis/metrics.k8s.io/v1beta1/nodes | jq .</code></p>

<p>Another thing is that you could use <a href="https://prometheus.io/" rel="nofollow noreferrer">Prometheus</a> for metrics and alerting (depends on your needs). If you want only CPU and memory utilization, <code>metrics server</code> is enoug, however <code>Prometheus</code> also installing <code>custom.metrics</code> which will allow you to get metrics from all kubernetes objects. </p>

<p>Later you can also install some UI like <a href="https://grafana.com/" rel="nofollow noreferrer">Grafana</a>.</p>

<blockquote>
  <p>So can we assume, CPU Utilization for pod will be utilization of node on which it is running</p>
</blockquote>

<p>CPU utilization for node will display utilization of all resources assigned to this node, even if pods are in different namespaces.</p>

<p>I would encourage you to check <a href="https://www.replex.io/blog/kubernetes-in-production-the-ultimate-guide-to-monitoring-resource-metrics" rel="nofollow noreferrer">this article</a>.</p>
