首页 / API 文档 / 平台管理 / 集群管理 / 节点管理 / 查看节点详情

查看节点详情

请求信息

请求行

GET /kubernetes/{cluster}/api/v1/nodes/{name}

查看指定的节点。

请求行参数

名称 类型 是否必填项 描述
name string 节点的名称。

请求参数

名称 类型 是否必填项 描述
exact boolean 服务出口是否要确切定义。不推荐使用,计划将会在 1.18 版本移除。
export boolean 是否应导出该值。 用户无法指定导出的字段。 不推荐使用。 计划在 1.18 版本中移除。
pretty string 如果为 true,则会将返回结果输出成适合打印的格式。

返回信息

Content-Type application/json, application/yaml, application/vnd.kubernetes.protobuf

状态码: 200

OK

返回体示例

Node 是 Kubernetes 中的工作节点。 每个节点在缓存中都有一个唯一的标识符(即在 etcd 中)。

{
   "apiVersion": "v1",
   "kind": "Node",
   "metadata": {
     "annotations": {
       "cpaas.io/display-name": "",
       "kubeadm.alpha.kubernetes.io/cri-socket": "/var/run/dockershim.sock",
       "node.alpha.kubernetes.io/ttl": "0",
       "ovn.kubernetes.io/allocated": "true",
       "ovn.kubernetes.io/chassis": "8a13eb92-aee5-46ba-b569-ae6b88535ad8",
       "ovn.kubernetes.io/cidr": "100.64.0.0/16",
       "ovn.kubernetes.io/gateway": "100.64.0.1",
       "ovn.kubernetes.io/ip_address": "100.64.0.4",
       "ovn.kubernetes.io/logical_switch": "join",
       "ovn.kubernetes.io/mac_address": "00:00:00:26:9C:BD",
       "ovn.kubernetes.io/port_name": "node-192.168.0.104",
       "volumes.kubernetes.io/controller-managed-attach-detach": "true"
     },
     "creationTimestamp": "2022-04-10T07:10:25Z",
     "labels": {
       "beta.kubernetes.io/arch": "amd64",
       "beta.kubernetes.io/os": "linux",
       "cpaas-system-alb": "",
       "kube-ovn/role": "master",
       "kubernetes.io/arch": "amd64",
       "kubernetes.io/hostname": "192.168.0.104",
       "kubernetes.io/os": "linux",
       "node-role.kubernetes.io/control-plane": "",
       "node-role.kubernetes.io/master": "",
       "node.kubernetes.io/exclude-from-external-load-balancers": "",
       "nvidia-device-enable": "false",
       "platform.tkestack.io/machine-ip": "192.168.0.104"
     },
     "name": "192.168.0.104",
     "resourceVersion": "3883789",
     "uid": "66657421-cd82-43f1-b527-386be0cfa9be"
   },
   "spec": {
     "podCIDR": "172.199.0.0/24",
     "podCIDRs": [
       "172.199.0.0/24"
     ]
   },
   "status": {
     "addresses": [
       {
         "address": "192.168.0.104",
         "type": "InternalIP"
       },
       {
         "address": "192.168.0.104",
         "type": "Hostname"
       }
     ],
     "allocatable": {
       "cpu": "23800m",
       "ephemeral-storage": "193000915035",
       "hugepages-1Gi": "0",
       "hugepages-2Mi": "0",
       "memory": "48164932Ki",
       "pods": "110"
     },
     "capacity": {
       "cpu": "24",
       "ephemeral-storage": "209419396Ki",
       "hugepages-1Gi": "0",
       "hugepages-2Mi": "0",
       "memory": "49291332Ki",
       "pods": "110"
     },
     "conditions": [
       {
         "lastHeartbeatTime": "2022-04-12T08:09:37Z",
         "lastTransitionTime": "2022-04-10T07:29:09Z",
         "message": "Kubelet has sufficient FileDescriptor available",
         "reason": "NodeHasSufficientFD",
         "status": "False",
         "type": "NodeHasInsufficientFD"
       },
       {
         "lastHeartbeatTime": "2022-04-12T08:09:37Z",
         "lastTransitionTime": "2022-04-10T07:29:09Z",
         "message": "kernel has no deadlock",
         "reason": "KernelHasNoDeadlock",
         "status": "False",
         "type": "KernelDeadlock"
       },
       {
         "lastHeartbeatTime": "2022-04-12T08:05:45Z",
         "lastTransitionTime": "2022-04-10T07:10:25Z",
         "message": "kubelet has sufficient memory available",
         "reason": "KubeletHasSufficientMemory",
         "status": "False",
         "type": "MemoryPressure"
       },
       {
         "lastHeartbeatTime": "2022-04-12T08:05:45Z",
         "lastTransitionTime": "2022-04-10T07:10:25Z",
         "message": "kubelet has no disk pressure",
         "reason": "KubeletHasNoDiskPressure",
         "status": "False",
         "type": "DiskPressure"
       },
       {
         "lastHeartbeatTime": "2022-04-12T08:05:45Z",
         "lastTransitionTime": "2022-04-10T07:10:25Z",
         "message": "kubelet has sufficient PID available",
         "reason": "KubeletHasSufficientPID",
         "status": "False",
         "type": "PIDPressure"
       },
       {
         "lastHeartbeatTime": "2022-04-12T08:05:45Z",
         "lastTransitionTime": "2022-04-10T07:15:58Z",
         "message": "kubelet is posting ready status",
         "reason": "KubeletReady",
         "status": "True",
         "type": "Ready"
       }
     ],
     "daemonEndpoints": {
       "kubeletEndpoint": {
         "Port": 10250
       }
     },
     "images": [
       {
         "names": [
           "registry.alauda.cn:60080/tkestack/kube-apiserver@sha256:eb81528afdbd996242cfbf6f6d53ec3529da43e0a1970b61a7454d8dc910ba19",
           "registry.alauda.cn:60080/tkestack/kube-apiserver:v1.21.10"
         ],
         "sizeBytes": 137667869
       },
       {
         "names": [
           "registry.alauda.cn:60080/tkestack/kube-controller-manager@sha256:1db444412ada7729572f9cdb155ab7ba891520e09524093a2eeb0d28096f2dbd",
           "registry.alauda.cn:60080/tkestack/kube-controller-manager:v1.21.10"
         ],
         "sizeBytes": 131876125
       },
       {
         "names": [
           "registry.alauda.cn:60080/tkestack/provider-res@sha256:9504457bff6f0682e7493f94de2a4fa9d6e526a8978159cecf7b416af343010b",
           "registry.alauda.cn:60080/tkestack/provider-res:v1.21.10-1"
         ],
         "sizeBytes": 491112019
       }
     ],
     "nodeInfo": {
       "architecture": "amd64",
       "bootID": "7fe24634-a4f3-4428-84ca-bfaa8b2b9c98",
       "containerRuntimeVersion": "docker://20.10.7",
       "kernelVersion": "3.10.0-1127.el7.x86_64",
       "kubeProxyVersion": "v1.21.10",
       "kubeletVersion": "v1.21.10",
       "machineID": "bd6671f674d549828e2eb9967e126403",
       "operatingSystem": "linux",
       "osImage": "CentOS Linux 7 (Core)",
       "systemUUID": "4AF1EFAB-FBC0-4CBE-B91D-54119CE8A6AF"
     }
   }
 }

