-
Notifications
You must be signed in to change notification settings - Fork 34
/
eks_node_group.tf
48 lines (40 loc) · 1.25 KB
/
eks_node_group.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
resource "aws_instance" "kubectl-server" {
ami = "ami-06ca3ca175f37dd66"
key_name = "EKSKEYPAIR"
instance_type = "t2.micro"
associate_public_ip_address = true
subnet_id = aws_subnet.public-1.id
vpc_security_group_ids = [aws_security_group.allow_tls.id]
tags = {
Name = "kubectl"
}
}
resource "aws_eks_node_group" "node-grp" {
cluster_name = aws_eks_cluster.eks.name
node_group_name = "pc-node-group"
node_role_arn = aws_iam_role.worker.arn
subnet_ids = [aws_subnet.public-1.id, aws_subnet.public-2.id]
capacity_type = "ON_DEMAND"
disk_size = "20"
instance_types = ["t2.small"]
remote_access {
ec2_ssh_key = "EKSKEYPAIR"
source_security_group_ids = [aws_security_group.allow_tls.id]
}
labels = tomap({ env = "dev" })
scaling_config {
desired_size = 2
max_size = 3
min_size = 1
}
update_config {
max_unavailable = 1
}
depends_on = [
aws_iam_role_policy_attachment.AmazonEKSWorkerNodePolicy,
aws_iam_role_policy_attachment.AmazonEKS_CNI_Policy,
aws_iam_role_policy_attachment.AmazonEC2ContainerRegistryReadOnly,
#aws_subnet.pub_sub1,
#aws_subnet.pub_sub2,
]
}