AWS: Open up port 10249 on host and controller
This port is opened up on hosts so that Prometheus can collect metrics
from these ports.
@@ -65,6 +65,17 @@ resource "aws_security_group_rule" "controller-node-exporter" {
source_security_group_id = aws_security_group.worker.id
}
+# 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
+}
+
# Allow apiserver to access kubelets for exec, log, port-forward
resource "aws_security_group_rule" "controller-kubelet" {
security_group_id = aws_security_group.controller.id
@@ -211,6 +222,17 @@ resource "aws_security_group_rule" "worker-node-exporter" {
self = true
}
+# Allow Prometheus to scrape kube-proxy.
+resource "aws_security_group_rule" "worker-kube-proxy" {
+ security_group_id = aws_security_group.worker.id
+
+ type = "ingress"
+ protocol = "tcp"
+ from_port = 10249
+ to_port = 10249
+ self = true
+}
+
resource "aws_security_group_rule" "ingress-health" {
security_group_id = aws_security_group.worker.id
