Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for Kubernetes
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Connecting to a node over SSH
    • Creating a configuration file
    • Configuring a Kubernetes cluster network
      • Granting access to an app running in a Kubernetes cluster
      • Using Kubernetes cluster network policies
    • Encrypting secrets
    • Using persistent volumes
      • Dynamically preparing volumes
      • Statically preparing volumes
      • Managing storage classes
      • Expanding a volume
      • Mounting a volume in Block mode
    • Managing a Kubernetes cluster
      • Adding Kubernetes cluster credentials to the kubectl configuration file
      • Getting information about a Kubernetes cluster
      • Creating a Kubernetes cluster
      • Editing a Kubernetes cluster
      • Deleting a Kubernetes cluster
    • Managing a node group
      • Getting information about a node group
      • Creating a node group
      • Editing a node group
      • Deleting a node group
  • Solutions
    • Integration with Container Registry
    • Running workloads with GPUs
    • Making backups to Object Storage
  • Concepts
    • Relationship between service resources
    • Release channels and updates
    • Using Kubernetes API objects
      • Volume
      • Service
    • Node group
      • Autoscaling node groups
      • Evicting pods from a node
      • Dynamic resource allocation for a node
      • Node groups with GPUs
    • Kubernetes cluster network policies
    • Quotas and limits
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • ClusterService
      • NodeGroupService
      • VersionService
      • OperationService
    • REST
      • Overview
      • Cluster
        • Overview
        • create
        • delete
        • get
        • list
        • listNodeGroups
        • listNodes
        • listOperations
        • start
        • stop
        • update
      • NodeGroup
        • Overview
        • create
        • delete
        • get
        • list
        • listNodes
        • listOperations
        • update
      • Version
        • Overview
        • list
  • Questions and answers
  1. API reference
  2. REST
  3. NodeGroup
  4. create

Method create

  • HTTP request
  • Body parameters
  • Response

Creates a node group in the specified Kubernetes cluster.

HTTP request

POST https://mks.api.cloud.yandex.net/managed-kubernetes/v1/nodeGroups

Body parameters

{
  "clusterId": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "nodeTemplate": {
    "platformId": "string",
    "resourcesSpec": {
      "memory": "string",
      "cores": "string",
      "coreFraction": "string",
      "gpus": "string"
    },
    "bootDiskSpec": {
      "diskTypeId": "string",
      "diskSize": "string"
    },
    "metadata": "object",
    "v4AddressSpec": {
      "oneToOneNatSpec": {
        "ipVersion": "string"
      }
    },
    "schedulingPolicy": {
      "preemptible": true
    },
    "networkInterfaceSpecs": [
      {
        "subnetIds": [
          "string"
        ],
        "primaryV4AddressSpec": {
          "oneToOneNatSpec": {
            "ipVersion": "string"
          }
        },
        "primaryV6AddressSpec": {
          "oneToOneNatSpec": {
            "ipVersion": "string"
          }
        },
        "securityGroupIds": [
          "string"
        ]
      }
    ]
  },
  "scalePolicy": {

    // `scalePolicy` includes only one of the fields `fixedScale`, `autoScale`
    "fixedScale": {
      "size": "string"
    },
    "autoScale": {
      "minSize": "string",
      "maxSize": "string",
      "initialSize": "string"
    },
    // end of the list of possible fields`scalePolicy`

  },
  "allocationPolicy": {
    "locations": [
      {
        "zoneId": "string",
        "subnetId": "string"
      }
    ]
  },
  "deployPolicy": {
    "maxUnavailable": "string",
    "maxExpansion": "string"
  },
  "version": "string",
  "maintenancePolicy": {
    "autoUpgrade": true,
    "autoRepair": true,
    "maintenanceWindow": {

      // `maintenancePolicy.maintenanceWindow` includes only one of the fields `anytime`, `dailyMaintenanceWindow`, `weeklyMaintenanceWindow`
      "anytime": {},
      "dailyMaintenanceWindow": {
        "startTime": {
          "hours": "integer",
          "minutes": "integer",
          "seconds": "integer",
          "nanos": "integer"
        },
        "duration": "string"
      },
      "weeklyMaintenanceWindow": {
        "daysOfWeek": [
          {
            "days": [
              "string"
            ],
            "startTime": {
              "hours": "integer",
              "minutes": "integer",
              "seconds": "integer",
              "nanos": "integer"
            },
            "duration": "string"
          }
        ]
      },
      // end of the list of possible fields`maintenancePolicy.maintenanceWindow`

    }
  },
  "allowedUnsafeSysctls": [
    "string"
  ],
  "nodeTaints": [
    {
      "key": "string",
      "value": "string",
      "effect": "string"
    }
  ],
  "nodeLabels": "object"
}
Field Description
clusterId string

