---
title: "获取K8s节点信息"
method: GET
path: "/api/v1/k8s/cluster/{id}/nodes"
tags: ["K8s节点管理"]
---

# 获取K8s节点信息

`GET /api/v1/k8s/cluster/{id}/nodes`

获取指定集群的所有节点详细信息，包括名称/IP地址、状态、配置、资源使用情况等

## Path parameters

- `id` integer, required

## Response `200`

获取成功

- object
  - `code` integer — 状态码
  - `data` ModelK8sNode[] — 返回的数据
    - `conditions` ModelNodeCondition[] — 节点状态详细条件
      - `reason` string
      - `status` string
      - `type` string
    - `configuration` ModelNodeConfiguration
      - `annotations` object — 节点注释
      - `architecture` string — 系统架构
      - `kernelVersion` string — 内核版本
      - `labels` object — 节点标签
      - `osImage` string — 操作系统镜像
      - `role` string — 节点角色 master/worker
    - `createdAt` string — 创建时间
    - `externalIP` string — 外部IP地址
    - `internalIP` string — 内部IP地址
    - `name` string — 节点名称
    - `podMetrics` ModelPodMetrics
      - `allocated` integer — 已分配的Pod数量
      - `total` integer — 总的Pod容量
    - `resources` ModelNodeResources
      - `cpu` ModelResourceInfo
        - `allocatable` string — 可分配量
        - `capacity` string — 总容量
        - `requests` string — 请求量
        - `usage` string — 使用量
      - `memory` ModelResourceInfo
        - `allocatable` string — 可分配量
        - `capacity` string — 总容量
        - `requests` string — 请求量
        - `usage` string — 使用量
    - `roles` string — 节点角色 control-plane,master 或 worker
    - `runtime` ModelRuntimeInfo
      - `containerRuntimeVersion` string — 容器运行时版本
      - `kubeProxyVersion` string — KubeProxy版本
      - `kubeletVersion` string — Kubelet版本
      - `operatingSystem` string — 操作系统
      - `osImage` string — 操作系统镜像
    - `scheduling` ModelNodeSchedulingInfo
      - `taints` ModelNodeTaint[] — 节点污点
        - `effect` string — NoSchedule, PreferNoSchedule, NoExecute
        - `key` string
        - `value` string
      - `unschedulable` boolean — 是否不可调度
    - `status` string — 节点状态 Ready/NotReady
  - `message` string — 提示信息

## Other responses

- `400` — 参数错误
- `404` — 集群不存在
- `500` — 服务器错误

---

[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)