返回体说明

名称 类型 描述
apiVersion string 查看公共参数
kind string 查看公共参数
metadata object 查看公共参数
spec object NodeSpec 描述了创建节点时使用的属性。
字段路径:spec
spec.podCIDR string PodCIDR 表示分配给节点的 pod IP 范围。
字段路径:spec.podCIDR
spec.podCIDRs array podCIDRs 表示分配给节点以供该节点上的 Pod 使用的 IP 范围。 如果指定了该字段,则第 0 个条目必须与 podCIDR 字段匹配。 对于 IPv4 和 IPv6,它最多可以包含 1 个值。
字段路径:spec.podCIDRs
spec.podCIDRs[] string
字段路径:spec.podCIDRs[]
status object NodeStatus 是有关节点当前状态的信息。
字段路径:status
status.addresses array 节点可到达的地址列表。 从云提供商处查询(如果有)。 更多信息:https://kubernetes.io/docs/concepts/nodes/node/#addresses 注意:该字段声明为可合并,但合并键不够唯一,合并时可能导致数据损坏。 调用者应改为使用完全替换补丁。 有关示例,请参见 http://pr.k8s.io/79391。
字段路径:status.addresses
status.addresses[] object NodeAddress 包含了节点的地址信息。
字段路径:status.addresses[]
addresses[].address string 节点地址。
字段路径:status.addresses[].address
addresses[].type string 节点地址类型,可选 Hostname、ExternalIP、InternalIP。
字段路径:status.addresses[].type
status.allocatable object Allocatable 表示节点的可用于调度的资源。 默认为容量。
字段路径:status.allocatable
status.capacity object 容量代表一个节点的总资源。 更多信息:https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
字段路径:status.capacity
status.conditions array 条件是当前观察到的节点条件的数组。 更多信息:https://kubernetes.io/docs/concepts/nodes/node/#condition
字段路径:status.conditions
status.conditions[] object NodeCondition 包含节点的条件信息。
字段路径:status.conditions[]
conditions[].lastHeartbeatTime string (date-time) Time 是时间的包装。Time 支持正确的封送到 YAML 和 JSON。时间包提供方的许多工厂方法都提供了包装器。
字段路径:status.conditions[].lastHeartbeatTime
conditions[].lastTransitionTime string (date-time) Time 是时间的包装。Time 支持正确的封送到 YAML 和 JSON。时间包提供方的许多工厂方法都提供了包装器。
字段路径:status.conditions[].lastTransitionTime
conditions[].message string 状态转换的详细可读信息。
字段路径:status.conditions[].message
conditions[].reason string (简要)条件最后一次转换的原因。
字段路径:status.conditions[].reason
conditions[].status string 条件的状态,包括:True、False、Unknown。
字段路径:status.conditions[].status
conditions[].type string 节点条件的类型。
字段路径:status.conditions[].type
status.daemonEndpoints object NodeDaemonEndpoints 列出了节点上运行的守护进程打开的端口。
字段路径:status.daemonEndpoints
daemonEndpoints.kubeletEndpoint object DaemonEndpoint 包含有关单个 Daemon 端点的信息。
字段路径:status.daemonEndpoints.kubeletEndpoint
kubeletEndpoint.Port integer (int32) 给定端点的端口号。
字段路径:status.daemonEndpoints.kubeletEndpoint.Port
status.images array 该节点上的容器镜像列表。
字段路径:status.images
status.images[] object 描述了一个容器镜像。
字段路径:status.images[]
images[].names array 已知的此镜像的名称。 例如 ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
字段路径:status.images[].names
images[].names[] string
字段路径:status.images[].names[]
images[].sizeBytes integer (int64) 镜像的大小(以字节为单位)。
字段路径:status.images[].sizeBytes
status.nodeInfo object NodeSystemInfo 是一组用于唯一标识节点的 ids/uuids。
字段路径:status.nodeInfo
nodeInfo.architecture string 节点记录的架构。
字段路径:status.nodeInfo.architecture
nodeInfo.bootID string 节点记录的 Boot id。
字段路径:status.nodeInfo.bootID
nodeInfo.containerRuntimeVersion string 节点通过运行时远程 API 报告的 ContainerRuntime 版本(例如 docker://1.5.0)。
字段路径:status.nodeInfo.containerRuntimeVersion
nodeInfo.kernelVersion string 节点从“uname -r”报告的内核版本(例如 3.16.0-0.bpo.4-amd64)。
字段路径:status.nodeInfo.kernelVersion
nodeInfo.kubeProxyVersion string 节点记录的 KubeProxy 版本。
字段路径:status.nodeInfo.kubeProxyVersion
nodeInfo.kubeletVersion string 节点记录的 Kubelet 版本。
字段路径:status.nodeInfo.kubeletVersion
nodeInfo.machineID string 节点记录的 MachineID。作为集群中唯一的节点识别,此字段是首选的。更多信息:http://man7.org/linux/man-pages/man5/machine-id.5.html
字段路径:status.nodeInfo.machineID
nodeInfo.operatingSystem string 节点记录的操作系统。
字段路径:status.nodeInfo.operatingSystem
nodeInfo.osImage string 节点从 /etc/os-release 报告的操作系统镜像(例如 Debian GNU/Linux 7 (wheezy))。
字段路径:status.nodeInfo.osImage
nodeInfo.systemUUID string 节点记录的 SystemUUID。作为唯一的节点识别,此字段是首选的。更多信息:https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html
字段路径:status.nodeInfo.systemUUID

其他状态码

状态码: 401

Unauthorized