Required. ID of the Kubernetes cluster to create a node group in. To get the Kubernetes cluster ID, use a list request.

name string

Name of the node group. The name must be unique within the folder.

Value must match the regular expression \|<a href="%5B-a-z0-9%5D%7B0,61%7D%5Ba-z0-9%5D">a-z</a>?.

description string

Description of the node group.

The maximum string length in characters is 256.

labels object

Resource labels as key:value pairs.

No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-<em>./@0-9a-z]*. The maximum string length in characters for each value is 63. Each value must match the regular expression [-</em>./@0-9a-z]*.

nodeTemplate object

Required. Node template for creating the node group.

nodeTemplate.
platformId
string

ID of the hardware platform configuration for the node.

nodeTemplate.
resourcesSpec
object

Computing resources of the node such as the amount of memory and number of cores.

nodeTemplate.
resourcesSpec.
memory
string (int64)

Amount of memory available to the node, specified in bytes.

The minimum value is 0.

nodeTemplate.
resourcesSpec.
cores
string (int64)

Number of cores available to the node.

The minimum value is 0.

nodeTemplate.
resourcesSpec.
coreFraction
string (int64)

Baseline level of CPU performance with the possibility to burst performance above that baseline level. This field sets baseline performance for each core.

Acceptable values are 0 to 100, inclusive.

nodeTemplate.
resourcesSpec.
gpus
string (int64)

Number of GPUs available to the node.

The minimum value is 0.

nodeTemplate.
bootDiskSpec
object

Specification for the boot disk that will be attached to the node.

nodeTemplate.
bootDiskSpec.
diskTypeId
string

ID of the disk type.

Value must match the regular expression \|network-ssd\|network-hdd.

nodeTemplate.
bootDiskSpec.
diskSize
string (int64)

Size of the disk, specified in bytes.

Acceptable values are 0 to 4398046511104, inclusive.

nodeTemplate.
metadata
object

The metadata as key:value pairs assigned to this instance template. This includes custom metadata and predefined keys.

For example, you may use the metadata in order to provide your public SSH key to the node. For more information, see Metadata.

No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*. The maximum string length in characters for each value is 131072.

nodeTemplate.
v4AddressSpec
object

Specification for the create network interfaces for the node group compute instances. Deprecated, please use network_interface_specs.

nodeTemplate.
v4AddressSpec.
oneToOneNatSpec
object

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.

nodeTemplate.
v4AddressSpec.
oneToOneNatSpec.
ipVersion
string

IP version for the public IP address.

  • IPV4: IPv4 address, for example 192.168.0.0.
  • IPV6: IPv6 address, not available yet.
nodeTemplate.
schedulingPolicy
object

Scheduling policy configuration.

nodeTemplate.
schedulingPolicy.
preemptible
boolean (boolean)

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.

nodeTemplate.
networkInterfaceSpecs[]
object

New api, to specify network interfaces for the node group compute instances. Can not be used together with 'v4_address_spec'

nodeTemplate.
networkInterfaceSpecs[].
subnetIds[]
string

IDs of the subnets.

