---
title: "Edit Kubernetes cluster"
method: PUT
path: "/v1/kubernetes/{kubernetesId}"
tags: ["Kubernetes clusters"]
---

# Edit Kubernetes cluster

`PUT /v1/kubernetes/{kubernetesId}`

## Request

- Base URL: `https://api.emma.ms/external`
- URL: `https://api.emma.ms/external/v1/kubernetes/{kubernetesId}`
- Auth: HTTP bearer

The method for editing a Managed Kubernetes cluster enables you to delete and add new worker nodes and autoscaling groups, as well as change the settings of existing autoscaling groups. You can only edit a cluster when it is in "ACTIVE" status. To select hardware configurations for worker nodes, use the /v1/kubernetes-configs endpoint.

When editing a Kubernetes cluster, you can only add or delete worker nodes, but you cannot change the name or configuration of existing worker nodes. If you want to keep a node when editing a cluster, simply specify its ID in the 'workerNodes' object. All other fields in 'workerNodes' are ignored for existing nodes and are not required. If you want to delete a node, remove its ID.

When you create a new node, all fields in the 'workerNodes' object (except ID) are required. Do not add the ID field for a new node.

Please note that the spotMarkup field is ignored for the GCP provider.

If workerNodes is not provided, at least one autoscaling group must have minimumNodes >= 1. 

When you delete an autoscaling group with existing worker nodes, the worker nodes are also deleted.

During the changes, the cluster status will change to "UPDATING." Nodes undergoing changes will be displayed with a "PROVISIONING", "JOINING" status. When the changes are successfully applied, the cluster will transition back to the "ACTIVE" status, and the nodes will be in the "ACTIVE" status.

## Path parameters

- `kubernetesId` integer, required

## Request body

- KubernetesUpdateRequest
  - `workerNodes` object[]: List of the worker nodes. May be omitted when the cluster is updated with autoscaling groups only.
    - `id` integer: ID of the kubernetes worker node
    - `name` string, required: Name of the worker node
    - `dataCenterId` string, required: ID of the data center
    - `vCpuType` 'shared' | 'standard' | 'hpc', required: Type of the virtual Central Processing Unit (vCPU)
    - `vCpu` integer, required: Number of virtual Central Processing Units (vCPUs)
    - `ramGb` integer, required: Capacity of the RAM in gigabytes
    - `volumeType` 'ssd' | 'ssd-plus', required: Volume type
    - `volumeGb` integer, required: Capacity of the volume in gigabytes
    - `acceleratorTypeId` string: GPU accelerator type identifier (from the UI accelerator dictionary).
    - `accelerators` number, double: Number of GPUs for the node configuration.
    - `instanceType` 'on_demand' | 'spot': How the node's VM is purchased. Only read for a node being added — a node kept by `id` keeps how it was bought. At least one `on_demand` node is required per cluster.
  - `autoscalingConfigs` object[], nullable: Configurations of the autoscaling group. If `workerNodes` is omitted or empty, `autoscalingConfigs` must contain at least one group. Each group must have either node-count scaling fields (`minimumNodes`, `maximumNodes`, `targetNodes`) or vCPU-count scaling fields (`minimumVCpus`, `maximumVCpus`, `targetVCpus`) — but not both and not neither.
    - `groupName` string, required: Group name
    - `dataCenterId` string, required: ID of the data center
    - `minimumNodes` integer: Minimum number of nodes. Required when using node-count based autoscaling. Must be null if `minimumVCpus` is set.
    - `maximumNodes` integer: Maximum number of nodes. Required when using node-count based autoscaling. Must be null if `maximumVCpus` is set.
    - `targetNodes` integer: Deprecated alias of minOnDemandCount (former desired total node count). Used only when minOnDemandCount is not provided.
    - `minimumVCpus` integer, nullable: Minimum number of vCPUs. Required when using vCPU-count based autoscaling. Must be null if `minimumNodes` is set.
    - `maximumVCpus` integer, nullable: Maximum number of vCPUs. Required when using vCPU-count based autoscaling. Must be null if `maximumNodes` is set.
    - `targetVCpus` integer, nullable: Deprecated alias of minOnDemandCount (former desired total vCPU count). Used only when minOnDemandCount is not provided.
    - `minOnDemandCount` integer, nullable: Minimum guaranteed number of on-demand (non-spot) units in the group — nodes for node-count scaling, vCPUs for vCPU-count scaling. Allowed range is 0..maximum. It constrains the composition of the existing nodes, not the group size. Defaults to 0 (or to the deprecated target field when provided).
    - `nodeGroupPriceLimit` number: Price limit of the autoscaling group
    - `useOnDemandInstancesInsteadOfSpots` boolean, required: Use on-demand compute instances instead of spot compute instances
    - `spotPercent` integer: Percentage of spot instances in the autoscaling group
    - `spotMarkup` number: Extra markup to the spot instance price
    - `userLabels` object[], nullable: ASG label applied to nodes created by this autoscaling group
      - `key` string, required: ASG label key
      - `value` string, required: ASG label value
    - `configurationPriorities` object[], required: Compute instance configurations with priorities
      - `vCpuType` 'shared' | 'standard' | 'hpc': Type of the virtual Central Processing Unit (vCPU)
      - `vCpu` integer: Number of virtual Central Processing Units (vCPUs)
      - `ramGb` integer: Capacity of the RAM in gigabytes
      - `volumeGb` integer: Capacity of the volume in gigabytes
      - `volumeType` 'ssd' | 'ssd-plus': Volume type
      - `priority` 'high' | 'med' | 'low': Configuration priority

