Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Managed Service for Kubernetes
  • Comparison with other Yandex Cloud services
  • Getting started
    • All guides
    • Connecting to a node over SSH
    • Connecting to a node via OS Login
    • Updating Kubernetes
    • Configuring autoscaling
      • Information about existing node groups
      • Creating a node group
      • Connecting to a node over SSH
      • Connecting to a node via OS Login
      • Configuring autoscaling
      • Updating a node group
      • Managing Kubernetes node labels
      • Deleting a node group
    • Connecting external nodes to the cluster
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes

In this article:

  • Changing node group parameters
  • Enabling access to nodes from the internet
  • Placing a taint on a node group
  • Removing a taint from a node group
  • Managing node group cloud labels
  • Adding a cloud label
  • Updating a cloud label
  • Deleting a cloud label
  • Changing the method of connecting to nodes in a node group
  • Changing metadata
  1. Step-by-step guides
  2. Managing a node group
  3. Updating a node group

Updating a Managed Service for Kubernetes node group

Written by
Yandex Cloud
Updated at May 5, 2025
  • Changing node group parameters
  • Enabling access to nodes from the internet
  • Placing a taint on a node group
  • Removing a taint from a node group
  • Managing node group cloud labels
    • Adding a cloud label
    • Updating a cloud label
    • Deleting a cloud label
  • Changing the method of connecting to nodes in a node group
  • Changing metadata

Individual nodes in node groups are Yandex Compute Cloud virtual machines with automatically generated names. To configure nodes, follow the instructions below or other node group management guides.

Alert

Do not change node VM settings, including names, network interfaces, and SSH keys, using the Compute Cloud interfaces or SSH connections to the VM.

This can disrupt the operation of individual nodes, groups of nodes, and the whole Managed Service for Kubernetes cluster.

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 |
+----------------------+----------------------+-------------+----------------------+---------------------+---------+------+

Before you start, make sure you have enough free resources in your cloud.

Changing node group parametersChanging node group parameters

You can change the following parameters of a Managed Service for Kubernetes node group:

  • Name.

  • Description.

  • Scaling for fixed type: Number of Managed Service for Kubernetes nodes. Scaling for automatic type: Minimum, maximum, and initial number of Managed Service for Kubernetes nodes. You cannot change the scaling type.

  • Kubernetes version.

  • Method of assigning IP addresses to group nodes: only internal addresses or public addresses as well.

  • List of security groups.

    Alert

    Do not delete security groups attached to a running Managed Service for Kubernetes node group as this may disrupt its operation and result in a loss of data.

  • Computing resources and Managed Service for Kubernetes node disk size.

  • Managed Service for Kubernetes node name template.

  • Updates policy.

To learn how to change the availability zone of a node group, see Migrating Kubernetes resources to a different availability zone.

Management console
CLI
Terraform
API

To update a Managed Service for Kubernetes node group:

  1. Go to the folder page and select Managed Service for Kubernetes.
  2. Click the cluster name.
  3. Go to the Node group tab.
  4. Select the required node group.
  5. Click Edit in the top-right corner.
  6. Change the required parameters in the window that opens.
  7. Click Save.

Get detailed information about the command to edit the Managed Service for Kubernetes node group:

yc managed-kubernetes node-group update --help