nodeTemplate.
networkInterfaceSpecs[].
primaryV4AddressSpec
object

Primary IPv4 address that is assigned to the instance for this network interface.

nodeTemplate.
networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec
object

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.

nodeTemplate.
networkInterfaceSpecs[].
primaryV4AddressSpec.
oneToOneNatSpec.
ipVersion
string

IP version for the public IP address.

  • IPV4: IPv4 address, for example 192.168.0.0.
  • IPV6: IPv6 address, not available yet.
nodeTemplate.
networkInterfaceSpecs[].
primaryV6AddressSpec
object

Primary IPv6 address that is assigned to the instance for this network interface.

nodeTemplate.
networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec
object

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.

nodeTemplate.
networkInterfaceSpecs[].
primaryV6AddressSpec.
oneToOneNatSpec.
ipVersion
string

IP version for the public IP address.

  • IPV4: IPv4 address, for example 192.168.0.0.
  • IPV6: IPv6 address, not available yet.
nodeTemplate.
networkInterfaceSpecs[].
securityGroupIds[]
string

IDs of security groups.

scalePolicy object

Required. Scale policy of the node group.

scalePolicy.
fixedScale
object
Fixed scale policy of the node group.
scalePolicy includes only one of the fields fixedScale, autoScale

scalePolicy.
fixedScale.
size
string (int64)

Number of nodes in the node group.

Acceptable values are 0 to 100, inclusive.

scalePolicy.
autoScale
object
Auto scale policy of the node group.
scalePolicy includes only one of the fields fixedScale, autoScale

scalePolicy.
autoScale.
minSize
string (int64)

Minimum number of nodes in the node group.

Acceptable values are 0 to 100, inclusive.

scalePolicy.
autoScale.
maxSize
string (int64)

Maximum number of nodes in the node group.

Acceptable values are 0 to 100, inclusive.

scalePolicy.
autoScale.
initialSize
string (int64)

Initial number of nodes in the node group.

Acceptable values are 0 to 100, inclusive.

allocationPolicy object

Allocation policy of the node group by the zones and regions.

allocationPolicy.
locations[]
object

List of locations where resources for the node group will be allocated.

allocationPolicy.
locations[].
zoneId
string

Required. ID of the availability zone where the nodes may reside.

allocationPolicy.
locations[].
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.

deployPolicy object

Deploy policy according to which the updates are rolled out. If not specified, the default is used.

