Class: AWSCDK::EKS::CfnNodegroup::ScalingConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
eks/cfn_nodegroup.rb

Overview

An object representing the scaling configuration details for the Auto Scaling group that is associated with your node group.

When creating a node group, you must specify all or none of the properties. When updating a node group, you can specify any or none of the properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(desired_size: nil, max_size: nil, min_size: nil) ⇒ ScalingConfigProperty

Returns a new instance of ScalingConfigProperty.

Parameters:

  • desired_size (Numeric, nil) (defaults to: nil)

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

  • max_size (Numeric, nil) (defaults to: nil)

    The maximum number of nodes that the managed node group can scale out to.

  • min_size (Numeric, nil) (defaults to: nil)

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



1073
1074
1075
1076
1077
1078
1079
1080
# File 'eks/cfn_nodegroup.rb', line 1073

def initialize(desired_size: nil, max_size: nil, min_size: nil)
  @desired_size = desired_size
  Jsii::Type.check_type(@desired_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "desiredSize") unless @desired_size.nil?
  @max_size = max_size
  Jsii::Type.check_type(@max_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxSize") unless @max_size.nil?
  @min_size = min_size
  Jsii::Type.check_type(@min_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minSize") unless @min_size.nil?
end

Instance Attribute Details

#desired_sizeNumeric? (readonly)

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

If you use the Kubernetes Cluster Autoscaler , you shouldn't change the desired_size 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 min_size 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 the Cluster Autoscaler reduce the number if there are too many. When the Cluster Autoscaler is used, the desired_size parameter is altered by the Cluster Autoscaler (but can be out-of-date for short periods of time). the Cluster Autoscaler doesn't scale a managed node group lower than min_size or higher than max_size .



1092
1093
1094
# File 'eks/cfn_nodegroup.rb', line 1092

def desired_size
  @desired_size
end

#max_sizeNumeric? (readonly)

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 .



1099
1100
1101
# File 'eks/cfn_nodegroup.rb', line 1099

def max_size
  @max_size
end

#min_sizeNumeric? (readonly)

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



1104
1105
1106
# File 'eks/cfn_nodegroup.rb', line 1104

def min_size
  @min_size
end

Class Method Details

.jsii_propertiesObject



1106
1107
1108
1109
1110
1111
1112
# File 'eks/cfn_nodegroup.rb', line 1106

def self.jsii_properties
  {
    :desired_size => "desiredSize",
    :max_size => "maxSize",
    :min_size => "minSize",
  }
end

Instance Method Details

#to_jsiiObject



1114
1115
1116
1117
1118
1119
1120
1121
1122
# File 'eks/cfn_nodegroup.rb', line 1114

def to_jsii
  result = {}
  result.merge!({
    "desiredSize" => @desired_size,
    "maxSize" => @max_size,
    "minSize" => @min_size,
  })
  result.compact
end