-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheks.tf
134 lines (109 loc) · 3.52 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "19.16.0"
cluster_name = local.cluster_name
cluster_version = local.cluster_version
cluster_endpoint_private_access = true
cluster_endpoint_public_access = true
cluster_addons = {
aws-ebs-csi-driver = {
resolve_conflicts = "OVERWRITE"
}
coredns = {
preserve = true
most_recent = true
}
# timeouts = {
# create = "25m"
# delete = "10m"
# }
kube-proxy = {
most_recent = true
}
vpc-cni = {
most_recent = true
}
}
cluster_tags = {
Name = local.cluster_name
}
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
control_plane_subnet_ids = module.vpc.private_subnets
manage_aws_auth_configmap = true
create_aws_auth_configmap = false #Set to 'true' when creating the cluster for a first time.
# Extend cluster security group rules
cluster_security_group_additional_rules = {
egress_nodes_ephemeral_ports_tcp = {
description = "To node 1025-65535"
protocol = "tcp"
from_port = 1025
to_port = 65535
type = "egress"
source_node_security_group = true
}
}
# Extend node-to-node security group rules
node_security_group_additional_rules = {
ingress_self_all = {
description = "Node to node all ports/protocols"
protocol = "-1"
from_port = 0
to_port = 0
type = "ingress"
self = true
}
egress_all = {
description = "Node all egress"
protocol = "-1"
from_port = 0
to_port = 0
type = "egress"
cidr_blocks = ["0.0.0.0/0"]
}
}
eks_managed_node_groups = {
managed = {
name = "${local.cluster_name}-managed-node"
use_name_prefix = true
subnet_ids = module.vpc.private_subnets
min_size = 1
max_size = 3
desired_size = 1
force_update_version = true
instance_types = ["t3.medium"]
ami_type = "BOTTLEROCKET_x86_64"
description = "EKS managed node group launch template"
ebs_optimized = true
disable_api_termination = false
enable_monitoring = false
create_iam_role = true
iam_role_name = "${local.cluster_name}-node-group-role"
iam_role_use_name_prefix = false
iam_role_description = "EKS managed node group role"
iam_role_tags = {
Purpose = "Protector of the kubelet"
}
iam_role_attach_cni_policy = true
iam_role_additional_policies = {
EBS_CSI = "arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy"
}
create_security_group = true
security_group_name = "${local.cluster_name}-node-group-sg"
security_group_use_name_prefix = false
tags = {
ExtraTag = "EKS managed node group"
"k8s.io/cluster-autoscaler/enabled" = 1
"k8s.io/cluster-autoscaler/APP-DEV-EKS-RCON" = 1
}
}
}
aws_auth_roles = [
{
rolearn = "arn:aws:iam::${local.account_id}:role/SandboxAdmin"
username = "momchi"
groups = ["system:masters"]
}
]
tags = local.tags
}