deployPolicy.
maxUnavailable
string (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 maxExpansion is not specified or set to zero, maxUnavailable must be set to a non-zero value.

Acceptable values are 0 to 100, inclusive.

deployPolicy.
maxExpansion
string (int64)

The maximum number of instances that can be temporarily allocated above the group's target size during the update process. If maxUnavailable is not specified or set to zero, maxExpansion must be set to a non-zero value.

Acceptable values are 0 to 100, inclusive.

version string

Version of Kubernetes components that runs on the nodes.

maintenancePolicy object

Maintenance policy of the node group.

maintenancePolicy.
autoUpgrade
boolean (boolean)

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.

maintenancePolicy.
autoRepair
boolean (boolean)

If set to true, automatic repairs are enabled. Default value is false.

maintenancePolicy.
maintenanceWindow
object

Maintenance window settings. Update will start at the specified time and last no more than the specified duration. The time is set in UTC.

maintenancePolicy.
maintenanceWindow.
anytime
object
Updating the master at any time.
maintenancePolicy.maintenanceWindow includes only one of the fields anytime, dailyMaintenanceWindow, weeklyMaintenanceWindow

maintenancePolicy.
maintenanceWindow.
dailyMaintenanceWindow
object
Updating the master on any day during the specified time window.
maintenancePolicy.maintenanceWindow includes only one of the fields anytime, dailyMaintenanceWindow, weeklyMaintenanceWindow

maintenancePolicy.
maintenanceWindow.
dailyMaintenanceWindow.
startTime
object

Required. Window start time, in the UTC timezone.

Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and google.protobuf.Timestamp.

maintenancePolicy.
maintenanceWindow.
dailyMaintenanceWindow.
startTime.
hours
integer (int32)

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

maintenancePolicy.
maintenanceWindow.
dailyMaintenanceWindow.
startTime.
minutes
integer (int32)

Minutes of hour of day. Must be from 0 to 59.

maintenancePolicy.
maintenanceWindow.
dailyMaintenanceWindow.
startTime.
seconds
integer (int32)

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

maintenancePolicy.
maintenanceWindow.
dailyMaintenanceWindow.
startTime.
nanos
integer (int32)

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

maintenancePolicy.
maintenanceWindow.
dailyMaintenanceWindow.
duration
string

Window duration.

Acceptable values are 3600 seconds to 86400 seconds, inclusive.

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow
object
Updating the master on selected days during the specified time window.
maintenancePolicy.maintenanceWindow includes only one of the fields anytime, dailyMaintenanceWindow, weeklyMaintenanceWindow

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[]
object

Required. Days of the week and the maintenance window for these days when automatic updates are allowed.

The number of elements must be in the range 1-7.

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[].
days[]
string

Represents a day of week.

  • DAY_OF_WEEK_UNSPECIFIED: The unspecified day-of-week.
  • MONDAY: The day-of-week of Monday.
  • TUESDAY: The day-of-week of Tuesday.
  • WEDNESDAY: The day-of-week of Wednesday.
  • THURSDAY: The day-of-week of Thursday.
  • FRIDAY: The day-of-week of Friday.
  • SATURDAY: The day-of-week of Saturday.
  • SUNDAY: The day-of-week of Sunday.
maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[].
startTime
object

Required. Window start time, in the UTC timezone.

Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may choose to allow leap seconds. Related types are google.type.Date and google.protobuf.Timestamp.

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[].
startTime.
hours
integer (int32)

Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[].
startTime.
minutes
integer (int32)

Minutes of hour of day. Must be from 0 to 59.

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[].
startTime.
seconds
integer (int32)

Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[].
startTime.
nanos
integer (int32)

Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

maintenancePolicy.
maintenanceWindow.
weeklyMaintenanceWindow.
daysOfWeek[].
duration
string

Window duration.

Acceptable values are 3600 seconds to 86400 seconds, inclusive.

allowedUnsafeSysctls[] string

Support for unsafe sysctl parameters. For more details see documentation.

The maximum string length in characters for each value is 253. Each value must match the regular expression (<a href="%5B-_a-z0-9%5D*%5Ba-z0-9%5D">a-z0-9</a>?.)<em>([a-z0-9][-_a-z0-9]</em>)?[a-z0-9*].

nodeTaints[] object

Taints that are applied to the nodes of the node group at creation time.

nodeTaints[].
key
string

The taint key to be applied to a node.

nodeTaints[].
value
string

The taint value corresponding to the taint key.

nodeTaints[].
effect
string

The effect of the taint on pods that do not tolerate the taint.

  • 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.
nodeLabels object

Labels that are assigned to the nodes of the node group at creation time.

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "metadata": "object",

  //  includes only one of the fields `error`, `response`
  "error": {
    "code": "integer",
    "message": "string",
    "details": [
      "object"
    ]
  },
  "response": "object",
  // end of the list of possible fields

}

An Operation resource. For more information, see Operation.

Field Description
id string

ID of the operation.

description string

Description of the operation. 0-256 characters long.

createdAt string (date-time)

Creation timestamp.

String in RFC3339 text format.

createdBy string

ID of the user or service account who initiated the operation.

modifiedAt string (date-time)

The time when the Operation resource was last modified.

String in RFC3339 text format.

done boolean (boolean)

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata object

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response

The error result of the operation in case of failure or cancellation.

error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

In this article:
  • HTTP request
  • Body parameters
  • Response
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC