Skip to content

Commit 32971b9

Browse files
authored
Merge branch 'master' into add-timeout-asg
2 parents 2253ba0 + a9b8455 commit 32971b9

File tree

20 files changed

+174
-18
lines changed

20 files changed

+174
-18
lines changed

CHANGELOG.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,55 @@ project adheres to [Semantic Versioning](http://semver.org/).
1010

1111

1212

13+
<a name="v17.15.0"></a>
14+
## [v17.15.0] - 2021-09-06
15+
FEATURES:
16+
- Added ability to pass different subnets for fargate and the cluster ([#1527](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1527))
17+
18+
19+
<a name="v17.14.0"></a>
20+
## [v17.14.0] - 2021-09-06
21+
FEATURES:
22+
- Create SG rule for each new cluster_endpoint_private_access_cidr block ([#1549](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1549))
23+
24+
25+
<a name="v17.13.0"></a>
26+
## [v17.13.0] - 2021-09-06
27+
BUG FIXES:
28+
- Worker security group handling when worker_create_security_group=false ([#1461](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1461))
29+
30+
31+
<a name="v17.12.0"></a>
32+
## [v17.12.0] - 2021-09-06
33+
FEATURES:
34+
- Add ability to tag network-interface using Launch Template ([#1563](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1563))
35+
36+
37+
<a name="v17.11.0"></a>
38+
## [v17.11.0] - 2021-09-04
39+
BUG FIXES:
40+
- Updated required version of AWS provider to 3.56.0 ([#1571](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1571))
41+
42+
43+
<a name="v17.10.0"></a>
44+
## [v17.10.0] - 2021-09-03
45+
FEATURES:
46+
- Added support for update_config in EKS managed node groups ([#1560](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1560))
47+
48+
49+
<a name="v17.9.0"></a>
50+
## [v17.9.0] - 2021-09-03
51+
FEATURES:
52+
- Allow override of timeouts in node_groups ([#1552](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1552))
53+
- Ability to tag just EKS cluster ([#1569](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1569))
54+
55+
56+
<a name="v17.8.0"></a>
57+
## [v17.8.0] - 2021-09-03
58+
BUG FIXES:
59+
- Put KubeletExtraArgs in double quotes for Windows ([#1082](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1082))
60+
61+
1362
<a name="v17.7.0"></a>
1463
## [v17.7.0] - 2021-09-02
1564
FEATURES:
@@ -443,7 +492,15 @@ CI:
443492
- Restrict sementic PR to validate PR title only ([#804](https://github.com/terraform-aws-modules/terraform-aws-eks/issues/804))
444493

445494

446-
[Unreleased]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.7.0...HEAD
495+
[Unreleased]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.15.0...HEAD
496+
[v17.15.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.14.0...v17.15.0
497+
[v17.14.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.13.0...v17.14.0
498+
[v17.13.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.12.0...v17.13.0
499+
[v17.12.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.11.0...v17.12.0
500+
[v17.11.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.10.0...v17.11.0
501+
[v17.10.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.9.0...v17.10.0
502+
[v17.9.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.8.0...v17.9.0
503+
[v17.8.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.7.0...v17.8.0
447504
[v17.7.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.6.0...v17.7.0
448505
[v17.6.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.5.0...v17.6.0
449506
[v17.5.0]: https://github.com/terraform-aws-modules/terraform-aws-eks/compare/v17.4.0...v17.5.0

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
143143
| Name | Version |
144144
|------|---------|
145145
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
146-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.44.0 |
146+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.56.0 |
147147
| <a name="requirement_http"></a> [http](#requirement\_http) | >= 2.4.1 |
148148
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 1.11.1 |
149149
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 1.4 |
@@ -152,7 +152,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
152152

153153
| Name | Version |
154154
|------|---------|
155-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.44.0 |
155+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.56.0 |
156156
| <a name="provider_http"></a> [http](#provider\_http) | >= 2.4.1 |
157157
| <a name="provider_kubernetes"></a> [kubernetes](#provider\_kubernetes) | >= 1.11.1 |
158158
| <a name="provider_local"></a> [local](#provider\_local) | >= 1.4 |
@@ -239,13 +239,15 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
239239
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the EKS cluster. Also used as a prefix in names of related resources. | `string` | n/a | yes |
240240
| <a name="input_cluster_security_group_id"></a> [cluster\_security\_group\_id](#input\_cluster\_security\_group\_id) | If provided, the EKS cluster will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the workers | `string` | `""` | no |
241241
| <a name="input_cluster_service_ipv4_cidr"></a> [cluster\_service\_ipv4\_cidr](#input\_cluster\_service\_ipv4\_cidr) | service ipv4 cidr for the kubernetes cluster | `string` | `null` | no |
242+
| <a name="input_cluster_tags"></a> [cluster\_tags](#input\_cluster\_tags) | A map of tags to add to just the eks resource. | `map(string)` | `{}` | no |
242243
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | Kubernetes version to use for the EKS cluster. | `string` | n/a | yes |
243244
| <a name="input_create_eks"></a> [create\_eks](#input\_create\_eks) | Controls if EKS resources should be created (it affects almost all resources) | `bool` | `true` | no |
244245
| <a name="input_create_fargate_pod_execution_role"></a> [create\_fargate\_pod\_execution\_role](#input\_create\_fargate\_pod\_execution\_role) | Controls if the EKS Fargate pod execution IAM role should be created. | `bool` | `true` | no |
245246
| <a name="input_eks_oidc_root_ca_thumbprint"></a> [eks\_oidc\_root\_ca\_thumbprint](#input\_eks\_oidc\_root\_ca\_thumbprint) | Thumbprint of Root CA for EKS OIDC, Valid until 2037 | `string` | `"9e99a48a9960b14926bb7f3b02e22da2b0ab7280"` | no |
246247
| <a name="input_enable_irsa"></a> [enable\_irsa](#input\_enable\_irsa) | Whether to create OpenID Connect Provider for EKS to enable IRSA | `bool` | `false` | no |
247248
| <a name="input_fargate_pod_execution_role_name"></a> [fargate\_pod\_execution\_role\_name](#input\_fargate\_pod\_execution\_role\_name) | The IAM Role that provides permissions for the EKS Fargate Profile. | `string` | `null` | no |
248249
| <a name="input_fargate_profiles"></a> [fargate\_profiles](#input\_fargate\_profiles) | Fargate profiles to create. See `fargate_profile` keys section in fargate submodule's README.md for more details | `any` | `{}` | no |
250+
| <a name="input_fargate_subnets"></a> [fargate\_subnets](#input\_fargate\_subnets) | A list of subnets to place fargate workers within (if different from subnets). | `list(string)` | `[]` | no |
249251
| <a name="input_iam_path"></a> [iam\_path](#input\_iam\_path) | If provided, all IAM roles will be created on this path. | `string` | `"/"` | no |
250252
| <a name="input_kubeconfig_aws_authenticator_additional_args"></a> [kubeconfig\_aws\_authenticator\_additional\_args](#input\_kubeconfig\_aws\_authenticator\_additional\_args) | Any additional arguments to pass to the authenticator such as the role to assume. e.g. ["-r", "MyEksRole"]. | `list(string)` | `[]` | no |
251253
| <a name="input_kubeconfig_aws_authenticator_command"></a> [kubeconfig\_aws\_authenticator\_command](#input\_kubeconfig\_aws\_authenticator\_command) | Command to use to fetch AWS EKS credentials. | `string` | `"aws-iam-authenticator"` | no |
@@ -266,6 +268,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
266268
| <a name="input_permissions_boundary"></a> [permissions\_boundary](#input\_permissions\_boundary) | If provided, all IAM roles will be created with this permissions boundary attached. | `string` | `null` | no |
267269
| <a name="input_subnets"></a> [subnets](#input\_subnets) | A list of subnets to place the EKS cluster and workers within. | `list(string)` | n/a | yes |
268270
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources. Tags added to launch configuration or templates override these values for ASG Tags only. | `map(string)` | `{}` | no |
271+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | A map of timeouts for create/update/delete operations. | `map(string)` | `{}` | no |
269272
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC where the cluster and workers will be deployed. | `string` | n/a | yes |
270273
| <a name="input_wait_for_cluster_timeout"></a> [wait\_for\_cluster\_timeout](#input\_wait\_for\_cluster\_timeout) | A timeout (in seconds) to wait for cluster to be available. | `number` | `300` | no |
271274
| <a name="input_worker_additional_security_group_ids"></a> [worker\_additional\_security\_group\_ids](#input\_worker\_additional\_security\_group\_ids) | A list of additional security group ids to attach to worker instances | `list(string)` | `[]` | no |

cluster.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ resource "aws_eks_cluster" "this" {
1212
enabled_cluster_log_types = var.cluster_enabled_log_types
1313
role_arn = local.cluster_iam_role_arn
1414
version = var.cluster_version
15-
tags = var.tags
15+
tags = merge(
16+
var.tags,
17+
var.cluster_tags,
18+
)
1619

1720
vpc_config {
1821
security_group_ids = compact([local.cluster_security_group_id])
@@ -77,7 +80,7 @@ resource "aws_security_group_rule" "cluster_egress_internet" {
7780
}
7881

7982
resource "aws_security_group_rule" "cluster_https_worker_ingress" {
80-
count = var.cluster_create_security_group && var.create_eks ? 1 : 0
83+
count = var.cluster_create_security_group && var.create_eks && var.worker_create_security_group ? 1 : 0
8184
description = "Allow pods to communicate with the EKS cluster API."
8285
protocol = "tcp"
8386
security_group_id = local.cluster_security_group_id
@@ -88,13 +91,13 @@ resource "aws_security_group_rule" "cluster_https_worker_ingress" {
8891
}
8992

9093
resource "aws_security_group_rule" "cluster_private_access_cidrs_source" {
91-
count = var.create_eks && var.cluster_create_endpoint_private_access_sg_rule && var.cluster_endpoint_private_access && var.cluster_endpoint_private_access_cidrs != null ? 1 : 0
94+
for_each = var.create_eks && var.cluster_create_endpoint_private_access_sg_rule && var.cluster_endpoint_private_access && var.cluster_endpoint_private_access_cidrs != null ? toset(var.cluster_endpoint_private_access_cidrs) : []
9295
description = "Allow private K8S API ingress from custom CIDR source."
9396
type = "ingress"
9497
from_port = 443
9598
to_port = 443
9699
protocol = "tcp"
97-
cidr_blocks = var.cluster_endpoint_private_access_cidrs
100+
cidr_blocks = [each.value]
98101

99102
security_group_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
100103
}

examples/fargate/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ module "eks" {
6161
source = "../.."
6262
cluster_name = local.cluster_name
6363
cluster_version = "1.20"
64-
subnets = module.vpc.private_subnets
64+
subnets = [module.vpc.private_subnets[0], module.vpc.public_subnets[1]]
65+
fargate_subnets = [module.vpc.private_subnets[2]]
6566

6667
tags = {
6768
Environment = "test"

examples/launch_templates_with_managed_node_groups/launchtemplate.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ resource "aws_launch_template" "default" {
8080
}
8181
}
8282

83+
# Supplying custom tags to EKS instances ENI's is another use-case for LaunchTemplates
84+
tag_specifications {
85+
resource_type = "network-interface"
86+
87+
tags = {
88+
CustomTag = "EKS example"
89+
}
90+
}
91+
8392
# Tag the LT itself
8493
tags = {
8594
CustomTag = "EKS example"

examples/managed_node_groups/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ module "eks" {
9595
effect = "NO_SCHEDULE"
9696
}
9797
]
98+
update_config = {
99+
max_unavailable_percentage = 50 # or set `max_unavailable`
100+
}
98101
}
99102
}
100103

examples/managed_node_groups/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_version = ">= 0.13.1"
33

44
required_providers {
5-
aws = ">= 3.22.0"
5+
aws = ">= 3.56.0"
66
local = ">= 1.4"
77
random = ">= 2.1"
88
kubernetes = "~> 1.11"

fargate.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module "fargate" {
88
permissions_boundary = var.permissions_boundary
99
iam_path = var.iam_path
1010
iam_policy_arn_prefix = local.policy_arn_prefix
11-
subnets = var.subnets
11+
subnets = coalescelist(var.fargate_subnets, var.subnets)
1212
tags = var.tags
1313

1414
# Hack to ensure ordering of resource creation.

local.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ locals {
9696
additional_ebs_volumes = [] # A list of additional volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), volume_size, volume_type, iops, throughput, encrypted, kms_key_id (only on launch-template), delete_on_termination. Optional values are grabbed from root volume or from defaults
9797
additional_instance_store_volumes = [] # A list of additional instance store (local disk) volumes to be attached to the instances on this Auto Scaling group. Each volume should be an object with the following: block_device_name (required), virtual_name.
9898
warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group.
99+
timeouts = {} # A map of timeouts for create/update/delete operations
99100

100101
# Settings for launch templates
101102
root_block_device_name = concat(data.aws_ami.eks_worker.*.root_device_name, [""])[0] # Root device name for Linux workers. If not provided, will assume default Linux AMI was used.

modules/node_groups/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
4040
| launch\_template_version | The version of the LT to use | string | none |
4141
| max\_capacity | Max number of workers | number | `var.workers_group_defaults[asg_max_size]` |
4242
| min\_capacity | Min number of workers | number | `var.workers_group_defaults[asg_min_size]` |
43+
| update_config.max\_unavailable\_percentage | Max percentage of unavailable nodes during update. (e.g. 25, 50, etc) | number | `null` if `update_config.max_unavailable` is set |
44+
| update_config.max\_unavailable | Max number of unavailable nodes during update | number | `null` if `update_config.max_unavailable_percentage` is set |
4345
| name | Name of the node group. If you don't really need this, we recommend you to use `name_prefix` instead. | string | Will use the autogenerate name prefix |
4446
| name_prefix | Name prefix of the node group | string | Auto generated |
4547
| pre_userdata | userdata to pre-append to the default userdata. Require `create_launch_template` to be `true`| string | "" |
@@ -48,6 +50,7 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
4850
| subnets | Subnets to contain workers | list(string) | `var.workers_group_defaults[subnets]` |
4951
| version | Kubernetes version | string | Provider default behavior |
5052
| taints | Kubernetes node taints | list(map) | empty |
53+
| timeouts | A map of timeouts for create/update/delete operations. | `map(string)` | Provider default behavior |
5154
| update_default_version | Whether or not to set the new launch template version the Default | bool | `true` |
5255

5356
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
@@ -56,13 +59,13 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
5659
| Name | Version |
5760
|------|---------|
5861
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
59-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.43.0 |
62+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.56.0 |
6063

6164
## Providers
6265

6366
| Name | Version |
6467
|------|---------|
65-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.43.0 |
68+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.56.0 |
6669
| <a name="provider_cloudinit"></a> [cloudinit](#provider\_cloudinit) | n/a |
6770

6871
## Modules
@@ -89,6 +92,7 @@ No modules.
8992
| <a name="input_node_groups"></a> [node\_groups](#input\_node\_groups) | Map of maps of `eks_node_groups` to create. See "`node_groups` and `node_groups_defaults` keys" section in README.md for more details | `any` | `{}` | no |
9093
| <a name="input_node_groups_defaults"></a> [node\_groups\_defaults](#input\_node\_groups\_defaults) | map of maps of node groups to create. See "`node_groups` and `node_groups_defaults` keys" section in README.md for more details | `any` | n/a | yes |
9194
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | n/a | yes |
95+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | A map of timeouts for create/update/delete operations. | `map(string)` | n/a | yes |
9296
| <a name="input_worker_additional_security_group_ids"></a> [worker\_additional\_security\_group\_ids](#input\_worker\_additional\_security\_group\_ids) | A list of additional security group ids to attach to worker instances | `list(string)` | `[]` | no |
9397
| <a name="input_worker_security_group_id"></a> [worker\_security\_group\_id](#input\_worker\_security\_group\_id) | If provided, all workers will be attached to this security group. If not given, a security group will be created with necessary ingress/egress to work with the EKS cluster. | `string` | `""` | no |
9498
| <a name="input_workers_group_defaults"></a> [workers\_group\_defaults](#input\_workers\_group\_defaults) | Workers group defaults from parent | `any` | n/a | yes |

0 commit comments

Comments
 (0)