Skip to content

Commit c4893f3

Browse files
committed
fix: Add new network policy to loki namespace (#323)
to allow connections from monitoring namespace to promtail-metrics endpoint
1 parent b0c9826 commit c4893f3

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

terraform/layer2-k8s/eks-loki-stack.tf

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module "loki_namespace" {
7777
}
7878
},
7979
{
80-
name = "allow-monitoring"
80+
name = "allow-monitoring-loki"
8181
policy_types = ["Ingress"]
8282
pod_selector = {
8383
match_expressions = {
@@ -108,6 +108,34 @@ module "loki_namespace" {
108108
]
109109
}
110110
},
111+
{
112+
name = "allow-monitoring-promtail"
113+
policy_types = ["Ingress"]
114+
pod_selector = {
115+
match_expressions = {
116+
key = "app.kubernetes.io/instance"
117+
operator = "In"
118+
values = [local.loki_stack.name]
119+
}
120+
}
121+
ingress = {
122+
ports = [
123+
{
124+
port = "3101"
125+
protocol = "TCP"
126+
}
127+
]
128+
from = [
129+
{
130+
namespace_selector = {
131+
match_labels = {
132+
name = "monitoring"
133+
}
134+
}
135+
}
136+
]
137+
}
138+
},
111139
{
112140
name = "allow-egress"
113141
policy_types = ["Egress"]

0 commit comments

Comments
 (0)