Use the following flags to update the Managed Service for Kubernetes node group:

  • --new-name: Change name.

  • --description: Change description.

  • --service-account-id, --service-account-name: Change service account for resources.

  • --node-service-account-id, --node-service-account-name: Change service account for Managed Service for Kubernetes nodes.

  • --version: Change Kubernetes version.

  • --network-interface: Network settings:

    • security-group-ids: IDs of Security groups.
    • subnets: Names of subnets that will host the nodes.
    • ipv4-address: Method of assigning an IPv4 address.
    • ipv6-address: Method of assigning an IPv6 address.

    ipv4-address and ipv6-address determine the method of assigning an IP address:

    • auto: Only the internal IP address is assigned to the node.
    • nat: Public and internal IP addresses are assigned to the node.
  • --network-acceleration-type: Change network acceleration type:

    • standard: No acceleration.

    • software-accelerated: Software-accelerated network.

      Warning

      Before activating a software-accelerated network, make sure that you have sufficient cloud resources available to create an additional Managed Service for Kubernetes node.

  • --node-name: Change name template for Managed Service for Kubernetes nodes. The name is unique if the template contains at least one of the following variables:

    • {instance_group.id}: Instance group ID.
    • {instance.index}: Unique instance number in the instance group. Possible values: 1 to N, where N is the number of instances in the group.
    • {instance.index_in_zone}: Instance number in a zone. It's unique for a specific instance group within the zone.
    • {instance.short_id}: Instance ID that is unique within the group. Consists of four letters.
    • {instance.zone_id}: Zone ID.

    For example, prod-{instance.short_id}-{instance_group.id}. If not specified, the default value is used: {instance_group.id}-{instance.short_id}.

  • --template-labels: Change node group cloud labels in <label_name>=<label_value> format. You can specify multiple labels separated by commas.

  • --latest-revision: Get all available updates for the current Managed Service for Kubernetes master version.

  • Scaling settings:

    • --fixed-size: Change fixed number of nodes in a Managed Service for Kubernetes node group.

    • --auto-scale: Change automatic scaling settings of the Managed Service for Kubernetes cluster:

      • min: Minimum number of nodes in the group.
      • max: Maximum number of nodes in the group.
      • initial: Initial number of nodes in the group.

    You cannot change the scaling type.

  • --auto-upgrade: Manage automatic updates.

  • Managing the maintenance window:

    • --anytime-maintenance-window: Update at any time.
    • --daily-maintenance-window: Update daily at the selected time.
    • --weekly-maintenance-window: Update on selected days.

Warning

  • The user-data metadata key is not supported for VM post-configuration or user data transmission.
  • To manage SSH keys, use the ssh-keys key.
  • For post-configuring nodes, use privileged DaemonSets. For example, sysctl-tuner.

To update a Managed Service for Kubernetes node group:

  1. Open the current Terraform configuration file describing the Managed Service for Kubernetes node group.

    For more information about creating this file, see Creating a node group.

  2. Edit the Managed Service for Kubernetes node group description properties.

    • To change the scaling settings, make the following changes in the scale_policy section:

      • For fixed scaling, change the fixed_scale.size parameter.

      • For automatic scaling, change the auto_scale section parameters:

        • min: Minimum number of nodes in the group.
        • max: Maximum number of nodes in the group.
        • initial: Initial number of nodes in the group.

      You cannot change the scaling type.

    • To update the node group cloud labels, add the instance_template.labels section:

      resource "yandex_kubernetes_node_group" "<node_group_name>" {
        ...
        instance_template {
          ...
          labels {
            "<label_name>"="<label_value>"
          }
        }
      }
      
    • To change the Managed Service for Kubernetes node name template, update the instance_template.name parameter. The name is unique if the template contains at least one of the following variables:

      • {instance_group.id}: Instance group ID.
      • {instance.index}: Unique instance number in the instance group. Possible values: 1 to N, where N is the number of instances in the group.
      • {instance.index_in_zone}: Instance number in a zone. It's unique for a specific instance group within the zone.
      • {instance.short_id}: Instance ID that is unique within the group. Consists of four letters.
      • {instance.zone_id}: Zone ID.

      For example, prod-{instance.short_id}-{instance_group.id}. If not specified, the default value is used: {instance_group.id}-{instance.short_id}.

    • To update DNS records:

      1. Create an internal or public DNS zone.

      2. Add the instance_template.network_interface.ipv4_dns_records section:

        resource "yandex_kubernetes_node_group" "<node_group_name>" {
          ...
          instance_template {
            network_interface {
              ipv4_dns_records {
                fqdn        = "<DNS_record_FQDN>"
                dns_zone_id = "<DNS_zone_ID>"
                ttl         = "<DNS_record_TTL_in_seconds>"
                ptr         = "<PTR_record_creation>"
              }
            }
          }
        }
        

        Where ptr denotes a PTR record creation: true or false.

        In a DNS record's FQDN, you can use a template with variables:

        • {instance_group.id}: Instance group ID.
        • {instance.index}: Unique instance number in the instance group. Possible values: 1 to N, where N is the number of instances in the group.
        • {instance.index_in_zone}: Instance number in a zone. It is unique for a specific instance group within a zone.
        • {instance.short_id}: Instance ID that is unique within the group. It consists of four alphabetic characters.
        • {instance.zone_id}: Zone ID.
  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    For more information, see the Terraform provider documentation.

