---
title: "获取节点监控指标"
method: GET
path: "/k8s/cluster/{id}/nodes/{nodeName}/metrics"
tags: ["K8s监控"]
---

# 获取节点监控指标

`GET /k8s/cluster/{id}/nodes/{nodeName}/metrics`

获取指定节点的CPU、内存等监控指标和使用率

## Path parameters

- `id` integer, required
- `nodeName` string, required

## Headers

- `Authorization` string, required

## Response `200`

OK

- object
  - `code` integer — 状态码
  - `data` object — 返回的数据
    - `allocatable` ModelResourceUsage
      - `cpu` string — CPU使用量 (如: "100m", "1.5")
      - `memory` string — 内存使用量 (如: "128Mi", "1Gi")
    - `capacity` ModelResourceUsage
      - `cpu` string — CPU使用量 (如: "100m", "1.5")
      - `memory` string — 内存使用量 (如: "128Mi", "1Gi")
    - `nodeName` string — 节点名称
    - `podCount` integer — Pod数量
    - `podMetrics` ModelPodMetricsSummary[] — Pod监控摘要
      - `namespace` string — 命名空间
      - `podName` string — Pod名称
      - `usage` ModelResourceUsage
        - `cpu` string — CPU使用量 (如: "100m", "1.5")
        - `memory` string — 内存使用量 (如: "128Mi", "1Gi")
      - `usageRate` ModelResourceUsageRate
        - `cpuRate` number — CPU使用率 (百分比: 0-100)
        - `memoryRate` number — 内存使用率 (百分比: 0-100)
    - `systemInfo` ModelNodeSystemInfo
      - `architecture` string — 系统架构
      - `containerRuntimeVersion` string — 容器运行时版本
      - `kernelVersion` string — 内核版本
      - `kubeProxyVersion` string — KubeProxy版本
      - `kubeletVersion` string — Kubelet版本
      - `osImage` string — 操作系统镜像
    - `timestamp` string — 采集时间
    - `usage` ModelResourceUsage
      - `cpu` string — CPU使用量 (如: "100m", "1.5")
      - `memory` string — 内存使用量 (如: "128Mi", "1Gi")
    - `usageRate` ModelResourceUsageRate
      - `cpuRate` number — CPU使用率 (百分比: 0-100)
      - `memoryRate` number — 内存使用率 (百分比: 0-100)
  - `message` string — 提示信息

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/opsre/apis/devops.md) · [All operations](https://skmtc.net/opsre/apis/devops/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opsre/devops/revisions/25cac8835c4c/schema)
