update_nodegroup_config

EKS.Client.update_nodegroup_config(**kwargs)

Updates an Amazon EKS managed node group configuration. Your node group continues to function during the update. The response output includes an update ID that you can use to track the status of your node group update with the DescribeUpdate API operation. Currently you can update the Kubernetes labels for a node group or the scaling configuration.

See also: AWS API Documentation

Request Syntax

response = client.update_nodegroup_config(
    clusterName='string',
    nodegroupName='string',
    labels={
        'addOrUpdateLabels': {
            'string': 'string'
        },
        'removeLabels': [
            'string',
        ]
    },
    taints={
        'addOrUpdateTaints': [
            {
                'key': 'string',
                'value': 'string',
                'effect': 'NO_SCHEDULE'|'NO_EXECUTE'|'PREFER_NO_SCHEDULE'
            },
        ],
        'removeTaints': [
            {
                'key': 'string',
                'value': 'string',
                'effect': 'NO_SCHEDULE'|'NO_EXECUTE'|'PREFER_NO_SCHEDULE'
            },
        ]
    },
    scalingConfig={
        'minSize': 123,
        'maxSize': 123,
        'desiredSize': 123
    },
    updateConfig={
        'maxUnavailable': 123,
        'maxUnavailablePercentage': 123
    },
    clientRequestToken='string'
)
Parameters
  • clusterName (string) --

    [REQUIRED]

    The name of the Amazon EKS cluster that the managed node group resides in.

  • nodegroupName (string) --

    [REQUIRED]

    The name of the managed node group to update.

  • labels (dict) --

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

    • addOrUpdateLabels (dict) --

      Kubernetes labels to be added or updated.

      • (string) --
        • (string) --
    • removeLabels (list) --

      Kubernetes labels to be removed.

      • (string) --
  • taints (dict) --

    The Kubernetes taints to be applied to the nodes in the node group after the update. For more information, see Node taints on managed node groups.

    • addOrUpdateTaints (list) --

      Kubernetes taints to be added or updated.

      • (dict) --

        A property that allows a node to repel a set of pods. For more information, see Node taints on managed node groups.

        • key (string) --

          The key of the taint.

        • value (string) --

          The value of the taint.

        • effect (string) --

          The effect of the taint.

    • removeTaints (list) --

      Kubernetes taints to remove.

      • (dict) --

        A property that allows a node to repel a set of pods. For more information, see Node taints on managed node groups.

        • key (string) --

          The key of the taint.

        • value (string) --

          The value of the taint.

        • effect (string) --

          The effect of the taint.

  • scalingConfig (dict) --

    The scaling configuration details for the Auto Scaling group after the update.

    • minSize (integer) --

      The minimum number of nodes that the managed node group can scale in to.

    • maxSize (integer) --

      The maximum number of nodes that the managed node group can scale out to. For information about the maximum number that you can specify, see Amazon EKS service quotas in the Amazon EKS User Guide .

    • desiredSize (integer) --

      The current number of nodes that the managed node group should maintain.

      Warning

      If you use Cluster Autoscaler, you shouldn't change the desiredSize value directly, as this can cause the Cluster Autoscaler to suddenly scale up or scale down.

      Whenever this parameter changes, the number of worker nodes in the node group is updated to the specified size. If this parameter is given a value that is smaller than the current number of running worker nodes, the necessary number of worker nodes are terminated to match the given value. When using CloudFormation, no action occurs if you remove this parameter from your CFN template.

      This parameter can be different from minSize in some cases, such as when starting with extra hosts for testing. This parameter can also be different when you want to start with an estimated number of needed hosts, but let Cluster Autoscaler reduce the number if there are too many. When Cluster Autoscaler is used, the desiredSize parameter is altered by Cluster Autoscaler (but can be out-of-date for short periods of time). Cluster Autoscaler doesn't scale a managed node group lower than minSize or higher than maxSize.

  • updateConfig (dict) --

    The node group update configuration.

    • maxUnavailable (integer) --

      The maximum number of nodes unavailable at once during a version update. Nodes will be updated in parallel. This value or maxUnavailablePercentage is required to have a value.The maximum number is 100.

    • maxUnavailablePercentage (integer) --

      The maximum percentage of nodes unavailable during a version update. This percentage of nodes will be updated in parallel, up to 100 nodes at once. This value or maxUnavailable is required to have a value.

  • clientRequestToken (string) --

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    This field is autopopulated if not provided.

