List
Retrieves the list of node group in the specified Kubernetes cluster.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const ListNodeGroupsRequest =
cloudApi.k8s.node_group_service.ListNodeGroupsRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.NodeGroupServiceClient);
const result = await client.list(
ListNodeGroupsRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.k8s.v1.node_group_service_pb2 import ListNodeGroupsRequest
from yandex.cloud.k8s.v1.node_group_service_pb2_grpc import NodeGroupServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(NodeGroupServiceStub)
response = service.List(
ListNodeGroupsRequest(
folder_id="folderId",
# page_size = 0,
# page_token = "pageToken",
# filter = "filter"
)
)
print(response)
ListNodeGroupsRequest
folderId
: string
ID of the folder to list node groups in. To get the folder ID use a yandex.cloud.resourcemanager.v1.FolderService.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 ListNodeGroupsResponse.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
ListNodeGroupsResponse.next_page_token returned by a previous list request.
filter
: string
A filter expression that filters resources listed in the response. The expression must specify:
- The field name. Currently you can use filtering only on NodeGroup.name field.
- An
=
operator. - The value in double quotes (
"
). Must be 3-63 characters long and match the regular expression[a-z][-a-z0-9]{1,61}[a-z0-9]
.
ListNodeGroupsResponse
nodeGroups
: NodeGroup
List of node groups.
nextPageToken
: string
This token allows you to get the next page of results for list requests. If the number of results
is larger than ListNodeGroupsRequest.page_size, use
the next_page_token
as the value
for the ListNodeGroupsRequest.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.
NodeGroup
Status
STATUS_UNSPECIFIED
PROVISIONING
Node group is waiting for resources to be allocated.
RUNNING
Node group is running.
RECONCILING
Node group is waiting for some work to be done, such as upgrading node software.
STOPPING
Node group is being stopped.
STOPPED
Node group stopped.
DELETING
Node group is being deleted.
STARTING
Node group is being started.
id
: string
ID of the node group.
clusterId
: string
ID of the cluster that the node group belongs to.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
name
: string
Name of the node group. The name is unique within the folder.
description
: string
Description of the node group. 0-256 characters long.
labels
: string
Resource labels as key:value
pairs. Maximum of 64 per resource.
status
: Status
Status of the node group.
nodeTemplate
: NodeTemplate
Node template that specifies parameters of the compute instances for the node group.
scalePolicy
: ScalePolicy
Scale policy of the node group. For more information, see Scaling policy.
allocationPolicy
: NodeGroupAllocationPolicy
Allocation policy by which resources for node group are allocated to zones and regions.
deployPolicy
: DeployPolicy
Deploy policy according to which the updates are rolled out.
instanceGroupId
: string
ID of the managed instance group associated with this node group.
nodeVersion
: string
Version of Kubernetes components that runs on the nodes. Deprecated. Use version_info.current_version.
versionInfo
: VersionInfo
Detailed information about the Kubernetes version that is running on the node.
maintenancePolicy
: NodeGroupMaintenancePolicy
Maintenance policy of the node group.
allowedUnsafeSysctls
: string
Support for unsafe sysctl parameters. For more details see documentation.
nodeTaints
: Taint
Taints that are applied to the nodes of the node group at creation time.
nodeLabels
: string
Labels that are assigned to the nodes of the node group at creation time.
NodeTemplate
NetworkSettings
Type
TYPE_UNSPECIFIED
STANDARD
SOFTWARE_ACCELERATED
type
: Type
ContainerRuntimeSettings
Type
TYPE_UNSPECIFIED
DOCKER
CONTAINERD
type
: Type
ContainerNetworkSettings
podMtu
: int64
name
: string
Name of the instance. In order to be unique it must contain at least on of instance unique placeholders: {instance.short_id} {instance.index} combination of {instance.zone_id} and {instance.index_in_zone} Example: my-instance-{instance.index} If not set, default is used: {instance_group.id}-{instance.short_id} It may also contain another placeholders, see metadata doc for full list.
labels
: string
these labels will be assigned to compute nodes (instances), created by the nodegroup
platformId
: string
ID of the hardware platform configuration for the node.
resourcesSpec
: ResourcesSpec
Computing resources of the node such as the amount of memory and number of cores.
bootDiskSpec
: DiskSpec
Specification for the boot disk that will be attached to the node.
metadata
: string
The metadata as key:value
pairs assigned to this instance template. Only SSH keys are supported as metadata.
For more information, see Connecting to a node over SSH.
v4AddressSpec
: NodeAddressSpec
Specification for the create network interfaces for the node group compute instances. Deprecated, please use network_interface_specs.
schedulingPolicy
: SchedulingPolicy
Scheduling policy configuration.
networkInterfaceSpecs
: NetworkInterfaceSpec
New api, to specify network interfaces for the node group compute instances. Can not be used together with 'v4_address_spec'
placementPolicy
: PlacementPolicy
networkSettings
: NetworkSettings
this parameter allows to specify type of network acceleration used on nodes (instances)
containerRuntimeSettings
: ContainerRuntimeSettings
containerNetworkSettings
: ContainerNetworkSettings
gpuSettings
: GpuSettings
GPU settings
ScalePolicy
FixedScale
size
: int64
Number of nodes in the node group.
AutoScale
minSize
: int64
Minimum number of nodes in the node group.
maxSize
: int64
Maximum number of nodes in the node group.
initialSize
: int64
Initial number of nodes in the node group.
One of scaleType
fixedScale
: FixedScaleFixed scale policy of the node group.
autoScale
: AutoScaleAuto scale policy of the node group.
NodeGroupAllocationPolicy
locations
: NodeGroupLocation
List of locations where resources for the node group will be allocated.
DeployPolicy
maxUnavailable
: int64
The maximum number of running instances that can be taken offline (i.e., stopped or deleted) at the same time during the update process. If max_expansion is not specified or set to zero, max_unavailable must be set to a non-zero value.
maxExpansion
: int64
The maximum number of instances that can be temporarily allocated above the group's target size during the update process. If max_unavailable is not specified or set to zero, max_expansion must be set to a non-zero value.
VersionInfo
currentVersion
: string
Current Kubernetes version, format: major.minor (e.g. 1.15).
newRevisionAvailable
: bool
Newer revisions may include Kubernetes patches (e.g 1.15.1 -> 1.15.2) as well as some internal component updates - new features or bug fixes in platform specific components either on the master or nodes.
newRevisionSummary
: string
Description of the changes to be applied when updating to the latest revision. Empty if new_revision_available is false.
versionDeprecated
: bool
The current version is on the deprecation schedule, component (master or node group) should be upgraded.
NodeGroupMaintenancePolicy
autoUpgrade
: bool
If set to true, automatic updates are installed in the specified period of time with no interaction from the user. If set to false, automatic upgrades are disabled.
autoRepair
: bool
If set to true, automatic repairs are enabled. Default value is false.
maintenanceWindow
: MaintenanceWindow
Maintenance window settings. Update will start at the specified time and last no more than the specified duration. The time is set in UTC.
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.
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.
NodeAddressSpec
oneToOneNatSpec
: OneToOneNatSpec
One-to-one NAT configuration. Setting up one-to-one NAT ensures that public IP addresses are assigned to nodes, and therefore internet is accessible for all nodes of the node group. If the field is not set, NAT will not be set up.
dnsRecordSpecs
: DnsRecordSpec
Internal DNS configuration.
SchedulingPolicy
preemptible
: bool
True for preemptible compute instances. Default value is false. Preemptible compute instances are stopped at least once every 24 hours, and can be stopped at any time if their resources are needed by Compute. For more information, see Preemptible Virtual Machines.
NetworkInterfaceSpec
subnetIds
: string
IDs of the subnets.
primaryV4AddressSpec
: NodeAddressSpec
Primary IPv4 address that is assigned to the instance for this network interface.
primaryV6AddressSpec
: NodeAddressSpec
Primary IPv6 address that is assigned to the instance for this network interface.
securityGroupIds
: string
IDs of security groups.
PlacementPolicy
placementGroupId
: string
Identifier of placement group
NetworkSettings
Type
TYPE_UNSPECIFIED
STANDARD
SOFTWARE_ACCELERATED
type
: Type
ContainerRuntimeSettings
Type
TYPE_UNSPECIFIED
DOCKER
CONTAINERD
type
: Type
ContainerNetworkSettings
podMtu
: int64
GpuSettings
GpuEnvironment
GPU_ENVIRONMENT_UNSPECIFIED
Use one of the values below, depending on the default for the specific Cloud installation.
RUNC_DRIVERS_CUDA
Use a node image with the pre-installed GPU toolkit, drivers and CUDA.
RUNC
Use a node image with the pre-installed GPU toolkit but without drivers. You should install drivers on a node yourself in that case. There are tools to help you to do that, for example gpu-operator.
gpuClusterId
: string
GPU cluster id, that mk8s node will join.
gpuEnvironment
: GpuEnvironment
GPU environment configured on node.
FixedScale
size
: int64
Number of nodes in the node group.
AutoScale
minSize
: int64
Minimum number of nodes in the node group.
maxSize
: int64
Maximum number of nodes in the node group.
initialSize
: int64
Initial number of nodes in the node group.
NodeGroupLocation
zoneId
: string
ID of the availability zone where the nodes may reside.
subnetId
: string
ID of the subnet. If a network chosen for the Kubernetes cluster has only one subnet in the specified zone, subnet ID may be omitted.
MaintenanceWindow
One of policy
Maintenance policy.
anytime
: AnytimeMaintenanceWindowUpdating the master at any time.
dailyMaintenanceWindow
: DailyMaintenanceWindowUpdating the master on any day during the specified time window.
weeklyMaintenanceWindow
: WeeklyMaintenanceWindowUpdating the master on selected days during the specified time window.
OneToOneNatSpec
ipVersion
: IpVersion
IP version for the public IP address.
DnsRecordSpec
fqdn
: string
FQDN (required).
dnsZoneId
: string
DNS zone id (optional, if not set, private zone is used).
ttl
: int64
DNS record ttl, values in 0-86400 (optional).
ptr
: bool
When set to true, also create PTR DNS record (optional).
AnytimeMaintenanceWindow
DailyMaintenanceWindow
startTime
: google.type.TimeOfDay
Window start time, in the UTC timezone.
duration
: google.protobuf.Duration
Window duration.
WeeklyMaintenanceWindow
daysOfWeek
: DaysOfWeekMaintenanceWindow
Days of the week and the maintenance window for these days when automatic updates are allowed.
DaysOfWeekMaintenanceWindow
days
: google.type.DayOfWeek
Days of the week when automatic updates are allowed.
startTime
: google.type.TimeOfDay
Window start time, in the UTC timezone.
duration
: google.protobuf.Duration
Window duration.