UpdateNodegroupConfig#

Description#

Request to update a node group configuration. The node group continues to function during the update. The request can be used to update the Kubernetes labels and taints for the node group or scaling settings.

Request Syntax#

 POST /clusters/name/node-groups/nodegroupName/update-config HTTP/1.1

 Content-type: application/json
 {
    "labels": {
       "addOrUpdateLabels": {
          "string" : "string"
       },
       "removeLabels": [ "string" ]
    },
    "scalingConfig": {
       "desiredSize": number,
       "maxSize": number,
       "minSize": number
    },
    "taints": {
       "addOrUpdateTaints": [
          {
             "effect": "string",
             "key": "string",
             "value": "string"
          }
       ],
       "removeTaints": [
          {
             "effect": "string",
             "key": "string",
             "value": "string"
          }
       ]
    },
    "updateConfig": {
       "maxUnavailable": number,
       "maxUnavailablePercentage": number
    }
 }

URI Request Parameters#

The request uses the following URI parameters.

  • name — The name of the cluster containing the node group.

    • Type: String

    • Required: Yes

  • nodegroupName — The name of the node group to update.

    • Required: Yes

Request Parameters#

  • labels — The Kubernetes labels to be applied to the worker nodes in the node group after the update.

  • scalingConfig — Information on scaling settings for Auto Scaling Group after an update.

  • taints — The Kubernetes taints to be applied to the nodes in the node group after the update.

  • updateConfig — The node group update configuration.

Response Syntax#

HTTP/1.1 200
Content-type: application/json

{
   "update": {
      "createdAt": number,
      "errors": [
         {
            "errorCode": "string",
            "errorMessage": "string",
            "resourceIds": [ "string" ]
         }
      ],
      "id": "string",
      "params": [
         {
            "type": "string",
            "value": "string"
         }
      ],
      "status": "string",
      "type": "string"
   }
}

Response Elements#

If the request is executed successfully, API will return an HTTP response with 200 code. The response contains the following data in JSON format.

  • update — The description of an asynchronous update description.

Examples#

boto3 CROC Cloud boto3 Client
import boto3

session = boto3.Session(
   aws_access_key_id="<AWS_ACCESS_KEY_ID>",
   aws_secret_access_key="<AWS_SECRET_ACCESS_KEY>",
   region_name="ngn",
)

eks_client = session.client(
   'eks',
   endpoint_url='https://eks.cloud.ngn.com.tr/',
)

eks_client.update_nodegroup_config(
    clusterName="production",
    nodegroupName="first",
    labels={
        "addOrUpdateLabels": {
            "labelkey": "labelvalue"
        },
        "removeLabels": ["labeltoremove"],
    },
    scalingConfig={
        "min_size": 1,
        "max_size": 3,
        "desired_size": 2,
    },
    taints={
        "taintsToAdd": [
            {"key": "first", "value": "value", "effect": "NO_SCHEDULE"},
            {"key": "second", "value": "value", "effect": "NO_EXECUTE"},
        ],
        "removeTaints": [
            {"key": "third", "value": "value", "effect": "NO_EXECUTE"},
        ],
    }
    updateConfig={
        "maxUnavailable" 10,
    }
)
c2-eks CROC Cloud API Client
c2-eks UpdateNodegroupConfig \
    clusterName production \
    nodegroupName first \
    taints.addOrUpdateTaints.0.key first \
    taints.addOrUpdateTaints.0.value value \
    taints.addOrUpdateTaints.0.effect NO_SCHEDULE \
    taints.removeTaints.0.key second \
    taints.removeTaints.0.value value \
    taints.removeTaints.0.effect NO_SCHEDULE \
    labels.addOrUpdateLabels.one value \
    labels.addOrUpdateLabels.two value \
    labels.removeLabels.0 three \
    scalingConfig.minSize 1 \
    scalingConfig.desiredSize 2 \
    scalingConfig.maxSize 3
aws-cli
aws eks --endpoint https://eks.cloud.ngn.com.tr/ \
    update-nodegroup-config \
  --cluster-name production \
  --nodegroup-name first \
  --labels addOrUpdateLabels={one=value,two=value},removeLabels=three,four \
  --taints addOrUpdateTaints=[{key=key,value=string,effect=string},{key=string,value=string,effect=string}],removeTaints=[{key=string,value=string,effect=string},{key=string,value=string,effect=string}] \
  --scaling-config minSize=1,maxSize=3,desiredSize=2 \
  --update-config maxUnavailable=1