Class: AWSCDK::EKS::NodegroupOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EKS::NodegroupOptions
- Defined in:
- eks/nodegroup_options.rb
Overview
The Nodegroup Options for addNodeGroup() method.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ami_type ⇒ AWSCDK::EKS::NodegroupAmiType?
readonly
The AMI type for your node group.
-
#capacity_type ⇒ AWSCDK::EKS::CapacityType?
readonly
The capacity type of the nodegroup.
-
#desired_size ⇒ Numeric?
readonly
The current number of worker nodes that the managed node group should maintain.
-
#disk_size ⇒ Numeric?
readonly
The root device disk size (in GiB) for your node group instances.
-
#enable_node_auto_repair ⇒ Boolean?
readonly
Specifies whether to enable node auto repair for the node group.
-
#force_update ⇒ Boolean?
readonly
Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue.
-
#instance_types ⇒ Array<AWSCDK::EC2::InstanceType>?
readonly
The instance types to use for your node group.
-
#labels ⇒ Hash{String => String}?
readonly
The Kubernetes labels to be applied to the nodes in the node group when they are created.
-
#launch_template_spec ⇒ AWSCDK::EKS::LaunchTemplateSpec?
readonly
Launch template specification used for the nodegroup.
-
#max_size ⇒ Numeric?
readonly
The maximum number of worker nodes that the managed node group can scale out to.
-
#max_unavailable ⇒ Numeric?
readonly
The maximum number of nodes unavailable at once during a version update.
-
#max_unavailable_percentage ⇒ Numeric?
readonly
The maximum percentage of nodes unavailable during a version update.
-
#min_size ⇒ Numeric?
readonly
The minimum number of worker nodes that the managed node group can scale in to.
-
#node_role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM role to associate with your node group.
-
#nodegroup_name ⇒ String?
readonly
Name of the Nodegroup.
-
#release_version ⇒ String?
readonly
The AMI version of the Amazon EKS-optimized AMI to use with your node group (for example,
1.14.7-YYYYMMDD). -
#remote_access ⇒ AWSCDK::EKS::NodegroupRemoteAccess?
readonly
The remote access (SSH) configuration to use with your node group.
-
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
The removal policy applied to the managed node group.
-
#subnets ⇒ AWSCDK::EC2::SubnetSelection?
readonly
The subnets to use for the Auto Scaling group that is created for your node group.
-
#tags ⇒ Hash{String => String}?
readonly
The metadata to apply to the node group to assist with categorization and organization.
-
#taints ⇒ Array<AWSCDK::EKS::TaintSpec>?
readonly
The Kubernetes taints to be applied to the nodes in the node group when they are created.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ami_type: nil, capacity_type: nil, desired_size: nil, disk_size: nil, enable_node_auto_repair: nil, force_update: nil, instance_types: nil, labels: nil, launch_template_spec: nil, max_size: nil, max_unavailable: nil, max_unavailable_percentage: nil, min_size: nil, nodegroup_name: nil, node_role: nil, release_version: nil, remote_access: nil, removal_policy: nil, subnets: nil, tags: nil, taints: nil) ⇒ NodegroupOptions
constructor
A new instance of NodegroupOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(ami_type: nil, capacity_type: nil, desired_size: nil, disk_size: nil, enable_node_auto_repair: nil, force_update: nil, instance_types: nil, labels: nil, launch_template_spec: nil, max_size: nil, max_unavailable: nil, max_unavailable_percentage: nil, min_size: nil, nodegroup_name: nil, node_role: nil, release_version: nil, remote_access: nil, removal_policy: nil, subnets: nil, tags: nil, taints: nil) ⇒ NodegroupOptions
Returns a new instance of NodegroupOptions.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'eks/nodegroup_options.rb', line 28 def initialize(ami_type: nil, capacity_type: nil, desired_size: nil, disk_size: nil, enable_node_auto_repair: nil, force_update: nil, instance_types: nil, labels: nil, launch_template_spec: nil, max_size: nil, max_unavailable: nil, max_unavailable_percentage: nil, min_size: nil, nodegroup_name: nil, node_role: nil, release_version: nil, remote_access: nil, removal_policy: nil, subnets: nil, tags: nil, taints: nil) @ami_type = ami_type Jsii::Type.check_type(@ami_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLk5vZGVncm91cEFtaVR5cGUifQ==")), "amiType") unless @ami_type.nil? @capacity_type = capacity_type Jsii::Type.check_type(@capacity_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkNhcGFjaXR5VHlwZSJ9")), "capacityType") unless @capacity_type.nil? @desired_size = desired_size Jsii::Type.check_type(@desired_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "desiredSize") unless @desired_size.nil? @disk_size = disk_size Jsii::Type.check_type(@disk_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "diskSize") unless @disk_size.nil? @enable_node_auto_repair = enable_node_auto_repair Jsii::Type.check_type(@enable_node_auto_repair, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enableNodeAutoRepair") unless @enable_node_auto_repair.nil? @force_update = force_update Jsii::Type.check_type(@force_update, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "forceUpdate") unless @force_update.nil? @instance_types = instance_types Jsii::Type.check_type(@instance_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSW5zdGFuY2VUeXBlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "instanceTypes") unless @instance_types.nil? @labels = labels Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "labels") unless @labels.nil? @launch_template_spec = launch_template_spec.is_a?(Hash) ? ::AWSCDK::EKS::LaunchTemplateSpec.new(**launch_template_spec.transform_keys(&:to_sym)) : launch_template_spec Jsii::Type.check_type(@launch_template_spec, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkxhdW5jaFRlbXBsYXRlU3BlYyJ9")), "launchTemplateSpec") unless @launch_template_spec.nil? @max_size = max_size Jsii::Type.check_type(@max_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxSize") unless @max_size.nil? @max_unavailable = max_unavailable Jsii::Type.check_type(@max_unavailable, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxUnavailable") unless @max_unavailable.nil? @max_unavailable_percentage = max_unavailable_percentage Jsii::Type.check_type(@max_unavailable_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxUnavailablePercentage") unless @max_unavailable_percentage.nil? @min_size = min_size Jsii::Type.check_type(@min_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minSize") unless @min_size.nil? @nodegroup_name = nodegroup_name Jsii::Type.check_type(@nodegroup_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nodegroupName") unless @nodegroup_name.nil? @node_role = node_role Jsii::Type.check_type(@node_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "nodeRole") unless @node_role.nil? @release_version = release_version Jsii::Type.check_type(@release_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "releaseVersion") unless @release_version.nil? @remote_access = remote_access.is_a?(Hash) ? ::AWSCDK::EKS::NodegroupRemoteAccess.new(**remote_access.transform_keys(&:to_sym)) : remote_access Jsii::Type.check_type(@remote_access, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLk5vZGVncm91cFJlbW90ZUFjY2VzcyJ9")), "remoteAccess") unless @remote_access.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @subnets = subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**subnets.transform_keys(&:to_sym)) : subnets Jsii::Type.check_type(@subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "subnets") unless @subnets.nil? @tags = Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil? @taints = taints.is_a?(Array) ? taints.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EKS::TaintSpec.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : taints Jsii::Type.check_type(@taints, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19la3MuVGFpbnRTcGVjIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "taints") unless @taints.nil? end |
Instance Attribute Details
#ami_type ⇒ AWSCDK::EKS::NodegroupAmiType? (readonly)
Default: - auto-determined from the instanceTypes property when launchTemplateSpec property is not specified
The AMI type for your node group.
If you explicitly specify the launchTemplate with custom AMI, do not specify this property, or the node group deployment will fail. In other cases, you will need to specify correct amiType for the nodegroup.
80 81 82 |
# File 'eks/nodegroup_options.rb', line 80 def ami_type @ami_type end |
#capacity_type ⇒ AWSCDK::EKS::CapacityType? (readonly)
Default: - ON_DEMAND
The capacity type of the nodegroup.
85 86 87 |
# File 'eks/nodegroup_options.rb', line 85 def capacity_type @capacity_type end |
#desired_size ⇒ Numeric? (readonly)
Default: 2
The current number of worker nodes that the managed node group should maintain.
If not specified,
the nodewgroup will initially create min_size instances.
93 94 95 |
# File 'eks/nodegroup_options.rb', line 93 def desired_size @desired_size end |
#disk_size ⇒ Numeric? (readonly)
Default: 20
The root device disk size (in GiB) for your node group instances.
98 99 100 |
# File 'eks/nodegroup_options.rb', line 98 def disk_size @disk_size end |
#enable_node_auto_repair ⇒ Boolean? (readonly)
Default: - disabled
Specifies whether to enable node auto repair for the node group.
Node auto repair is disabled by default.
106 107 108 |
# File 'eks/nodegroup_options.rb', line 106 def enable_node_auto_repair @enable_node_auto_repair end |
#force_update ⇒ Boolean? (readonly)
Default: true
Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue.
If an update fails because pods could not be drained, you can force the update after it fails to terminate the old node whether or not any pods are running on the node.
115 116 117 |
# File 'eks/nodegroup_options.rb', line 115 def force_update @force_update end |
#instance_types ⇒ Array<AWSCDK::EC2::InstanceType>? (readonly)
Default: t3.medium will be used according to the cloudformation document.
The instance types to use for your node group.
121 122 123 |
# File 'eks/nodegroup_options.rb', line 121 def instance_types @instance_types end |
#labels ⇒ Hash{String => String}? (readonly)
Default: - None
The Kubernetes labels to be applied to the nodes in the node group when they are created.
126 127 128 |
# File 'eks/nodegroup_options.rb', line 126 def labels @labels end |
#launch_template_spec ⇒ AWSCDK::EKS::LaunchTemplateSpec? (readonly)
Default: - no launch template
Launch template specification used for the nodegroup.
132 133 134 |
# File 'eks/nodegroup_options.rb', line 132 def launch_template_spec @launch_template_spec end |
#max_size ⇒ Numeric? (readonly)
Default: - desiredSize
The maximum number of worker nodes that the managed node group can scale out to.
Managed node groups can support up to 100 nodes by default.
139 140 141 |
# File 'eks/nodegroup_options.rb', line 139 def max_size @max_size end |
#max_unavailable ⇒ Numeric? (readonly)
Default: 1
The maximum number of nodes unavailable at once during a version update.
Nodes will be updated in parallel. The maximum number is 100.
This value or max_unavailable_percentage is required to have a value for custom update configurations to be applied.
149 150 151 |
# File 'eks/nodegroup_options.rb', line 149 def max_unavailable @max_unavailable end |
#max_unavailable_percentage ⇒ Numeric? (readonly)
Default: undefined - node groups will update instances one at a time
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 max_unavailable is required to have a value for custom update configurations to be applied.
159 160 161 |
# File 'eks/nodegroup_options.rb', line 159 def max_unavailable_percentage @max_unavailable_percentage end |
#min_size ⇒ Numeric? (readonly)
Default: 1
The minimum number of worker nodes that the managed node group can scale in to.
This number must be greater than or equal to zero.
166 167 168 |
# File 'eks/nodegroup_options.rb', line 166 def min_size @min_size end |
#node_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - None. Auto-generated if not specified.
The IAM role to associate with your node group.
The Amazon EKS worker node kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch worker nodes and register them into a cluster, you must create an IAM role for those worker nodes to use when they are launched.
181 182 183 |
# File 'eks/nodegroup_options.rb', line 181 def node_role @node_role end |
#nodegroup_name ⇒ String? (readonly)
Default: - resource ID
Name of the Nodegroup.
171 172 173 |
# File 'eks/nodegroup_options.rb', line 171 def nodegroup_name @nodegroup_name end |
#release_version ⇒ String? (readonly)
Default: - The latest available AMI version for the node group's current Kubernetes version is used.
The AMI version of the Amazon EKS-optimized AMI to use with your node group (for example, 1.14.7-YYYYMMDD).
186 187 188 |
# File 'eks/nodegroup_options.rb', line 186 def release_version @release_version end |
#remote_access ⇒ AWSCDK::EKS::NodegroupRemoteAccess? (readonly)
Default: - disabled
The remote access (SSH) configuration to use with your node group.
Disabled by default, however, if you specify an Amazon EC2 SSH key but do not specify a source security group when you create a managed node group, then port 22 on the worker nodes is opened to the internet (0.0.0.0/0)
195 196 197 |
# File 'eks/nodegroup_options.rb', line 195 def remote_access @remote_access end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
The removal policy applied to the managed node group.
The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations:
- The resource is removed from the template, so CloudFormation stops managing it
- A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it
- The stack is deleted, so CloudFormation stops managing all resources in it
207 208 209 |
# File 'eks/nodegroup_options.rb', line 207 def removal_policy @removal_policy end |
#subnets ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
Default: - private subnets
The subnets to use for the Auto Scaling group that is created for your node group.
By specifying the
SubnetSelection, the selected subnets will automatically apply required tags i.e.
kubernetes.io/cluster/CLUSTER_NAME with a value of shared, where CLUSTER_NAME is replaced with
the name of your cluster.
217 218 219 |
# File 'eks/nodegroup_options.rb', line 217 def subnets @subnets end |
#tags ⇒ Hash{String => String}? (readonly)
Default: - None
The metadata to apply to the node group to assist with categorization and organization.
Each tag consists of a key and an optional value, both of which you define. Node group tags do not propagate to any other resources associated with the node group, such as the Amazon EC2 instances or subnets.
226 227 228 |
# File 'eks/nodegroup_options.rb', line 226 def @tags end |
#taints ⇒ Array<AWSCDK::EKS::TaintSpec>? (readonly)
Default: - None
The Kubernetes taints to be applied to the nodes in the node group when they are created.
231 232 233 |
# File 'eks/nodegroup_options.rb', line 231 def taints @taints end |
Class Method Details
.jsii_properties ⇒ Object
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'eks/nodegroup_options.rb', line 233 def self.jsii_properties { :ami_type => "amiType", :capacity_type => "capacityType", :desired_size => "desiredSize", :disk_size => "diskSize", :enable_node_auto_repair => "enableNodeAutoRepair", :force_update => "forceUpdate", :instance_types => "instanceTypes", :labels => "labels", :launch_template_spec => "launchTemplateSpec", :max_size => "maxSize", :max_unavailable => "maxUnavailable", :max_unavailable_percentage => "maxUnavailablePercentage", :min_size => "minSize", :nodegroup_name => "nodegroupName", :node_role => "nodeRole", :release_version => "releaseVersion", :remote_access => "remoteAccess", :removal_policy => "removalPolicy", :subnets => "subnets", :tags => "tags", :taints => "taints", } end |
Instance Method Details
#to_jsii ⇒ Object
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'eks/nodegroup_options.rb', line 259 def to_jsii result = {} result.merge!({ "amiType" => @ami_type, "capacityType" => @capacity_type, "desiredSize" => @desired_size, "diskSize" => @disk_size, "enableNodeAutoRepair" => @enable_node_auto_repair, "forceUpdate" => @force_update, "instanceTypes" => @instance_types, "labels" => @labels, "launchTemplateSpec" => @launch_template_spec, "maxSize" => @max_size, "maxUnavailable" => @max_unavailable, "maxUnavailablePercentage" => @max_unavailable_percentage, "minSize" => @min_size, "nodegroupName" => @nodegroup_name, "nodeRole" => @node_role, "releaseVersion" => @release_version, "remoteAccess" => @remote_access, "removalPolicy" => @removal_policy, "subnets" => @subnets, "tags" => @tags, "taints" => @taints, }) result.compact end |