To update a Managed Service for Kubernetes node group's properties, use the update method for the NodeGroup resource.

To update the node group cloud labels, provide their values in the nodeTemplate.labels parameter.

To update the Managed Service for Kubernetes node name template, provide it in the nodeTemplate.name parameter. The name is unique if the template contains at least one of the following variables:

  • {instance_group.id}: Instance group ID.
  • {instance.index}: Unique instance number in the instance group. Possible values: 1 to N, where N is the number of instances in the group.
  • {instance.index_in_zone}: Instance number in a zone. It's unique for a specific instance group within the zone.
  • {instance.short_id}: Instance ID that is unique within the group. Consists of four letters.
  • {instance.zone_id}: Zone ID.

For example, prod-{instance.short_id}-{instance_group.id}. If not specified, the default value is used: {instance_group.id}-{instance.short_id}.

To update DNS records, provide their settings in the nodeTemplate.v4AddressSpec.dnsRecordSpecs parameter. In a DNS record's FQDN, you can use the nodeTemplate.name node name template with variables.

Enabling access to nodes from the internetEnabling access to nodes from the internet

Management console
CLI
API
  1. Go to the folder page and select Managed Service for Kubernetes.
  2. Click the cluster name.
  3. Navigate to the Node group tab.
  4. Select the required node group.
  5. Click Edit in the top-right corner.
  6. Under Network settings, in the Public address field, select the Auto IP address assignment method. Nodes will get random public IP addresses from the Yandex Cloud address pool.
  7. Click Save.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To enable access to Managed Service for Kubernetes nodes from the internet:

  1. Get detailed information about the command to edit the Managed Service for Kubernetes node group:

    yc managed-kubernetes node-group update --help
    
  2. Run the node group update command with the --network-interface flag set:

    yc managed-kubernetes node-group update <node_group_ID_or_name> \
    ...
      --network-interface security-group-ids=[<security_group_IDs>],ipv4-address=nat
    

    You can find out the names and IDs of Managed Service for Kubernetes node groups from the list of node groups in the folder.

Use the update method for the NodeGroup resource.

Alternatively, you can grant internet access permission to Managed Service for Kubernetes cluster nodes by creating and setting up a NAT gateway or NAT instance. As a result, through static routing, traffic will be routed via the gateway or a separate VM instance with NAT features.

Note

If you assigned public IP addresses to the cluster nodes and then configured the NAT gateway or NAT instance, internet access via the public IP addresses will be disabled. For more information, see the Yandex Virtual Private Cloud documentation.

Placing a taint on a node groupPlacing a taint on a node group

Adding taints results in recreation of a Managed Service for Kubernetes node group. First, all nodes in the group are deleted, then nodes with the taint are added to the group.

Terraform
API

To place a taint on a node group:

  1. Open the current Terraform configuration file describing the Managed Service for Kubernetes node group.

    For more information about creating this file, see Creating a node group.

  2. Add the node_taints section to the node group description:

    resource "yandex_kubernetes_node_group" "<node_group_name>" {
      ...
      node_taints = [
        "<key>=<value>:<taint_effect>",
        ...
      ]
      ...
    }
    

    Specify a key and value. Select one of the available taint effects:

    • NoSchedule: Prohibit running new pods on the group's nodes (it does not affect the running ones).
    • PreferNoSchedule: Avoid running pods on the group's nodes if there are resources available for this purpose in other groups.
    • NoExecute: Stop pods on the group's nodes, evict them to other groups, and prohibit running new pods.

    You can place multiple taints by specifying them separated by commas.

  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    For more information, see the Terraform provider documentation.

