Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/self-managed-node-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ resource "aws_launch_template" "this" {
}
}

instance_type = var.instance_type
instance_type = var.instance_requirements != null ? null : var.instance_type
kernel_id = var.kernel_id
key_name = var.key_name

Expand Down
141 changes: 73 additions & 68 deletions tests/self-managed-node-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,79 @@ module "eks" {
}
}

# Complete
instance_attributes = {
name = "instance-attributes"

min_size = 1
max_size = 2
desired_size = 1

cloudinit_pre_nodeadm = [{
content = <<-EOT
---
apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
kubelet:
config:
shutdownGracePeriod: 30s
EOT
content_type = "application/node.eks.aws"
}]

instance_type = null

# launch template configuration
instance_requirements = {
cpu_manufacturers = ["intel"]
instance_generations = ["current", "previous"]
spot_max_price_percentage_over_lowest_price = 100

memory_mib = {
min = 8192
}

vcpu_count = {
min = 1
}

allowed_instance_types = ["t*", "m*"]
}

use_mixed_instances_policy = true
mixed_instances_policy = {
instances_distribution = {
on_demand_base_capacity = 0
on_demand_percentage_above_base_capacity = 0
on_demand_allocation_strategy = "lowest-price"
spot_allocation_strategy = "price-capacity-optimized"
}

# ASG configuration
launch_template = {
override = [
{
instance_requirements = {
cpu_manufacturers = ["intel"]
instance_generations = ["current", "previous"]
spot_max_price_percentage_over_lowest_price = 100

memory_mib = {
min = 8192
}

vcpu_count = {
min = 1
}

allowed_instance_types = ["t*", "m*"]
}
}
]
}
}
}

complete = {
name = "complete-self-mng"
use_name_prefix = false
Expand Down Expand Up @@ -212,73 +284,6 @@ module "eks" {
}
}

instance_attributes = {
name = "instance-attributes"

min_size = 1
max_size = 2
desired_size = 1

bootstrap_extra_args = "--kubelet-extra-args '--node-labels=node.kubernetes.io/lifecycle=spot'"

cloudinit_pre_nodeadm = [{
content = <<-EOT
---
apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
kubelet:
config:
shutdownGracePeriod: 30s
EOT
content_type = "application/node.eks.aws"
}]

instance_type = null

# launch template configuration
instance_requirements = {
cpu_manufacturers = ["intel"]
instance_generations = ["current", "previous"]
spot_max_price_percentage_over_lowest_price = 100

vcpu_count = {
min = 1
}

allowed_instance_types = ["t*", "m*"]
}

use_mixed_instances_policy = true
mixed_instances_policy = {
instances_distribution = {
on_demand_base_capacity = 0
on_demand_percentage_above_base_capacity = 0
on_demand_allocation_strategy = "lowest-price"
spot_allocation_strategy = "price-capacity-optimized"
}

# ASG configuration
launch_template = {
override = [
{
instance_requirements = {
cpu_manufacturers = ["intel"]
instance_generations = ["current", "previous"]
spot_max_price_percentage_over_lowest_price = 100

vcpu_count = {
min = 1
}

allowed_instance_types = ["t*", "m*"]
}
}
]
}
}
}

metadata_options = {
http_endpoint = "enabled"
http_tokens = "required"
Expand Down