Information about existing node groups
To find out the ID or NAME of a node group, get a list of node groups in the Kubernetes cluster or detailed information about the node group.
Getting a list of node groups in a Kubernetes cluster
Get a list of node groups in a Kubernetes cluster:
- In the management console
, select a folder. - Go to Managed Service for Kubernetes.
- Click the name of the Kubernetes cluster.
- Navigate to the Node manager tab.
Run this command:
yc managed-kubernetes node-group list
Result:
+----------------------+----------------------+----------------+----------------------+---------------------+---------+------+
| ID | CLUSTER ID | NAME | INSTANCE GROUP ID | CREATED AT | STATUS | SIZE |
+----------------------+----------------------+----------------+----------------------+---------------------+---------+------+
| catvhf4iv6dt******** | catcafja9ktu******** | test-nodegroup | cl1ec3le3qv3******** | 2019-04-09 10:56:22 | RUNNING | 2 |
+----------------------+----------------------+----------------+----------------------+---------------------+---------+------+
To get a list of node groups in a folder, use the list REST API method for the NodeGroup resource or the NodeGroupService/List gRPC API call.
Getting detailed information about a node group
To access a node group, use the ID or NAME parameter from the previous step.
- In the management console
, select a folder. - Go to Managed Service for Kubernetes.
- Click the name of the Kubernetes cluster.
- Navigate to the Node manager tab.
- Click the name of the node group.
To view information about a specific node, navigate to the Nodes tab and click the node name.
Get detailed information about the node group:
yc managed-kubernetes node-group get test-nodegroup
Result:
id: catvhf4iv6dt********
cluster_id: catcafja9ktu********
created_at: "2019-04-09T10:56:22Z"
...
subnet_id: b0c0jfcpqgng********
instance_group_id: cl1ec3le3qv3********
node_version: 1.13.3
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
To get information about a Managed Service for Kubernetes node group:
-
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
-
Create a Terraform configuration file with a description of the
yandex_kubernetes_node_groupdata source in thedatasection and the requested parameters in theoutputsections (one per section). For example:data "yandex_kubernetes_node_group" "my_node_group" { node_group_id = "<node_group_ID>" } output "node_group_status" { value = data.yandex_kubernetes_node_group.my_node_group.status }Where:
node_group_status: Name of the variable whose value will appear in the result.data.yandex_kubernetes_node_group.my_node_group.status: Requested parameter. In our case, it is the node group status.
For the list of node group parameters you can request this way, see this Terraform provider guide.
Tip
To request all available information about a node group, add the following
outputsection to the file:output "node_group" { value = data.yandex_kubernetes_node_group.my_node_group } -
Make sure the configuration files are correct:
-
In the command line, navigate to the folder containing the current Terraform configuration files.
-
Run this command:
terraform validateTerraform will display any configuration errors detected in your files.
-
-
Run this command:
terraform applyTerraform will display output variables in the terminal.
-
To check the result, run the following command by specifying the required variable, e.g.:
terraform output node_group_statusResult:
"running"
To get detailed information about a node group, use the get REST API method for the NodeGroup resource or the NodeGroupService/Get gRPC API call.