File tree 5 files changed +11
-5
lines changed
examples/managed_node_groups
5 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ module "eks" {
100
100
max_capacity = 10
101
101
min_capacity = 1
102
102
103
- instance_type = " m5.large"
103
+ instance_types = [" m5.large" ]
104
+ capacity_type = " SPOT"
104
105
k8s_labels = {
105
106
Environment = " test"
106
107
GithubRepo = " terraform-aws-eks"
Original file line number Diff line number Diff line change @@ -20,10 +20,11 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
20
20
| additional\_ tags | Additional tags to apply to node group | map(string) | Only ` var.tags ` applied |
21
21
| ami\_ release\_ version | AMI version of workers | string | Provider default behavior |
22
22
| ami\_ type | AMI Type. See Terraform or AWS docs | string | Provider default behavior |
23
+ | capacity\_ type | Type of instance capacity to provision. Options are ` ON_DEMAND ` and ` SPOT ` | string | Provider default behavior |
23
24
| desired\_ capacity | Desired number of workers | number | ` var.workers_group_defaults[asg_desired_capacity] ` |
24
25
| disk\_ size | Workers' disk size | number | Provider default behavior |
25
26
| iam\_ role\_ arn | IAM role ARN for workers | string | ` var.default_iam_role_arn ` |
26
- | instance\_ type | Workers' instance type | string | ` var.workers_group_defaults[instance_type] ` |
27
+ | instance\_ types | Node group's instance type(s). Multiple types can be specified when ` capacity_type="SPOT" ` . | list | ` [ var.workers_group_defaults[instance_type] ]` |
27
28
| k8s\_ labels | Kubernetes labels | map(string) | No labels applied |
28
29
| key\_ name | Key name for workers. Set to empty string to disable remote access | string | ` var.workers_group_defaults[key_name] ` |
29
30
| launch_template_id | The id of a aws_launch_template to use | string | No LT used |
Original file line number Diff line number Diff line change 4
4
{
5
5
desired_capacity = var.workers_group_defaults[" asg_desired_capacity" ]
6
6
iam_role_arn = var.default_iam_role_arn
7
- instance_type = var.workers_group_defaults[" instance_type" ]
7
+ instance_types = [ var.workers_group_defaults[" instance_type" ] ]
8
8
key_name = var.workers_group_defaults[" key_name" ]
9
9
launch_template_id = var.workers_group_defaults[" launch_template_id" ]
10
10
launch_template_version = var.workers_group_defaults[" launch_template_version" ]
Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ resource "aws_eks_node_group" "workers" {
15
15
16
16
ami_type = lookup (each. value , " ami_type" , null )
17
17
disk_size = lookup (each. value , " disk_size" , null )
18
- instance_types = each. value [ " launch_template_id " ] != null ? [] : [ each . value [ " instance_type " ]]
18
+ instance_types = lookup ( each. value , " instance_types " , null )
19
19
release_version = lookup (each. value , " ami_release_version" , null )
20
+ capacity_type = lookup (each. value , " capacity_type" , null )
20
21
21
22
dynamic "remote_access" {
22
23
for_each = each. value [" key_name" ] != " " ? [{
Original file line number Diff line number Diff line change @@ -7,8 +7,11 @@ resource "random_pet" "node_groups" {
7
7
keepers = {
8
8
ami_type = lookup (each. value , " ami_type" , null )
9
9
disk_size = lookup (each. value , " disk_size" , null )
10
- instance_type = each.value[ " instance_type " ]
10
+ capacity_type = lookup ( each. value , " capacity_type " , null )
11
11
iam_role_arn = each.value[" iam_role_arn" ]
12
+ instance_types = join (" |" , compact (
13
+ lookup (each. value , " instance_types" , [])
14
+ ))
12
15
13
16
key_name = each.value[" key_name" ]
14
17
You can’t perform that action at this time.
0 commit comments