Return type

dict

Returns

Response Syntax

{
    'update': {
        'id': 'string',
        'status': 'InProgress'|'Failed'|'Cancelled'|'Successful',
        'type': 'VersionUpdate'|'EndpointAccessUpdate'|'LoggingUpdate'|'ConfigUpdate'|'AssociateIdentityProviderConfig'|'DisassociateIdentityProviderConfig'|'AssociateEncryptionConfig'|'AddonUpdate',
        'params': [
            {
                'type': 'Version'|'PlatformVersion'|'EndpointPrivateAccess'|'EndpointPublicAccess'|'ClusterLogging'|'DesiredSize'|'LabelsToAdd'|'LabelsToRemove'|'TaintsToAdd'|'TaintsToRemove'|'MaxSize'|'MinSize'|'ReleaseVersion'|'PublicAccessCidrs'|'LaunchTemplateName'|'LaunchTemplateVersion'|'IdentityProviderConfig'|'EncryptionConfig'|'AddonVersion'|'ServiceAccountRoleArn'|'ResolveConflicts'|'MaxUnavailable'|'MaxUnavailablePercentage',
                'value': 'string'
            },
        ],
        'createdAt': datetime(2015, 1, 1),
        'errors': [
            {
                'errorCode': 'SubnetNotFound'|'SecurityGroupNotFound'|'EniLimitReached'|'IpNotAvailable'|'AccessDenied'|'OperationNotPermitted'|'VpcIdNotFound'|'Unknown'|'NodeCreationFailure'|'PodEvictionFailure'|'InsufficientFreeAddresses'|'ClusterUnreachable'|'InsufficientNumberOfReplicas'|'ConfigurationConflict'|'AdmissionRequestDenied'|'UnsupportedAddonModification'|'K8sResourceNotFound',
                'errorMessage': 'string',
                'resourceIds': [
                    'string',
                ]
            },
        ]
    }
}

Response Structure

  • (dict) --

    • update (dict) --

      An object representing an asynchronous update.

      • id (string) --

        A UUID that is used to track the update.

      • status (string) --

        The current status of the update.

      • type (string) --

        The type of the update.

      • params (list) --

        A key-value map that contains the parameters associated with the update.

        • (dict) --

          An object representing the details of an update request.

          • type (string) --

            The keys associated with an update request.

          • value (string) --

            The value of the keys submitted as part of an update request.

      • createdAt (datetime) --

        The Unix epoch timestamp in seconds for when the update was created.

      • errors (list) --

        Any errors associated with a Failed update.

        • (dict) --

          An object representing an error when an asynchronous operation fails.

          • errorCode (string) --

            A brief description of the error.

            • SubnetNotFound : We couldn't find one of the subnets associated with the cluster.
            • SecurityGroupNotFound : We couldn't find one of the security groups associated with the cluster.
            • EniLimitReached : You have reached the elastic network interface limit for your account.
            • IpNotAvailable : A subnet associated with the cluster doesn't have any free IP addresses.
            • AccessDenied : You don't have permissions to perform the specified operation.
            • OperationNotPermitted : The service role associated with the cluster doesn't have the required access permissions for Amazon EKS.
            • VpcIdNotFound : We couldn't find the VPC associated with the cluster.
          • errorMessage (string) --

            A more complete description of the error.

          • resourceIds (list) --

            An optional field that contains the resource IDs associated with the error.

            • (string) --

Exceptions

  • EKS.Client.exceptions.InvalidParameterException
  • EKS.Client.exceptions.ClientException
  • EKS.Client.exceptions.ServerException
  • EKS.Client.exceptions.ResourceInUseException
  • EKS.Client.exceptions.ResourceNotFoundException
  • EKS.Client.exceptions.InvalidRequestException