Deleting a node group
To delete a node group, use its name or ID.
To access a node group, use its name or unique ID obtained using the command:
yc managed-kubernetes node-group list
Result:
+----------------------+----------------------+-------------+----------------------+---------------------+---------+------+
| ID | CLUSTER ID | NAME | INSTANCE GROUP ID | CREATED AT | STATUS | SIZE |
+----------------------+----------------------+-------------+----------------------+---------------------+---------+------+
| catt3knapbq5******** | cati493bu7ia******** | k8s-demo-ng | cl1tbm76ms7p******** | 2019-11-20 12:01:02 | RUNNING | 2 |
+----------------------+----------------------+-------------+----------------------+---------------------+---------+------+
To delete a node group:
- Navigate to the Kubernetes cluster you want to delete a node group from:
- Open the Managed Service for Kubernetes section in the folder.
- Open the Kubernetes cluster you need.
- Navigate to the Node manager tab.
- On the Node group tab, click
in the row with the node group to delete. - In the menu that opens, click Delete.
- In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
-
Delete the node group:
yc k8s node-group delete <node_group_name>Result:
done -
Make sure the node group was deleted:
yc managed-kubernetes node-group listResult:
+----+------------+------+-------------------+------------+--------+------+ | ID | CLUSTER ID | NAME | INSTANCE GROUP ID | CREATED AT | STATUS | SIZE | +----+------------+------+-------------------+------------+--------+------+ +----+------------+------+-------------------+------------+--------+------+
To delete a node group:
-
Open the current Terraform configuration file describing the node group.
For more information about creating this file, see Creating a node group.
-
Delete the section describing the group you no longer need.
-
Make sure the configuration files are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
Timeouts
The Terraform provider sets time limits for operations with Managed Service for Kubernetes cluster node groups:
- Creating and editing: 60 minutes.
- Deleting: 20 minutes.
Operations in excess of this time will be interrupted.
How do I modify these limits?
Add the
timeoutssection to the cluster node group description, e.g.:resource "yandex_kubernetes_node_group" "<node_group_name>" { ... timeouts { create = "1h30m" update = "1h30m" delete = "60m" } } -
For more information, see this Terraform provider guide.