To place a taint on a node group, use the update method for the NodeGroup and provide the following in the request:

  • Taints in the nodeTaints parameter.
  • The updatable nodeTaints parameter in the updateMask parameter.

Warning

The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

Removing a taint from a node groupRemoving a taint from a node group

Removing taints results in recreation of a Managed Service for Kubernetes node group. First, all nodes in the group are deleted, then nodes with the new configuration are added to the group.

Terraform
API

To remove a taint from a node group:

  1. Open the current Terraform configuration file describing the Managed Service for Kubernetes node group.

    For more information about creating this file, see Creating a node group.

  2. In the node group description, remove the taints you no longer need under node_taints.

  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

    For more information, see the Terraform provider documentation.

To remove a taint from a node group, use the update method for the NodeGroup and provide the following in the request:

  • A new set of taints in the nodeTaints parameter. If you want to remove all taints, put "nodeTaints": [] in the request.
  • nodeTaints parameter to update in the updateMask parameter.

Warning

The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

Managing node group cloud labelsManaging node group cloud labels

You can perform the following actions with cloud labels of Managed Service for Kubernetes node groups:

  • Add
  • Edit
  • Delete

Adding a cloud labelAdding a cloud label

Management console
CLI
Terraform
  1. Go to the folder page and select Managed Service for Kubernetes.
  2. Click the cluster name.
  3. Go to the Node group tab.
  4. Select the required node group.
  5. Click Edit in the top-right corner.
  6. In the Labels field, click Add label.
  7. Enter the key and the value, and press Enter.
  8. Click Save.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

Add a cloud label to a Managed Service for Kubernetes node group:

yc managed-kubernetes node-group add-labels my-node-group --labels new_label=test_label

Result:

done (28s)
id: catpl8c44kii********
cluster_id: catcsqidoos7********
...
  1. Open the current Terraform configuration file describing the Managed Service for Kubernetes node group.

    For more information about creating this file, see Creating a node group.

  2. Add the labels parameter to the Managed Service for Kubernetes node group description:

    resource "yandex_kubernetes_node_group" "<node_group_name>" {
      cluster_id = yandex_kubernetes_cluster.<cluster_name>.id
      ...
      labels = {
        "<cloud_label>" = "<value>"
      }
      ...
    }
    
  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see the Terraform provider documentation.

Updating a cloud labelUpdating a cloud label

Management console
CLI
Terraform

To update a cloud label, you will need to delete and re-create it:

  1. Go to the folder page and select Managed Service for Kubernetes.
  2. Click the cluster name.
  3. Go to the Node group tab.
  4. Select the required node group.
  5. Click Edit in the top-right corner.
  6. In the Labels field, click the cross next to the label to delete it.
  7. Click Add label and enter a new key and/or value for the label.
  8. Press Enter, then click Save.

Update a cloud label of a Managed Service for Kubernetes node group:

Warning

The existing labels (labels) will be completely overwritten by the ones you provide in your request.

yc managed-kubernetes node-group update my-node-group --labels test_label=my_ng_label

Result:

done (3s)
id: catpl8c44kii********
cluster_id: catcsqidoos7********
...
  1. Open the current Terraform configuration file describing the Managed Service for Kubernetes node group.

    For more information about creating this file, see Creating a node group.

  2. Edit the labels property in the Managed Service for Kubernetes node group description:

    resource "yandex_kubernetes_node_group" "<node_group_name>" {
      cluster_id = yandex_kubernetes_cluster.<cluster_name>.id
      ...
      labels = {
        "<cloud_label>" = "<value>"
        ...
      }
      ...
    }
    
  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see the Terraform provider documentation.

Deleting a cloud labelDeleting a cloud label

Management console
CLI
Terraform
  1. Go to the folder page and select Managed Service for Kubernetes.
  2. Click the cluster name.
  3. Go to the Node group tab.
  4. Select the required node group.
  5. Click Edit in the top-right corner.
  6. In the Labels field, click the cross next to the label.
  7. Click Save.

Delete a cloud label of a Managed Service for Kubernetes node group:

yc managed-kubernetes node-group remove-labels my-node-group --labels test_label

Result:

