-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheks.tf
71 lines (51 loc) · 1.5 KB
/
eks.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
data "aws_partition" "current" {}
locals {
partition = data.aws_partition.current.partition
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "3.12.0"
name = var.cluster_name
cidr = var.cidr
azs = var.azs
private_subnets = var.private_subnets
public_subnets = var.public_subnets
enable_nat_gateway = true
single_nat_gateway = true
one_nat_gateway_per_az = false
public_subnet_tags = {
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
"kubernetes.io/role/elb" = 1
}
private_subnet_tags = {
"kubernetes.io/cluster/${var.cluster_name}" = "shared"
"kubernetes.io/role/internal-elb" = 1
}
}
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "18.17.0"
cluster_name = var.cluster_name
cluster_version = var.cluster_version
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
enable_irsa = true
create_cluster_security_group = false
create_node_security_group = false
eks_managed_node_groups = {
initial = {
instance_types = ["t3.medium"]
create_security_group = false
attach_cluster_primary_security_group = true
min_size = 1
max_size = 1
desired_size = 1
iam_role_additional_policies = [
"arn:${local.partition}:iam::aws:policy/AmazonSSMManagedInstanceCore"
]
}
}
tags = {
"karpenter.sh/discovery" = var.cluster_name
}
}