ListNodes
Lists cluster's nodes.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListClusterNodesRequest =
cloudApi.k8s.cluster_service.ListClusterNodesRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.ClusterServiceClient);
const result = await client.listNodes(
ListClusterNodesRequest.fromPartial({
clusterId: "clusterId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.dataproc.v1.cluster_service_pb2_grpc import ClusterServiceStub
from yandex.cloud.k8s.v1.cluster_service_pb2 import ListClusterNodesRequest
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(ClusterServiceStub)
response = service.ListNodes(
ListClusterNodesRequest(
cluster_id="clusterId",
# page_size = 0,
# page_token = "pageToken"
)
)
print(response)
ListClusterNodesRequest
clusterId
: string
ID of the Kubernetes cluster to list nodes in. To get the Kubernetes cluster ID use a ClusterService.List request.
pageSize
: int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListClusterNodesResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.
pageToken
: string
Page token. To get the next page of results, set page_token
to the
ListClusterNodeGroupsResponse.next_page_token returned by a previous list request.
ListClusterNodesResponse
nodes
: Node
List of nodes for the specified Kubernetes cluster.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results
is larger than ListClusterNodesRequest.page_size, use
the next_page_token
as the value
for the ListClusterNodesRequest.page_token query parameter
in the next list request. Each subsequent list request will have its own
next_page_token
to continue paging through the results.
Node
KubernetesStatus
Kubernetes node info
id
: string
Node id (and instance name)
conditions
: Condition
Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition
taints
: Taint
If specified, the node's taints.
attachedVolumes
: AttachedVolume
List of volumes that are attached to the node.
CloudStatus
Cloud instance info
id
: string
Compute instance id
status
: string
IG instance status
statusMessage
: string
IG instance status message
Status
Computed node status.
STATUS_UNSPECIFIED
Computed node status.
PROVISIONING
Node instance is not yet created (e.g. in progress).
NOT_CONNECTED
Node instance is created but not registered (e.g. is still initializing).
NOT_READY
Node has connected but is not ready for workload (see conditions for details).
READY
Node has connected and ready for workload.
MISSING
Node is still registered but its instance is deleted (this is our bug).
STOPPED
Node is stopped
UNKNOWN
Backend request to kubernetes api was unsuccessful.
Spec
Node specification.
resources
: ResourcesSpec
Node group specified resources.
disk
: DiskSpec
Node group specified disk.
status
: Status
Computed node status.
spec
: Spec
Node specificaion.
cloudStatus
: CloudStatus
Cloud instance status.
Not available in MISSING
status.
kubernetesStatus
: KubernetesStatus
Kubernetes node status.
Not available in PROVISIONING
and NOT_CONNECTED
states.
Condition
type
: string
Type of node condition.
status
: string
Status is the status of the condition.
message
: string
Human-readable message indicating details about last transition.
lastHeartbeatTime
: google.protobuf.Timestamp
Last time we got an update on a given condition.
lastTransitionTime
: google.protobuf.Timestamp
Last time the condition transit from one status to another.
Taint
Effect
EFFECT_UNSPECIFIED
NO_SCHEDULE
Do not allow new pods to schedule onto the node unless they tolerate the taint, but allow all pods submitted to Kubelet without going through the scheduler to start, and allow all already-running pods to continue running.
PREFER_NO_SCHEDULE
Like NO_SCHEDULE, but the scheduler tries not to schedule new pods onto the node, rather than prohibiting new pods from scheduling onto the node entirely. Enforced by the scheduler.
NO_EXECUTE
Evict any already-running pods that do not tolerate the taint.
key
: string
The taint key to be applied to a node.
value
: string
The taint value corresponding to the taint key.
effect
: Effect
The effect of the taint on pods that do not tolerate the taint.
AttachedVolume
AttachedVolume describes a volume attached to a node
driverName
: string
Name of the driver which has attached the volume
volumeHandle
: string
Volume handle (cloud disk id)
ResourcesSpec
memory
: int64
Amount of memory available to the node, specified in bytes.
cores
: int64
Number of cores available to the node.
coreFraction
: int64
Baseline level of CPU performance with the possibility to burst performance above that baseline level. This field sets baseline performance for each core.
gpus
: int64
Number of GPUs available to the node.
DiskSpec
diskTypeId
: string
ID of the disk type.
diskSize
: int64
Size of the disk, specified in bytes.
Spec
Node specification.
resources
: ResourcesSpec
Node group specified resources.
disk
: DiskSpec
Node group specified disk.
CloudStatus
Cloud instance info
id
: string
Compute instance id
status
: string
IG instance status
statusMessage
: string
IG instance status message
KubernetesStatus
Kubernetes node info
id
: string
Node id (and instance name)
conditions
: Condition
Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition
taints
: Taint
If specified, the node's taints.
attachedVolumes
: AttachedVolume
List of volumes that are attached to the node.