2018-02-27 07:16:34 +01:00
|
|
|
# Security Groups (instance firewalls)
|
|
|
|
|
|
|
|
# Controller security group
|
|
|
|
|
|
|
|
resource "aws_security_group" "controller" {
|
|
|
|
name = "${var.cluster_name}-controller"
|
|
|
|
description = "${var.cluster_name} controller security group"
|
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
vpc_id = aws_vpc.network.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
tags = {
|
|
|
|
"Name" = "${var.cluster_name}-controller"
|
|
|
|
}
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
resource "aws_security_group_rule" "controller-icmp" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "icmp"
|
|
|
|
from_port = 8
|
|
|
|
to_port = 0
|
|
|
|
source_security_group_id = aws_security_group.worker.id
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-icmp-self" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "icmp"
|
|
|
|
from_port = 8
|
|
|
|
to_port = 0
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "controller-ssh" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 22
|
|
|
|
to_port = 22
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-etcd" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 2379
|
|
|
|
to_port = 2380
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2019-12-29 21:21:49 +01:00
|
|
|
# Allow Prometheus to scrape etcd metrics
|
|
|
|
resource "aws_security_group_rule" "controller-etcd-metrics" {
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 2381
|
|
|
|
to_port = 2381
|
|
|
|
source_security_group_id = aws_security_group.worker.id
|
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
resource "aws_security_group_rule" "controller-cilium-health" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
2019-12-29 21:21:49 +01:00
|
|
|
|
2019-09-05 07:20:36 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
2020-06-16 07:42:57 +02:00
|
|
|
from_port = 4240
|
|
|
|
to_port = 4240
|
2019-09-05 07:20:36 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
resource "aws_security_group_rule" "controller-cilium-health-self" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
2019-09-05 07:20:36 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 4240
|
|
|
|
to_port = 4240
|
|
|
|
self = true
|
2019-09-05 07:20:36 +02:00
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
# IANA VXLAN default
|
2019-05-07 06:56:38 +02:00
|
|
|
resource "aws_security_group_rule" "controller-vxlan" {
|
2019-05-28 05:42:48 +02:00
|
|
|
count = var.networking == "flannel" ? 1 : 0
|
2018-08-22 05:52:43 +02:00
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
2019-05-07 06:56:38 +02:00
|
|
|
from_port = 4789
|
|
|
|
to_port = 4789
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
2019-05-07 06:56:38 +02:00
|
|
|
resource "aws_security_group_rule" "controller-vxlan-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
count = var.networking == "flannel" ? 1 : 0
|
2019-05-07 06:56:38 +02:00
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
2019-05-07 06:56:38 +02:00
|
|
|
from_port = 4789
|
|
|
|
to_port = 4789
|
2018-02-27 07:16:34 +01:00
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2019-05-07 06:56:38 +02:00
|
|
|
resource "aws_security_group_rule" "controller-apiserver" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2019-05-07 06:56:38 +02:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 6443
|
|
|
|
to_port = 6443
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
# Linux VXLAN default
|
|
|
|
resource "aws_security_group_rule" "controller-linux-vxlan" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
|
|
|
from_port = 8472
|
|
|
|
to_port = 8472
|
|
|
|
source_security_group_id = aws_security_group.worker.id
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-linux-vxlan-self" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
|
|
|
from_port = 8472
|
|
|
|
to_port = 8472
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2018-08-22 05:52:43 +02:00
|
|
|
# Allow Prometheus to scrape node-exporter daemonset
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "controller-node-exporter" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 9100
|
|
|
|
to_port = 9100
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
# Allow Prometheus to scrape kube-proxy
|
|
|
|
resource "aws_security_group_rule" "kube-proxy-metrics" {
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 10249
|
|
|
|
to_port = 10249
|
|
|
|
source_security_group_id = aws_security_group.worker.id
|
|
|
|
}
|
|
|
|
|
2018-08-22 05:52:43 +02:00
|
|
|
# Allow apiserver to access kubelets for exec, log, port-forward
|
2018-05-14 08:49:45 +02:00
|
|
|
resource "aws_security_group_rule" "controller-kubelet" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-05-14 08:49:45 +02:00
|
|
|
|
2018-05-15 08:38:16 +02:00
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 10250
|
|
|
|
to_port = 10250
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
2018-05-14 08:49:45 +02:00
|
|
|
}
|
|
|
|
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "controller-kubelet-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 10250
|
|
|
|
to_port = 10250
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
# Allow Prometheus to scrape kube-scheduler
|
|
|
|
resource "aws_security_group_rule" "controller-scheduler-metrics" {
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
2021-08-11 06:08:49 +02:00
|
|
|
from_port = 10259
|
|
|
|
to_port = 10259
|
2020-06-16 07:42:57 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
|
|
|
}
|
|
|
|
|
|
|
|
# Allow Prometheus to scrape kube-controller-manager
|
|
|
|
resource "aws_security_group_rule" "controller-manager-metrics" {
|
|
|
|
security_group_id = aws_security_group.controller.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
2021-08-11 06:08:49 +02:00
|
|
|
from_port = 10257
|
|
|
|
to_port = 10257
|
2020-06-16 07:42:57 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "controller-bgp" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 179
|
|
|
|
to_port = 179
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-bgp-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 179
|
|
|
|
to_port = 179
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-ipip" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 4
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-ipip-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 4
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-ipip-legacy" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 94
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-ipip-legacy-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 94
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "controller-egress" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "egress"
|
|
|
|
protocol = "-1"
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
ipv6_cidr_blocks = ["::/0"]
|
|
|
|
}
|
|
|
|
|
|
|
|
# Worker security group
|
|
|
|
|
|
|
|
resource "aws_security_group" "worker" {
|
|
|
|
name = "${var.cluster_name}-worker"
|
|
|
|
description = "${var.cluster_name} worker security group"
|
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
vpc_id = aws_vpc.network.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
tags = {
|
|
|
|
"Name" = "${var.cluster_name}-worker"
|
|
|
|
}
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
resource "aws_security_group_rule" "worker-icmp" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.worker.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "icmp"
|
|
|
|
from_port = 8
|
|
|
|
to_port = 0
|
|
|
|
source_security_group_id = aws_security_group.controller.id
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-icmp-self" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.worker.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "icmp"
|
|
|
|
from_port = 8
|
|
|
|
to_port = 0
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "worker-ssh" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 22
|
|
|
|
to_port = 22
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-http" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 80
|
|
|
|
to_port = 80
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-https" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 443
|
|
|
|
to_port = 443
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
resource "aws_security_group_rule" "worker-cilium-health" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.worker.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 4240
|
|
|
|
to_port = 4240
|
|
|
|
source_security_group_id = aws_security_group.controller.id
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-cilium-health-self" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.worker.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 4240
|
|
|
|
to_port = 4240
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
|
|
|
# IANA VXLAN default
|
2019-05-07 06:56:38 +02:00
|
|
|
resource "aws_security_group_rule" "worker-vxlan" {
|
2019-05-28 05:42:48 +02:00
|
|
|
count = var.networking == "flannel" ? 1 : 0
|
2019-05-07 06:56:38 +02:00
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
2019-05-07 06:56:38 +02:00
|
|
|
from_port = 4789
|
|
|
|
to_port = 4789
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
2019-05-07 06:56:38 +02:00
|
|
|
resource "aws_security_group_rule" "worker-vxlan-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
count = var.networking == "flannel" ? 1 : 0
|
2019-05-07 06:56:38 +02:00
|
|
|
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
2019-05-07 06:56:38 +02:00
|
|
|
from_port = 4789
|
|
|
|
to_port = 4789
|
2018-02-27 07:16:34 +01:00
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2020-06-16 07:42:57 +02:00
|
|
|
# Linux VXLAN default
|
|
|
|
resource "aws_security_group_rule" "worker-linux-vxlan" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.worker.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
|
|
|
from_port = 8472
|
|
|
|
to_port = 8472
|
|
|
|
source_security_group_id = aws_security_group.controller.id
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-linux-vxlan-self" {
|
|
|
|
count = var.networking == "cilium" ? 1 : 0
|
|
|
|
|
|
|
|
security_group_id = aws_security_group.worker.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "udp"
|
|
|
|
from_port = 8472
|
|
|
|
to_port = 8472
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2018-08-22 05:52:43 +02:00
|
|
|
# Allow Prometheus to scrape node-exporter daemonset
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "worker-node-exporter" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 9100
|
|
|
|
to_port = 9100
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2019-12-29 21:21:49 +01:00
|
|
|
# Allow Prometheus to scrape kube-proxy
|
|
|
|
resource "aws_security_group_rule" "worker-kube-proxy" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
2019-12-29 21:21:49 +01:00
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 10249
|
|
|
|
to_port = 10249
|
|
|
|
self = true
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
2018-08-22 05:52:43 +02:00
|
|
|
# Allow apiserver to access kubelets for exec, log, port-forward
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "worker-kubelet" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 10250
|
|
|
|
to_port = 10250
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
2018-08-22 05:52:43 +02:00
|
|
|
# Allow Prometheus to scrape kubelet metrics
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "worker-kubelet-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 10250
|
|
|
|
to_port = 10250
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
2019-12-29 21:21:49 +01:00
|
|
|
resource "aws_security_group_rule" "ingress-health" {
|
|
|
|
security_group_id = aws_security_group.worker.id
|
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 10254
|
|
|
|
to_port = 10254
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
|
2018-02-27 07:16:34 +01:00
|
|
|
resource "aws_security_group_rule" "worker-bgp" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 179
|
|
|
|
to_port = 179
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-bgp-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = "tcp"
|
|
|
|
from_port = 179
|
|
|
|
to_port = 179
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-ipip" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 4
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-ipip-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 4
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-ipip-legacy" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 94
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
2019-05-28 05:42:48 +02:00
|
|
|
source_security_group_id = aws_security_group.controller.id
|
2018-02-27 07:16:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-ipip-legacy-self" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "ingress"
|
|
|
|
protocol = 94
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
self = true
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group_rule" "worker-egress" {
|
2019-05-28 05:42:48 +02:00
|
|
|
security_group_id = aws_security_group.worker.id
|
2018-02-27 07:16:34 +01:00
|
|
|
|
|
|
|
type = "egress"
|
|
|
|
protocol = "-1"
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
ipv6_cidr_blocks = ["::/0"]
|
|
|
|
}
|
2019-05-28 05:42:48 +02:00
|
|
|
|