Skip to content

Commit 6c10827

Browse files
committed
Removing unused/deprecated security groups and ports. Updated AWS user doc.
Summary: - Console security group unused, replaced along the way by Router ELB - API security group unused, no longer in use after switch to NLB - Ports 80/443 not required, console using service port and Router ELB - Master port 22623 only targeted from inside the VPC - API server only on 6443 (6444 & 6445 carryover from Tectonic) - SSH port only targeted from inside the VPC with move to private - Heapster (Port 4194) no longer used - Master port 10255 (insecure) deprecated and removed in OpenShift - Renamed 10250 to secure, because it is the secure kubelet port
1 parent c09f146 commit 6c10827

File tree

5 files changed

+13
-221
lines changed

5 files changed

+13
-221
lines changed

data/data/aws/vpc/outputs.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ output "worker_sg_id" {
1818
value = "${aws_security_group.worker.id}"
1919
}
2020

21-
output "api_sg_id" {
22-
value = "${aws_security_group.api.id}"
23-
}
24-
25-
output "console_sg_id" {
26-
value = "${aws_security_group.console.id}"
27-
}
28-
2921
output "aws_lb_target_group_arns" {
3022
value = "${compact(concat(aws_lb_target_group.api_internal.*.arn, aws_lb_target_group.services.*.arn, aws_lb_target_group.api_external.*.arn))}"
3123
}

data/data/aws/vpc/sg-elb.tf

Lines changed: 0 additions & 75 deletions
This file was deleted.

data/data/aws/vpc/sg-master.tf

Lines changed: 5 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ resource "aws_security_group_rule" "master_mcs" {
1111
security_group_id = "${aws_security_group.master.id}"
1212

1313
protocol = "tcp"
14-
cidr_blocks = ["0.0.0.0/0"]
14+
cidr_blocks = ["${data.aws_vpc.cluster_vpc.cidr_block}"]
1515
from_port = 22623
1616
to_port = 22623
1717
}
@@ -41,49 +41,19 @@ resource "aws_security_group_rule" "master_ingress_ssh" {
4141
security_group_id = "${aws_security_group.master.id}"
4242

4343
protocol = "tcp"
44-
cidr_blocks = ["0.0.0.0/0"]
44+
cidr_blocks = ["${data.aws_vpc.cluster_vpc.cidr_block}"]
4545
from_port = 22
4646
to_port = 22
4747
}
4848

49-
resource "aws_security_group_rule" "master_ingress_http" {
50-
type = "ingress"
51-
security_group_id = "${aws_security_group.master.id}"
52-
53-
protocol = "tcp"
54-
cidr_blocks = ["${data.aws_vpc.cluster_vpc.cidr_block}"]
55-
from_port = 80
56-
to_port = 80
57-
}
58-
5949
resource "aws_security_group_rule" "master_ingress_https" {
6050
type = "ingress"
6151
security_group_id = "${aws_security_group.master.id}"
6252

6353
protocol = "tcp"
6454
cidr_blocks = ["${data.aws_vpc.cluster_vpc.cidr_block}"]
6555
from_port = 6443
66-
to_port = 6445
67-
}
68-
69-
resource "aws_security_group_rule" "master_ingress_heapster" {
70-
type = "ingress"
71-
security_group_id = "${aws_security_group.master.id}"
72-
73-
protocol = "tcp"
74-
from_port = 4194
75-
to_port = 4194
76-
self = true
77-
}
78-
79-
resource "aws_security_group_rule" "master_ingress_heapster_from_worker" {
80-
type = "ingress"
81-
security_group_id = "${aws_security_group.master.id}"
82-
source_security_group_id = "${aws_security_group.worker.id}"
83-
84-
protocol = "tcp"
85-
from_port = 4194
86-
to_port = 4194
56+
to_port = 6443
8757
}
8858

8959
resource "aws_security_group_rule" "master_ingress_vxlan" {
@@ -166,7 +136,7 @@ resource "aws_security_group_rule" "master_ingress_kube_controller_manager_from_
166136
to_port = 10252
167137
}
168138