done (2s)
id: catpl8c44kii********
cluster_id: catcsqidoos7********
...
  1. Open the current Terraform configuration file describing the Managed Service for Kubernetes node group.

    For more information about creating this file, see Creating a node group.

  2. In the Managed Service for Kubernetes node group description, delete the cloud labels you no longer need under labels.

  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see the Terraform provider documentation.

Changing the method of connecting to nodes in a node groupChanging the method of connecting to nodes in a node group

Note

After the connection method is changed, the node group status will temporarily change to Reconciling: all the group's nodes will be recreated for the changes to take effect.

Management console
CLI
Terraform
API
  1. Go to the folder page and select Managed Service for Kubernetes.

  2. Click the cluster name.

  3. Go to the Node group tab.

  4. Select the required node group.

  5. Click Edit in the top-right corner.

  6. Change the connection method settings:

    1. To enable or disable access to nodes via OS Login, use the Access by OS Login option.

      Warning

      If access via OS Login is enabled, access via SSH keys will be unavailable.

      For more on configuring and using OS Login, see Connecting to a node via OS Login.

    2. To enable access to nodes using SSH keys:

      1. Make sure that access via OS Login is disabled.
      2. Make sure that the node group metadata contains at least one SSH key. If needed, add or delete keys by changing the metadata with the ssh-keys key.

      For more on preparing, configuring, and using SSH keys, see Connecting to a node over SSH.

    3. To disable access to nodes using SSH keys, do any one of the following:

      • Enable access via OS Login.

      • Change metadata by deleting the metadata with the ssh-keys key.

        After deleting this metadata, you will not be able to connect to the Managed Service for Kubernetes cluster nodes until you add one or more SSH keys.

  7. Click Save.

  1. To enable or disable access to nodes via OS Login, change the metadata value with the enable-oslogin key:

    • true: Access enabled.
    • false: Access disabled.

    Warning

    If access via OS Login is enabled, access via SSH keys will be unavailable.

    For more on configuring and using OS Login, see Connecting to a node via OS Login.

  2. To enable access to nodes using SSH keys:

    1. Make sure that access via OS Login is disabled.
    2. Make sure that the node group metadata contains at least one SSH key. If needed, add or delete keys by changing the metadata with the ssh-keys key.

    For more on preparing, configuring, and using SSH keys, see Connecting to a node over SSH.

  3. To disable access to nodes using SSH keys, do any one of the following:

    • Enable access via OS Login.

    • Change metadata by deleting the metadata with the ssh-keys key.

      After deleting this metadata, you will not be able to connect to the Managed Service for Kubernetes cluster nodes until you add one or more SSH keys.

  1. To enable or disable access to nodes via OS Login, change the metadata value with the enable-oslogin key:

    • true: Access enabled.
    • false: Access disabled.

    Warning

    If access via OS Login is enabled, access via SSH keys will be unavailable.

    For more on configuring and using OS Login, see Connecting to a node via OS Login.

  2. To enable access to nodes using SSH keys:

    1. Make sure that access via OS Login is disabled.
    2. Make sure that the node group metadata contains at least one SSH key. If needed, add or delete keys by changing the metadata with the ssh-keys key.

    For more on preparing, configuring, and using SSH keys, see Connecting to a node over SSH.

  3. To disable access to nodes using SSH keys, do any one of the following:

    • Enable access via OS Login.

    • Change metadata by deleting the metadata with the ssh-keys key.

      After deleting this metadata, you will not be able to connect to the Managed Service for Kubernetes cluster nodes until you add one or more SSH keys.

  1. To enable or disable access to nodes via OS Login, change the metadata value with the enable-oslogin key:

    • true: Access enabled.
    • false: Access disabled.

    Warning

    If access via OS Login is enabled, access via SSH keys will be unavailable.

    For more on configuring and using OS Login, see Connecting to a node via OS Login.

  2. To enable access to nodes using SSH keys:

    1. Make sure that access via OS Login is disabled.
    2. Make sure that the node group metadata contains at least one SSH key. If needed, add or delete keys by changing the metadata with the ssh-keys key.

    For more on preparing, configuring, and using SSH keys, see Connecting to a node over SSH.

  3. To disable access to nodes using SSH keys, do any one of the following:

    • Enable access via OS Login.

    • Change metadata by deleting the metadata with the ssh-keys key.

      After deleting this metadata, you will not be able to connect to the Managed Service for Kubernetes cluster nodes until you add one or more SSH keys.

