Home / API Documentation / Platform management / Clusters / Node management / View the list of nodes

View the list of nodes

Requests

HTTP request

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

list or watch objects of kind Node

Query parameters

Name Type Required Description
allowWatchBookmarks boolean FalseallowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. This field is beta.
continue string FalseThe continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
fieldSelector string FalseA selector to restrict the list of returned objects by their fields. Defaults to everything.
labelSelector string FalseA selector to restrict the list of returned objects by their labels. Defaults to everything.
limit integer Falselimit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
resourceVersion string FalseWhen specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
timeoutSeconds integer FalseTimeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
watch boolean FalseWatch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
pretty string FalseIf 'true', then the output is pretty printed.

Responses

Content-Type application/json, application/yaml, application/vnd.kubernetes.protobuf, application/json;stream=watch, application/vnd.kubernetes.protobuf;stream=watch

Status code: 200

OK

Sample response

NodeList is the whole list of all Nodes which have been registered with master.

{
   "apiVersion": "v1",
   "items": [
     {
       "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": {
           "alertmanager": "true",
           "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"
         }
       }
     }
   ],
   "kind": "List",
   "metadata": {
     "resourceVersion": "",
     "selfLink": ""
   }
 }

Parameters

Name Type Description
apiVersion string See common parameters
items array List of nodes
Path: items
items[] object Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).
Path: items[]
items[].apiVersion string See common parameters
items[].kind string See common parameters
items[].metadata object See common parameters
items[].spec object NodeSpec describes the attributes that a node is created with.
Path: items[].spec
spec.podCIDR string PodCIDR represents the pod IP range assigned to the node.
Path: items[].spec.podCIDR
spec.podCIDRs array podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.
Path: items[].spec.podCIDRs
spec.podCIDRs[] string
Path: items[].spec.podCIDRs[]
items[].status object NodeStatus is information about the current status of a node.
Path: items[].status
status.addresses array List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See http://pr.k8s.io/79391 for an example.
Path: items[].status.addresses
status.addresses[] object NodeAddress contains information for the node's address.
Path: items[].status.addresses[]
addresses[].address string The node address.
Path: items[].status.addresses[].address
addresses[].type string Node address type, one of Hostname, ExternalIP or InternalIP.
Path: items[].status.addresses[].type
status.allocatable object Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.
Path: items[].status.allocatable
status.capacity object Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity
Path: items[].status.capacity
status.conditions array Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition
Path: items[].status.conditions
status.conditions[] object NodeCondition contains condition information for a node.
Path: items[].status.conditions[]
conditions[].lastHeartbeatTime string (date-time) Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
Path: items[].status.conditions[].lastHeartbeatTime
conditions[].lastTransitionTime string (date-time) Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.
Path: items[].status.conditions[].lastTransitionTime
conditions[].message string Human readable message indicating details about last transition.
Path: items[].status.conditions[].message
conditions[].reason string (brief) reason for the condition's last transition.
Path: items[].status.conditions[].reason
conditions[].status string Status of the condition, one of True, False, Unknown.
Path: items[].status.conditions[].status
conditions[].type string Type of node condition.
Path: items[].status.conditions[].type
status.daemonEndpoints object NodeDaemonEndpoints lists ports opened by daemons running on the Node.
Path: items[].status.daemonEndpoints
daemonEndpoints.kubeletEndpoint object DaemonEndpoint contains information about a single Daemon endpoint.
Path: items[].status.daemonEndpoints.kubeletEndpoint
kubeletEndpoint.Port integer (int32) Port number of the given endpoint.
Path: items[].status.daemonEndpoints.kubeletEndpoint.Port
status.images array List of container images on this node
Path: items[].status.images
status.images[] object Describe a container image
Path: items[].status.images[]
images[].names array Names by which this image is known. e.g. ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
Path: items[].status.images[].names
images[].names[] string
Path: items[].status.images[].names[]
images[].sizeBytes integer (int64) The size of the image in bytes.
Path: items[].status.images[].sizeBytes
status.nodeInfo object NodeSystemInfo is a set of ids/uuids to uniquely identify the node.
Path: items[].status.nodeInfo
nodeInfo.architecture string The Architecture reported by the node
Path: items[].status.nodeInfo.architecture
nodeInfo.bootID string Boot ID reported by the node.
Path: items[].status.nodeInfo.bootID
nodeInfo.containerRuntimeVersion string ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).
Path: items[].status.nodeInfo.containerRuntimeVersion
nodeInfo.kernelVersion string Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).
Path: items[].status.nodeInfo.kernelVersion
nodeInfo.kubeProxyVersion string KubeProxy Version reported by the node.
Path: items[].status.nodeInfo.kubeProxyVersion
nodeInfo.kubeletVersion string Kubelet Version reported by the node.
Path: items[].status.nodeInfo.kubeletVersion
nodeInfo.machineID string MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html
Path: items[].status.nodeInfo.machineID
nodeInfo.operatingSystem string The Operating System reported by the node
Path: items[].status.nodeInfo.operatingSystem
nodeInfo.osImage string OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).
Path: items[].status.nodeInfo.osImage
nodeInfo.systemUUID string SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html
Path: items[].status.nodeInfo.systemUUID
kind string See common parameters
metadata object See common parameters

Other status codes

Status code: 401

Unauthorized