UpdateNodegroupConfig
In this article:
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.
Type: UpdateLabelsPayload object
Required: No
scalingConfig — Information on scaling settings for Auto Scaling Group after an update.
Type: NodegroupScalingConfig object
Required: No
taints — The Kubernetes taints to be applied to the nodes in the node group after the update.
Type: UpdateTaintsPayload object
Required: No
updateConfig — The node group update configuration.
Type: NodegroupUpdateConfig object
Required: No
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.
Type: Update object
Examples#
boto3 K2 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="",
)
eks_client = session.client(
'eks',
endpoint_url='https://eks.k2.cloud/',
)
eks_client.update_nodegroup_config(
clusterName="production",
nodegroupName="first",
labels={
"addOrUpdateLabels": {
"labelkey": "labelvalue"
},
"removeLabels": ["labeltoremove"],
},
scalingConfig={
"minSize": 1,
"maxSize": 3,
"desiredSize": 2,
},
taints={
"addOrUpdateTaints": [
{"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 K2 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.k2.cloud/ \
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