• Kubernetes Submit Queue's avatar
    Merge pull request #53107 from Random-Liu/fix-cri-stats · 68d2722b
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 53234, 53252, 53267, 53276, 53107). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    Fix imagefs stats
    
    Without this CRI stats based summary api won't work:
    ```console
    $ curl localhost:10255/stats/summary
    Internal Error: failed to get root cgroup stats: failed to get imageFs info: no imagefs label for configured runtime
    ```
    With this PR, we could get summary api from cri-containerd now:
    ```console
    $ curl localhost:10255/stats/summary
    {
      "node": {
       "nodeName": "127.0.0.1",
       "startTime": "2017-09-23T06:26:49Z",
       "cpu": {
        "time": "2017-09-27T05:12:08Z",
        "usageNanoCores": 275510572,
        "usageCoreNanoSeconds": 11924595625329
       },
       "memory": {
        "time": "2017-09-27T05:12:08Z",
        "availableBytes": 27737075712,
        "usageBytes": 6028234752,
        "workingSetBytes": 3884470272,
        "rssBytes": 652304384,
        "pageFaults": 98472,
        "majorPageFaults": 87
       },
       "fs": {
        "time": "2017-09-27T05:12:08Z",
        "availableBytes": 75281231872,
        "capacityBytes": 104022159360,
        "usedBytes": 28724150272,
        "inodesFree": 12003204,
        "inodes": 12800000,
        "inodesUsed": 796796
       },
       "runtime": {
        "imageFs": {
         "time": "2017-09-27T05:12:00Z",
         "availableBytes": 75281231872,
         "capacityBytes": 104022159360,
         "usedBytes": 247732356,
         "inodesFree": 12003204,
         "inodes": 12800000,
         "inodesUsed": 6103
        }
       }
      },
      "pods": [
       {
        "podRef": {
         "name": "kube-dns-7797cb8758-qxkrz",
         "namespace": "kube-system",
         "uid": "4425b069-a342-11e7-ac90-42010af00002"
        },
        "startTime": "2017-09-27T05:11:23Z",
        "containers": [
         {
          "name": "kubedns",
          "startTime": "2017-09-27T05:11:24Z",
          "cpu": {
           "time": "1970-01-01T00:00:01Z",
           "usageCoreNanoSeconds": 154194917
          },
          "memory": {
           "time": "1970-01-01T00:00:01Z",
           "workingSetBytes": 7643136
          },
          "rootfs": {
           "time": "2017-09-27T05:12:00Z",
           "availableBytes": 75281231872,
           "capacityBytes": 104022159360,
           "usedBytes": 9,
           "inodesFree": 12003204,
           "inodes": 12800000,
           "inodesUsed": 32768
          },
          "logs": {
           "time": "2017-09-27T05:12:08Z",
           "availableBytes": 75281231872,
           "capacityBytes": 104022159360,
           "inodesFree": 12003204,
           "inodes": 12800000
          },
          "userDefinedMetrics": null
         },
         {
          "name": "dnsmasq",
          "startTime": "2017-09-27T05:11:24Z",
          "cpu": {
           "time": "1970-01-01T00:00:01Z",
           "usageCoreNanoSeconds": 114482989
          },
          "memory": {
           "time": "1970-01-01T00:00:01Z",
           "workingSetBytes": 7966720
          },
          "rootfs": {
           "time": "2017-09-27T05:12:00Z",
           "availableBytes": 75281231872,
           "capacityBytes": 104022159360,
           "usedBytes": 9,
           "inodesFree": 12003204,
           "inodes": 12800000,
           "inodesUsed": 28675
          },
          "logs": {
           "time": "2017-09-27T05:12:08Z",
           "availableBytes": 75281231872,
           "capacityBytes": 104022159360,
           "inodesFree": 12003204,
           "inodes": 12800000
          },
          "userDefinedMetrics": null
         },
         {
          "name": "sidecar",
          "startTime": "2017-09-27T05:11:24Z",
          "cpu": {
           "time": "1970-01-01T00:00:01Z",
           "usageCoreNanoSeconds": 140797580
          },
          "memory": {
           "time": "1970-01-01T00:00:01Z",
           "workingSetBytes": 7430144
          },
          "rootfs": {
           "time": "2017-09-27T05:12:00Z",
           "availableBytes": 75281231872,
           "capacityBytes": 104022159360,
           "usedBytes": 8,
           "inodesFree": 12003204,
           "inodes": 12800000,
           "inodesUsed": 28672
          },
          "logs": {
           "time": "2017-09-27T05:12:08Z",
           "availableBytes": 75281231872,
           "capacityBytes": 104022159360,
           "inodesFree": 12003204,
           "inodes": 12800000
          },
          "userDefinedMetrics": null
         }
        ],
        "volume": [
         {
          "time": "2017-09-27T05:12:03Z",
          "availableBytes": 15810760704,
          "capacityBytes": 15810772992,
          "usedBytes": 12288,
          "inodesFree": 3860043,
          "inodes": 3860052,
          "inodesUsed": 9,
          "name": "kube-dns-token-l2blr"
         }
        ]
       }
      ]
     }
    ```
    Signed-off-by: 's avatarLantao Liu <lantaol@google.com>
    
    ```release-note
    Fix the bug that query Kubelet's stats summary with CRI stats enabled results in error.
    ```
    68d2722b
Name
Last commit
Last update
.github Loading commit data...
Godeps Loading commit data...
api Loading commit data...
build Loading commit data...
cluster Loading commit data...
cmd Loading commit data...
docs Loading commit data...
examples Loading commit data...
federation Loading commit data...
hack Loading commit data...
logo Loading commit data...
pkg Loading commit data...
plugin Loading commit data...
staging Loading commit data...
test Loading commit data...
third_party Loading commit data...
translations Loading commit data...
vendor Loading commit data...
.bazelrc Loading commit data...
.generated_files Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.kazelcfg.json Loading commit data...
BUILD.bazel Loading commit data...
CHANGELOG-1.2.md Loading commit data...
CHANGELOG-1.3.md Loading commit data...
CHANGELOG-1.4.md Loading commit data...
CHANGELOG-1.5.md Loading commit data...
CHANGELOG-1.6.md Loading commit data...
CHANGELOG.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
Makefile.generated_files Loading commit data...
OWNERS Loading commit data...
OWNERS_ALIASES Loading commit data...
README.md Loading commit data...
SUPPORT.md Loading commit data...
Vagrantfile Loading commit data...
WORKSPACE Loading commit data...
code-of-conduct.md Loading commit data...
labels.yaml Loading commit data...