Changing metadataChanging metadata

Warning

Metadata settings can affect the behavior and health of the group's nodes. Change these settings only if you know exactly what you want to do.

Providing user data in the metadata with the user-data key is not supported.

After you change the metadata, the node group status will temporarily change to Reconciling: all the group's nodes will be recreated for the changes to take effect.

Management console
CLI
Terraform
API
  1. Go to the folder page and select Managed Service for Kubernetes.

  2. Click the cluster name.

  3. Go to the Node group tab.

  4. Select the required node group.

  5. Click Edit in the top-right corner.

  6. Open the Metadata block and edit, add, or remove metadata for the nodes.

    To add metadata, click Add field. Specify the key and value for each metadata element in a separate set of fields.

  7. Click Save.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. To add or modify metadata with a specific key:

    1. View the description of the CLI command for adding and updating the Managed Service for Kubernetes node group metadata:

      yc managed-kubernetes node-group add-metadata --help
      
    2. To add new or modify existing metadata, run the following command:

      yc managed-kubernetes node-group add-metadata \
        --name <node_group_name> \
        --metadata <key>=<value>
      

      You can request the name of a node group with the list of node groups in the folder.

      You can request a list of existing metadata with detailed information about the node group.

      Tip

      Use the --metadata-from-file parameter instead of --metadata to get a value from a file:

      --metadata-from-file <key>=<path_to_file_with_value>
      

      The key value will be read from a file. This may be of use if the value is too long to provide it explicitly or contains line breaks or other special characters.

  2. To delete metadata with a specific key:

    1. See the description of the CLI command to delete the Managed Service for Kubernetes node group metadata:

      yc managed-kubernetes node-group remove-metadata --help
      
    2. Delete existing metadata:

      yc managed-kubernetes node-group remove-metadata \
        --name <node_group_name> \
        --keys <key>
      

      You can request the name of a node group with the list of node groups in the folder.

      You can request a list of existing metadata with detailed information about the node group.

  1. Open the current Terraform configuration file describing the Managed Service for Kubernetes node group.

    For more information about creating this file, see Creating a node group.

  2. To add, modify, or delete metadata with a specific key, edit the list of keys and values in the instance_template.metadata parameter. If there is no such parameter, add it.

    resource "yandex_kubernetes_node_group" "<node_group_name>" {
      cluster_id = yandex_kubernetes_cluster.<cluster_name>.id
      ...
      instance_template {
        metadata = {
          "<key>" = "<value>"
          ...
        }
        ...
      }
      ...
    }
    

    Tip

    Use the file() function to get a value from a file:

    "<key>" = file("<path_to_file_with_value>")
    

    The key value will be read from a file. This may be of use if the value is too long to provide it explicitly or contains line breaks or other special characters.

  3. Make sure the configuration files are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If 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.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see the Terraform provider documentation.

  1. Get all the existing metadata for the node group using the get REST API method for the NodeGroup resource, and provide the node group ID in the nodeGroupId request parameter.

    You can request the name of a node group with a list of node groups in the folder.

    The metadata will be listed as key=value pairs in the nodeTemplate.metadata field of the response.

  2. Use the update REST API method for the NodeGroup resource and include the following in the request:

    • Node group ID in the nodeGroupId parameter.

    • The updateMask parameter set to nodeTemplate.metadata.

      Warning

      The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

    • The nodeTemplate.metadata parameter listing the node group's metadata.

      Make the required changes to the metadata list you got in the previous step: add, modify, or delete key=value pairs. Then provide the updated list in the nodeTemplate.metadata parameter.

      Alert

      Metadata not listed in the nodeTemplate.metadata parameter will be deleted.

Was the article helpful?

Previous
Configuring autoscaling
Next
Managing Kubernetes node labels
Yandex project
© 2025 Yandex.Cloud LLC