Class: AWSCDK::EKSv2::NodegroupProps
- Inherits:
-
NodegroupOptions
- Object
- NodegroupOptions
- AWSCDK::EKSv2::NodegroupProps
- Defined in:
- ek_sv2/nodegroup_props.rb
Overview
NodeGroup properties interface.
Instance Attribute Summary collapse
-
#ami_type ⇒ AWSCDK::EKSv2::NodegroupAmiType?
readonly
The AMI type for your node group.
-
#capacity_type ⇒ AWSCDK::EKSv2::CapacityType?
readonly
The capacity type of the nodegroup.
-
#cluster ⇒ AWSCDK::EKSv2::ICluster
readonly
Cluster resource.
-
#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::EKSv2::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::EKSv2::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 resources.
-
#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::EKSv2::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, cluster:) ⇒ NodegroupProps
constructor
A new instance of NodegroupProps.
- #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, cluster:) ⇒ NodegroupProps
Returns a new instance of NodegroupProps.
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 72 73 74 |
# File 'ek_sv2/nodegroup_props.rb', line 29 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, cluster:) @ami_type = ami_type Jsii::Type.check_type(@ami_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLk5vZGVncm91cEFtaVR5cGUifQ==")), "amiType") unless @ami_type.nil? @capacity_type = capacity_type Jsii::Type.check_type(@capacity_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLkNhcGFjaXR5VHlwZSJ9")), "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::EKSv2::LaunchTemplateSpec.new(**launch_template_spec.transform_keys(&:to_sym)) : launch_template_spec Jsii::Type.check_type(@launch_template_spec, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLkxhdW5jaFRlbXBsYXRlU3BlYyJ9")), "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::EKSv2::NodegroupRemoteAccess.new(**remote_access.transform_keys(&:to_sym)) : remote_access Jsii::Type.check_type(@remote_access, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLk5vZGVncm91cFJlbW90ZUFjY2VzcyJ9")), "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::EKSv2::TaintSpec.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : taints Jsii::Type.check_type(@taints, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19la3NfdjIuVGFpbnRTcGVjIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "taints") unless @taints.nil? @cluster = cluster Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLklDbHVzdGVyIn0=")), "cluster") end |
Instance Attribute Details
#ami_type ⇒ AWSCDK::EKSv2::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.
83 84 85 |
# File 'ek_sv2/nodegroup_props.rb', line 83 def ami_type @ami_type end |
#capacity_type ⇒ AWSCDK::EKSv2::CapacityType? (readonly)
Default: CapacityType.ON_DEMAND
The capacity type of the nodegroup.
88 89 90 |
# File 'ek_sv2/nodegroup_props.rb', line 88 def capacity_type @capacity_type end |
#cluster ⇒ AWSCDK::EKSv2::ICluster (readonly)
Cluster resource.
238 239 240 |
# File 'ek_sv2/nodegroup_props.rb', line 238 def cluster @cluster 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.
96 97 98 |
# File 'ek_sv2/nodegroup_props.rb', line 96 def desired_size @desired_size end |
#disk_size ⇒ Numeric? (readonly)
Default: 20
The root device disk size (in GiB) for your node group instances.
101 102 103 |
# File 'ek_sv2/nodegroup_props.rb', line 101 def disk_size @disk_size end |
#enable_node_auto_repair ⇒ Boolean? (readonly)
Default: false
Specifies whether to enable node auto repair for the node group.
Node auto repair is disabled by default.
109 110 111 |
# File 'ek_sv2/nodegroup_props.rb', line 109 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.
118 119 120 |
# File 'ek_sv2/nodegroup_props.rb', line 118 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.
124 125 126 |
# File 'ek_sv2/nodegroup_props.rb', line 124 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.
129 130 131 |
# File 'ek_sv2/nodegroup_props.rb', line 129 def labels @labels end |
#launch_template_spec ⇒ AWSCDK::EKSv2::LaunchTemplateSpec? (readonly)
Default: - no launch template
Launch template specification used for the nodegroup.
135 136 137 |
# File 'ek_sv2/nodegroup_props.rb', line 135 def launch_template_spec @launch_template_spec end |
#max_size ⇒ Numeric? (readonly)
Default: - same as desiredSize property
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.
142 143 144 |
# File 'ek_sv2/nodegroup_props.rb', line 142 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.
152 153 154 |
# File 'ek_sv2/nodegroup_props.rb', line 152 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.
162 163 164 |
# File 'ek_sv2/nodegroup_props.rb', line 162 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.
169 170 171 |
# File 'ek_sv2/nodegroup_props.rb', line 169 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.
184 185 186 |
# File 'ek_sv2/nodegroup_props.rb', line 184 def node_role @node_role end |
#nodegroup_name ⇒ String? (readonly)
Default: - resource ID
Name of the Nodegroup.
174 175 176 |
# File 'ek_sv2/nodegroup_props.rb', line 174 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).
189 190 191 |
# File 'ek_sv2/nodegroup_props.rb', line 189 def release_version @release_version end |
#remote_access ⇒ AWSCDK::EKSv2::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)
198 199 200 |
# File 'ek_sv2/nodegroup_props.rb', line 198 def remote_access @remote_access end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
The removal policy applied to the managed node group resources.
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
210 211 212 |
# File 'ek_sv2/nodegroup_props.rb', line 210 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.
220 221 222 |
# File 'ek_sv2/nodegroup_props.rb', line 220 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.
229 230 231 |
# File 'ek_sv2/nodegroup_props.rb', line 229 def @tags end |
#taints ⇒ Array<AWSCDK::EKSv2::TaintSpec>? (readonly)
Default: - None
The Kubernetes taints to be applied to the nodes in the node group when they are created.
234 235 236 |
# File 'ek_sv2/nodegroup_props.rb', line 234 def taints @taints end |
Class Method Details
.jsii_properties ⇒ Object
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'ek_sv2/nodegroup_props.rb', line 240 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", :cluster => "cluster", } end |
Instance Method Details
#to_jsii ⇒ Object
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'ek_sv2/nodegroup_props.rb', line 267 def to_jsii result = {} result.merge!(super) 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, "cluster" => @cluster, }) result.compact end |