Skip to content

Commit

Permalink
chore: update examples after final validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs committed Dec 8, 2021
1 parent 739cadc commit e70bbba
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 27 deletions.
32 changes: 8 additions & 24 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,15 @@ module "eks" {
}

self_managed_node_groups = {
one = {
name = "spot-1"

public_ip = true
max_size = 5
desired_size = 2

use_mixed_instances_policy = true
mixed_instances_policy = {
instances_distribution = {
on_demand_base_capacity = 0
on_demand_percentage_above_base_capacity = 10
spot_allocation_strategy = "capacity-optimized"
spot = {
create_launch_template = true
launch_template_name = "spot"

instance_market_options = {
market_type = "spot"
spot_options = {
block_duration_minutes = 60
}

override = [
{
instance_type = "m5.large"
weighted_capacity = "1"
},
{
instance_type = "m6i.large"
weighted_capacity = "2"
},
]
}

pre_bootstrap_user_data = <<-EOT
Expand Down
53 changes: 52 additions & 1 deletion examples/irsa_autoscale_refresh/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,58 @@ module "eks" {

propogate_tags = [{
key = "aws-node-termination-handler/managed"
value = ""
value = true
propagate_at_launch = true
}]
}

mixed_instance = {
create_launch_template = true
launch_template_name = "mixed-instance"

use_mixed_instances_policy = true
mixed_instances_policy = {
instances_distribution = {
on_demand_base_capacity = 0
on_demand_percentage_above_base_capacity = 10
spot_allocation_strategy = "capacity-optimized"
}

override = [
{
instance_type = "m5.large"
weighted_capacity = "1"
},
{
instance_type = "m6i.large"
weighted_capacity = "2"
},
]
}

propogate_tags = [{
key = "aws-node-termination-handler/managed"
value = true
propagate_at_launch = true
}]
}

spot = {
create_launch_template = true
launch_template_name = "spot"

instance_market_options = {
market_type = "spot"
spot_options = {
block_duration_minutes = 60
}
}

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

propogate_tags = [{
key = "aws-node-termination-handler/managed"
value = true
propagate_at_launch = true
}]
}
Expand Down
1 change: 0 additions & 1 deletion examples/self_managed_node_group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ module "eks" {
launch_template_name = "self-managed-ex"
launch_template_use_name_prefix = true
description = "Self managed node group example launch template"
launch_template_default_version = true

ebs_optimized = true
vpc_security_group_ids = [aws_security_group.additional.id]
Expand Down
2 changes: 1 addition & 1 deletion node_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ module "self_managed_node_group" {

# Autoscaling Group
name = try(each.value.name, each.key)
use_name_prefix = try(each.value.use_name_prefix, var.self_managed_node_group_defaults.use_name_prefix, false)
use_name_prefix = try(each.value.use_name_prefix, var.self_managed_node_group_defaults.use_name_prefix, true)

launch_template_name = try(each.value.launch_template_name, each.key)
launch_template_version = try(each.value.launch_template_version, var.self_managed_node_group_defaults.launch_template_version, null)
Expand Down

0 comments on commit e70bbba

Please sign in to comment.