## Response `200`

Successful operation

- KubernetesUpdateResponse
  - `id` integer, required: Kubernetes cluster ID
  - `createdAt` string, date-time, required: Cluster creation date and time
  - `createdById` integer, required: ID of the user who created the cluster
  - `createdByName` string, required: Name of the user who created the cluster
  - `modifiedAt` string, date-time, required: Cluster last modification date and time
  - `modifiedByName` string, required: Name of the user who last modified the cluster
  - `modifiedById` integer, required: ID of the user who last modified the cluster
  - `name` string, required: Cluster name
  - `version` string, required: Kubernetes version
  - `deploymentLocation` string, required: Deployment location
  - `k8sConnectionType` 'direct_connect' | 'internet_connect', required: Kubernetes connection type
  - `domainName` string, nullable: Cluster domain name
  - `status` string, required: Cluster status
  - `controlPlaneStatus` 'CREATING' | 'ACTIVE' | 'UPDATING' | 'DEGRADED' | 'UNHEALTHY' | 'FAILED' | 'DESTRUCTION', required: Control plane status
  - `cost` object, required
    - `unit` string, required: Billing unit
    - `currency` string, required: Currency code
    - `price` number, double, required: Cost amount
  - `nodeGroups` object[], required: List of cluster node groups
    - `name` string, required: Node group name
    - `nodes` object[], required: List of nodes in the node group
      - `id` integer, required: Node ID
      - `createdAt` string, date-time, required: Node creation date and time
      - `name` string, required: Node name
      - `status` string, required: Node status
      - `instanceType` 'on_demand' | 'spot': How the node's VM was purchased. A `spot` node is cheaper, but the provider may reclaim it at any time and the platform then recreates it. Absent when the purchase mode cannot be resolved — read that as `on_demand`.
      - `nodeStatus` 'PROVISIONING' | 'JOINING' | 'ACTIVE' | 'PENDING' | 'DELETING' | 'FAILED': Worker node lifecycle status
      - `provider` object, required
        - `id` integer, required: Provider ID
        - `name` string, required: Provider name
      - `location` object, required
        - `id` integer, required: Location ID
        - `name` string, required: Location name
        - `country` string, required: Country
        - `continent` string, required: Continent
        - `region` string, required: Region
        - `latitude` number, double, required: Latitude
        - `longitude` number, double, required: Longitude
      - `dataCenter` object, required
        - `id` string, required: Data center ID
        - `name` string, required: Data center name
        - `providerName` string, required: Provider name
        - `providerId` integer, required: Provider ID
        - `locationId` integer, required: Location ID
        - `locationName` string, required: Location name
      - `os` object, required
        - `id` integer, required: Operating system ID
        - `family` string, required: OS family
        - `type` string, required: OS type
        - `architecture` string, required: OS architecture
        - `version` string, required: OS version
      - `cloudNetworkType` 'default' | 'multi-cloud', required: Cloud network type
      - `vCpuType` 'shared' | 'standard' | 'hpc', required: Type of the virtual Central Processing Unit (vCPU)
      - `vCpu` integer, required: Number of virtual Central Processing Units (vCPUs)
      - `ramGb` integer, required: Capacity of the RAM in gigabytes
      - `disks` object[], required: List of attached disks
        - `id` integer, required: Disk ID
        - `name` string, required: Disk name
        - `sizeGb` integer, required: Disk size in gigabytes
        - `typeId` integer, required: Disk type ID
        - `type` 'ssd' | 'ssd-plus', required: Disk type
        - `isBootable` boolean, required: Whether the disk is bootable
        - `deviceIdentifier` string, nullable: Device identifier of the volume as seen by the operating system
      - `networks` object[], nullable: List of attached networks
      - `cost` object, required
        - `unit` string, required: Billing unit
        - `currency` string, required: Currency code
        - `price` number, double, required: Cost amount
      - `securityGroup` object, nullable: Security group attached to the node
      - `accelerator` object, nullable: Accelerator attached to the node
      - `localDisks` object[], nullable: Local disks attached to the node
    - `status` 'CREATING' | 'ACTIVE' | 'SCALING_UP' | 'SCALING_DOWN' | 'READY' | 'UNHEALTHY' | 'DESTRUCTION', nullable: Node group (ASG) runtime status. Null for static (non-autoscaling) node groups.
    - `scalingPolicy` 'ENABLED' | 'SCALE_UP_ONLY' | 'SCALE_DOWN_ONLY' | 'DISABLED', nullable: Autoscaling policy applied to the node group. Null for static node groups.
  - `autoscalingConfigs` object[], required: Configurations of autoscaling groups
    - `groupName` string, required: Group name
    - `dataCenterId` string, required: ID of the data center
    - `minimumNodes` integer, required: Minimum number of nodes
    - `maximumNodes` integer, required: Maximum number of nodes
    - `targetNodes` integer, required: Target number of nodes
    - `minimumVCpus` integer, nullable: Minimum number of vCPUs. Required when using vCPU-count based autoscaling. Must be null if `minimumNodes` is set.
    - `maximumVCpus` integer, nullable: Maximum number of vCPUs. Required when using vCPU-count based autoscaling. Must be null if `maximumNodes` is set.
    - `targetVCpus` integer, nullable: Target number of vCPUs
    - `minOnDemandCount` integer, nullable: Minimum guaranteed number of on-demand (non-spot) units in the group — nodes for node-count scaling, vCPUs for vCPU-count scaling. Allowed range is 0..maximum. It constrains the composition of the existing nodes, not the group size. Defaults to 0 (or to the deprecated target field when provided).
    - `nodeGroupPriceLimit` number, double, nullable, required: Price limit of the autoscaling group
    - `useOnDemandInstancesInsteadOfSpots` boolean, required: Use on-demand compute instances instead of spot compute instances
    - `spotPercent` integer, required: Percentage of spot instances in the autoscaling group
    - `spotMarkup` number, double, required: Extra markup to the spot instance price
    - `userLabels` object[], nullable: ASG labels applied to nodes created by this autoscaling group
      - `key` string, required: ASG label key
      - `value` string, required: ASG label value. Required and non-nullable; empty string is allowed.
    - `configurationPriorities` object[], required: Compute instance configurations with priorities
      - `vCpuType` 'shared' | 'standard' | 'hpc', required: Type of the virtual Central Processing Unit (vCPU)
      - `vCpu` integer, required: Number of virtual Central Processing Units (vCPUs)
      - `ramGb` integer, required: Capacity of the RAM in gigabytes
      - `volumeGb` integer, required: Capacity of the volume in gigabytes
      - `volumeType` 'ssd' | 'ssd-plus', required: Volume type
      - `priority` 'high' | 'med' | 'low', required: Configuration priority
    - `limitsNotice` string, nullable: Limits notice message

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `422`: Unprocessable entity
- `500`: Internal server error

---

[API](https://skmtc.dev/emma/apis/public-emma-api.md) - [All operations](https://skmtc.dev/emma/apis/public-emma-api/llms.txt) - [OpenAPI document](https://skmtc.dev/emma/apis/public-emma-api/revisions/9e55f0920078?raw)
