Skip to content

Commit d0634c4

Browse files
author
Dawid Rogaczewski
committed
update
1 parent 03fc93a commit d0634c4

File tree

14 files changed

+31
-88
lines changed

14 files changed

+31
-88
lines changed

examples/bottlerocket/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module "vpc" {
5151
################################################################################
5252
# EKS Module
5353
################################################################################
54+
5455
data "aws_eks_cluster" "cluster" {
5556
name = module.eks.cluster_id
5657
}

examples/complete/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module "vpc" {
5151
################################################################################
5252
# EKS Module
5353
################################################################################
54+
5455
data "aws_eks_cluster" "cluster" {
5556
name = module.eks.cluster_id
5657
}

examples/fargate/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module "vpc" {
5151
################################################################################
5252
# EKS Module
5353
################################################################################
54+
5455
data "aws_eks_cluster" "cluster" {
5556
name = module.eks.cluster_id
5657
}

examples/instance_refresh/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Instance refresh example
22

3-
This is EKS example using instance refresh feature for worker groups.
3+
This is EKS example using [instance refresh](https://aws.amazon.com/blogs/compute/introducing-instance-refresh-for-ec2-auto-scaling/) feature for worker groups.
4+
5+
See [the official documentation](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html) for more details.
46

57
## Usage
68

examples/instance_refresh/main.tf

+5-4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module "vpc" {
5151
################################################################################
5252
# EKS Module
5353
################################################################################
54+
5455
data "aws_eks_cluster" "cluster" {
5556
name = module.eks.cluster_id
5657
}
@@ -192,7 +193,7 @@ module "aws_node_termination_handler_role" {
192193
role_name_prefix = local.name
193194
provider_url = replace(module.eks.cluster_oidc_issuer_url, "https://", "")
194195
role_policy_arns = [aws_iam_policy.aws_node_termination_handler.arn]
195-
oidc_fully_qualified_subjects = ["system:serviceaccount:${var.namespace}:${var.serviceaccount}"]
196+
oidc_fully_qualified_subjects = ["system:serviceaccount:kube-system:aws-node-termination-handler"]
196197
}
197198

198199
resource "helm_release" "aws_node_termination_handler" {
@@ -201,10 +202,10 @@ resource "helm_release" "aws_node_termination_handler" {
201202
]
202203

203204
name = "aws-node-termination-handler"
204-
namespace = var.namespace
205+
namespace = "kube-system"
205206
repository = "https://aws.github.io/eks-charts"
206207
chart = "aws-node-termination-handler"
207-
version = var.aws_node_termination_handler_chart_version
208+
version = "0.15.0"
208209
create_namespace = true
209210

210211
set {
@@ -213,7 +214,7 @@ resource "helm_release" "aws_node_termination_handler" {
213214
}
214215
set {
215216
name = "serviceAccount.name"
216-
value = var.serviceaccount
217+
value = "aws-node-termination-handler"
217218
}
218219
set {
219220
name = "serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"

examples/instance_refresh/variables.tf

-18
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,3 @@ variable "cluster_version" {
99
type = string
1010
default = "1.20"
1111
}
12-
13-
variable "aws_node_termination_handler_chart_version" {
14-
description = "Version of the aws-node-termination-handler Helm chart to install."
15-
type = string
16-
default = "0.15.0"
17-
}
18-
19-
variable "namespace" {
20-
description = "Namespace for the aws-node-termination-handler."
21-
type = string
22-
default = "kube-system"
23-
}
24-
25-
variable "serviceaccount" {
26-
description = "Serviceaccount for the aws-node-termination-handler."
27-
type = string
28-
default = "aws-node-termination-handler"
29-
}

examples/irsa/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This example shows how to create an IAM role to be used for a Kubernetes `ServiceAccount`. It will create a policy and role to be used by the [cluster-autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) using the [public Helm chart](https://github.com/kubernetes/autoscaler/tree/master/charts/cluster-autoscaler).
44

5-
The AWS documentation for IRSA is here: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
5+
See [the official documentation](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) for more details.
66

77
## Usage
88

examples/launch_templates_with_managed_node_groups/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Launch template with managed groups example
22

3-
This is EKS example using workers launch template with managed groups feature.
3+
This is EKS example using workers custom launch template with managed groups feature in two different ways:
4+
5+
- Using a defined existing launch template created outside module
6+
- Using dlaunch template which will be created by module with user customization
7+
8+
See [the official documentation](https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html) for more details.
49

510
## Usage
611

examples/launch_templates_with_managed_node_groups/main.tf

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module "vpc" {
5151
################################################################################
5252
# EKS Module
5353
################################################################################
54+
5455
data "aws_eks_cluster" "cluster" {
5556
name = module.eks.cluster_id
5657
}
@@ -78,6 +79,7 @@ module "eks" {
7879
cluster_endpoint_public_access = true
7980

8081
node_groups = {
82+
# use arleady defined launch template
8183
example1 = {
8284
name_prefix = "example1"
8385
desired_capacity = 1
@@ -87,12 +89,13 @@ module "eks" {
8789
launch_template_id = aws_launch_template.default.id
8890
launch_template_version = aws_launch_template.default.default_version
8991

90-
instance_types = var.instance_types
92+
instance_types = ["t3.small"]
9193

9294
additional_tags = {
9395
ExtraTag = "example1"
9496
}
9597
}
98+
# create launch template
9699
example2 = {
97100
create_launch_template = true
98101
desired_capacity = 1

examples/launch_templates_with_managed_node_groups/variables.tf

-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,3 @@ variable "cluster_version" {
99
type = string
1010
default = "1.20"
1111
}
12-
13-
variable "instance_types" {
14-
description = "Instance types"
15-
# Smallest recommended, where ~1.1Gb of 2Gb memory is available for the Kubernetes pods after ‘warming up’ Docker, Kubelet, and OS
16-
type = list(string)
17-
default = ["t3.small"]
18-
}

examples/managed_node_groups/README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Managed groups example
22

3-
This is EKS example managed groups feature.
3+
This is EKS example using managed groups feature in two different ways:
4+
5+
- Using SPOT instances in node group
6+
- Using ON_DEMAND instance in node group
7+
8+
See [the official documentation](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) for more details.
49

510
## Usage
611

examples/secrets_encryption/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Managed groups example
22

3-
This is EKS using secrets encryption feature.
3+
This is EKS using [secrets encryption](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/) feature.
4+
5+
See [the official blog](https://aws.amazon.com/blogs/containers/using-eks-encryption-provider-support-for-defense-in-depth/) for more details.
46

57
## Usage
68

examples/secrets_encryption/main.tf

-4
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ module "eks" {
9595
},
9696
]
9797

98-
map_roles = var.map_roles
99-
map_users = var.map_users
100-
map_accounts = var.map_accounts
101-
10298
tags = {
10399
Example = local.name
104100
GithubRepo = "terraform-aws-eks"

examples/secrets_encryption/variables.tf

-49
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,3 @@ variable "cluster_version" {
99
type = string
1010
default = "1.20"
1111
}
12-
13-
variable "map_accounts" {
14-
description = "Additional AWS account numbers to add to the aws-auth configmap."
15-
type = list(string)
16-
17-
default = [
18-
"777777777777",
19-
"888888888888",
20-
]
21-
}
22-
23-
variable "map_roles" {
24-
description = "Additional IAM roles to add to the aws-auth configmap."
25-
type = list(object({
26-
rolearn = string
27-
username = string
28-
groups = list(string)
29-
}))
30-
31-
default = [
32-
{
33-
rolearn = "arn:aws:iam::66666666666:role/role1"
34-
username = "role1"
35-
groups = ["system:masters"]
36-
},
37-
]
38-
}
39-
40-
variable "map_users" {
41-
description = "Additional IAM users to add to the aws-auth configmap."
42-
type = list(object({
43-
userarn = string
44-
username = string
45-
groups = list(string)
46-
}))
47-
48-
default = [
49-
{
50-
userarn = "arn:aws:iam::66666666666:user/user1"
51-
username = "user1"
52-
groups = ["system:masters"]
53-
},
54-
{
55-
userarn = "arn:aws:iam::66666666666:user/user2"
56-
username = "user2"
57-
groups = ["system:masters"]
58-
},
59-
]
60-
}

0 commit comments

Comments
 (0)