lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.46k stars 1.45k forks source link

Cpu and memory consumption by pod are not displayed #3058

Open vivanov83 opened 3 years ago

vivanov83 commented 3 years ago

Describe the bug CPU and Memory consumption by pod are not displayed

To Reproduce Steps to reproduce the behavior:

  1. Go to Node
  2. Click on some node
  3. Scroll down to see resources consumed by pods

Expected behavior Consumed resources by pod should be visible

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

npiganeau commented 3 years ago

Same here. There is an error in the console:

image

However, the api-kube/apis/metrics.k8s.io/v1beta1/pods request seems to return the pod usage data :

{
  "kind": "PodMetricsList",
  "apiVersion": "metrics.k8s.io/v1beta1",
  "metadata": {
    "selfLink": "/apis/metrics.k8s.io/v1beta1/pods"
  },
  "items": [
    {
      "metadata": {
        "name": "cert-manager-7998c69865-64xkm",
        "namespace": "cert-manager",
        "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/cert-manager/pods/cert-manager-7998c69865-64xkm",
        "creationTimestamp": "2021-06-15T12:54:35Z"
      },
      "timestamp": "2021-06-15T12:54:35Z",
      "window": "5m0s",
      "containers": [
        {
          "name": "cert-manager",
          "usage": {
            "cpu": "4m",
            "memory": "41384Ki"
          }
        }
      ]
    },
    {
      "metadata": {
        "name": "cert-manager-cainjector-7b744d56fb-gfvlg",
        "namespace": "cert-manager",
        "selfLink": "/apis/metrics.k8s.io/v1beta1/namespaces/cert-manager/pods/cert-manager-cainjector-7b744d56fb-gfvlg",
        "creationTimestamp": "2021-06-15T12:54:35Z"
      },
      "timestamp": "2021-06-15T12:54:35Z",
      "window": "5m0s",
      "containers": [
        {
          "name": "cert-manager",
          "usage": {
            "cpu": "1m",
            "memory": "43476Ki"
          }
        }
      ]
    },
...
vivanov83 commented 3 years ago

I've just tried 5.0beta* and it seems to be working there.

aleksfront commented 3 years ago

Got similar error in 5.1.1 but with different message: pod metrics error

Nokel81 commented 3 years ago

Those metrics are the single place within Lens that we use kube state metrics.

DmitriyNoa commented 2 years ago

Seems to be working as expected in Lens: 5.3.3-latest.20211223.1 Electron: 13.6.1 Chrome: 91.0.4472.164 Node: 14.16.0

The latest m Screenshot 2022-01-20 at 13 56 00 aster also works as expected.

DmitriyNoa commented 2 years ago

But fails on local Minikube with 40 Screenshot 2022-01-20 at 13 59 07 4

Nokel81 commented 2 years ago

@DmitriyNoa does your minikube have kube state metrics installed?