Skip to content

Commit 31ebac1

Browse files
authored
Fix to allow traffic for eks fargate pods (#2)
1 parent 4c7ff7b commit 31ebac1

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.13.0
1+
0.14.0

modules/eks-cluster/security-groups.tf

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,35 @@ locals {
77
}
88

99

10+
###################################################
11+
# Cluster Security Group Rules
12+
###################################################
13+
14+
resource "aws_security_group_rule" "node" {
15+
security_group_id = aws_eks_cluster.this.vpc_config[0].cluster_security_group_id
16+
type = "ingress"
17+
description = "Allow nodes to communicate to the cluster security group(for fargate pods)."
18+
19+
protocol = "-1"
20+
from_port = 0
21+
to_port = 0
22+
23+
source_security_group_id = module.security_group__node.id
24+
}
25+
26+
resource "aws_security_group_rule" "pod" {
27+
security_group_id = aws_eks_cluster.this.vpc_config[0].cluster_security_group_id
28+
type = "ingress"
29+
description = "Allow pods to communicate to the cluster security group(for fargate pods)."
30+
31+
protocol = "-1"
32+
from_port = 0
33+
to_port = 0
34+
35+
source_security_group_id = module.security_group__pod.id
36+
}
37+
38+
1039
###################################################
1140
# Security Group for Control Plane
1241
###################################################
@@ -231,6 +260,15 @@ module "security_group__pod" {
231260

232261
source_security_group_id = module.security_group__node.id
233262
},
263+
{
264+
id = "all/cluster"
265+
description = "Allow pods to communicate from the cluster security group(for fargate pods)."
266+
protocol = "-1"
267+
from_port = 0
268+
to_port = 0
269+
270+
source_security_group_id = aws_eks_cluster.this.vpc_config[0].cluster_security_group_id
271+
},
234272
{
235273
id = "metrics-server/control-plane"
236274
description = "Allow pods to receive metrics-server communication from the cluster control plane."

0 commit comments

Comments
 (0)