Skip to content

Commit 97c7964

Browse files
sc250024max-rocket-internet
authored andcommitted
Adding minimum communication security group rule for Kubelet (#318)
* Adding minimum communication The docs at https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html specify that port 10250 is needed at a minimum for communication between the control plane, and the worker nodes. If you specify a `worker_sg_ingress_from_port` as something like `30000`, then this minimum communication is never established. * Adding description to CHANGELOG.md * Adjusting the naming of the resources * Ensuring creation is conditional on the value of `worker_sg_ingress_from_port` * Mistake, should be greater than port 10250
1 parent a26a43a commit 97c7964

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1212
### Added
1313

1414
- Write your awesome addition here (by @you)
15+
- Added minimum inbound traffic rule to the cluster worker security group as per the [EKS security group requirements](https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) (by @sc250024)
1516

1617
### Changed
1718

workers.tf

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ resource "aws_security_group_rule" "workers_ingress_self" {
9393
}
9494

9595
resource "aws_security_group_rule" "workers_ingress_cluster" {
96-
description = "Allow workers Kubelets and pods to receive communication from the cluster control plane."
96+
description = "Allow workers pods to receive communication from the cluster control plane."
9797
protocol = "tcp"
9898
security_group_id = "${aws_security_group.workers.id}"
9999
source_security_group_id = "${local.cluster_security_group_id}"
@@ -103,6 +103,17 @@ resource "aws_security_group_rule" "workers_ingress_cluster" {
103103
count = "${var.worker_create_security_group ? 1 : 0}"
104104
}
105105

106+
resource "aws_security_group_rule" "workers_ingress_cluster_kubelet" {
107+
description = "Allow workers Kubelets to receive communication from the cluster control plane."
108+
protocol = "tcp"
109+
security_group_id = "${aws_security_group.workers.id}"
110+
source_security_group_id = "${local.cluster_security_group_id}"
111+
from_port = 10250
112+
to_port = 10250
113+
type = "ingress"
114+
count = "${var.worker_create_security_group ? (var.worker_sg_ingress_from_port > 10250 ? 1 : 0) : 0}"
115+
}
116+
106117
resource "aws_security_group_rule" "workers_ingress_cluster_https" {
107118
description = "Allow pods running extension API servers on port 443 to receive communication from cluster control plane."
108119
protocol = "tcp"

0 commit comments

Comments
 (0)