169-
resource "aws_security_group_rule" "master_ingress_kubelet_insecure" {
139+
resource "aws_security_group_rule" "master_ingress_kubelet_secure" {
170140
type = "ingress"
171141
security_group_id = "${aws_security_group.master.id}"
172142

@@ -176,7 +146,7 @@ resource "aws_security_group_rule" "master_ingress_kubelet_insecure" {
176146
self = true
177147
}
178148

179-
resource "aws_security_group_rule" "master_ingress_kubelet_insecure_from_worker" {
149+
resource "aws_security_group_rule" "master_ingress_kubelet_secure_from_worker" {
180150
type = "ingress"
181151
security_group_id = "${aws_security_group.master.id}"
182152
source_security_group_id = "${aws_security_group.worker.id}"
@@ -186,26 +156,6 @@ resource "aws_security_group_rule" "master_ingress_kubelet_insecure_from_worker"
186156
to_port = 10250
187157
}
188158

189-
resource "aws_security_group_rule" "master_ingress_kubelet_secure" {
190-
type = "ingress"
191-
security_group_id = "${aws_security_group.master.id}"
192-
193-
protocol = "tcp"
194-
from_port = 10255
195-
to_port = 10255
196-
self = true
197-
}
198-
199-
resource "aws_security_group_rule" "master_ingress_kubelet_secure_from_worker" {
200-
type = "ingress"
201-
security_group_id = "${aws_security_group.master.id}"
202-
source_security_group_id = "${aws_security_group.worker.id}"
203-
204-
protocol = "tcp"
205-
from_port = 10255
206-
to_port = 10255
207-
}
208-
209159
resource "aws_security_group_rule" "master_ingress_etcd" {
210160
type = "ingress"
211161
security_group_id = "${aws_security_group.master.id}"
@@ -235,13 +185,3 @@ resource "aws_security_group_rule" "master_ingress_services" {
235185
to_port = 32767
236186
self = true
237187
}
238-
239-
resource "aws_security_group_rule" "master_ingress_services_from_console" {
240-
type = "ingress"
241-
security_group_id = "${aws_security_group.master.id}"
242-
source_security_group_id = "${aws_security_group.console.id}"
243-
244-
protocol = "tcp"
245-
from_port = 30000
246-
to_port = 32767
247-
}

data/data/aws/vpc/sg-worker.tf

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -31,51 +31,11 @@ resource "aws_security_group_rule" "worker_ingress_ssh" {
3131
security_group_id = "${aws_security_group.worker.id}"
3232

3333
protocol = "tcp"
34-
cidr_blocks = ["0.0.0.0/0"]
34+
cidr_blocks = ["${data.aws_vpc.cluster_vpc.cidr_block}"]
3535
from_port = 22
3636
to_port = 22
3737
}
3838

39-
resource "aws_security_group_rule" "worker_ingress_http" {
40-
type = "ingress"
41-
security_group_id = "${aws_security_group.worker.id}"
42-
43-
protocol = "tcp"
44-
cidr_blocks = ["0.0.0.0/0"]
45-
from_port = 80
46-
to_port = 80
47-
}
48-
49-
resource "aws_security_group_rule" "worker_ingress_https" {
50-
type = "ingress"
51-
security_group_id = "${aws_security_group.worker.id}"
52-
53-
protocol = "tcp"
54-
cidr_blocks = ["0.0.0.0/0"]
55-
from_port = 443
56-
to_port = 443
57-
}
58-
59-
resource "aws_security_group_rule" "worker_ingress_heapster" {
60-
type = "ingress"
61-
security_group_id = "${aws_security_group.worker.id}"
62-
63-
protocol = "tcp"
64-
from_port = 4194
65-
to_port = 4194
66-
self = true
67-
}
68-
69-
resource "aws_security_group_rule" "worker_ingress_heapster_from_master" {
70-
type = "ingress"
71-
security_group_id = "${aws_security_group.worker.id}"
72-
source_security_group_id = "${aws_security_group.master.id}"
73-
74-
protocol = "tcp"
75-
from_port = 4194
76-
to_port = 4194
77-
}
78-
7939
resource "aws_security_group_rule" "worker_ingress_vxlan" {
8040
type = "ingress"
8141
security_group_id = "${aws_security_group.worker.id}"
@@ -136,26 +96,6 @@ resource "aws_security_group_rule" "worker_ingress_kubelet_insecure_from_master"
13696
to_port = 10250
13797
}
13898

139-
resource "aws_security_group_rule" "worker_ingress_kubelet_secure" {
140-
type = "ingress"
141-
security_group_id = "${aws_security_group.worker.id}"
142-
143-
protocol = "tcp"
144-
from_port = 10255
145-
to_port = 10255
146-
self = true
147-
}
148-
149-
resource "aws_security_group_rule" "worker_ingress_kubelet_secure_from_master" {
150-
type = "ingress"
151-
security_group_id = "${aws_security_group.worker.id}"
152-
source_security_group_id = "${aws_security_group.master.id}"
153-
154-
protocol = "tcp"
155-
from_port = 10255
156-
to_port = 10255
157-
}
158-
15999
resource "aws_security_group_rule" "worker_ingress_services" {
160100
type = "ingress"
161101
security_group_id = "${aws_security_group.worker.id}"
@@ -165,13 +105,3 @@ resource "aws_security_group_rule" "worker_ingress_services" {
165105
to_port = 32767
166106
self = true
167107
}
168-
169-
resource "aws_security_group_rule" "worker_ingress_services_from_console" {
170-
type = "ingress"
171-
security_group_id = "${aws_security_group.worker.id}"
172-
source_security_group_id = "${aws_security_group.console.id}"
173-
174-
protocol = "tcp"
175-
from_port = 30000
176-
to_port = 32767
177-
}

docs/user/aws/limits.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ the new VPC. If you intend to create more than 20 clusters, you will need to req
5353

5454
## Security Groups
5555

56-
Each cluster creates 10 distinct security groups. The default limit of 2,500 for new accounts allows for many clusters
57-
to be created.
56+
Each cluster creates 4 distinct security groups. The default limit of 2,500 for new accounts allows for many clusters
57+
to be created. The three security groups created by the default install are:
58+
59+
1. VPC default
60+
1. Master
61+
1. Worker
62+
1. Router/Ingress
5863

5964
## Instance Limits
6065

0 commit comments

Comments
 (0)