Skip to content

Commit 5a36a04

Browse files
committed
Allow operator ingress to environmentd on 6876 so generation rollout can complete
1 parent 4ff886d commit 5a36a04

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

kubernetes/modules/materialize-instance/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ No modules.
2727
| [kubernetes_network_policy_v1.allow_api_server_egress](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/network_policy_v1) | resource |
2828
| [kubernetes_network_policy_v1.allow_kube_system_egress](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/network_policy_v1) | resource |
2929
| [kubernetes_network_policy_v1.allow_monitoring_ingress](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/network_policy_v1) | resource |
30+
| [kubernetes_network_policy_v1.allow_operator_ingress](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/network_policy_v1) | resource |
3031
| [kubernetes_secret.materialize_backend](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret) | resource |
3132
| [kubernetes_resource.materialize_instance](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/resource) | data source |
3233

kubernetes/modules/materialize-instance/main.tf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,47 @@ resource "kubernetes_network_policy_v1" "allow_monitoring_ingress" {
212212
depends_on = [kubernetes_namespace.instance]
213213
}
214214

215+
# Allow ingress from the Materialize operator to environmentd on the HTTPS port
216+
# (6876). Recent operator versions call https://<svc>:6876/api/login during
217+
# generation rollout to finalize the Materialize CR. The monitoring ingress
218+
# policy above (pod_selector {}) implicitly denies all other ingress, so
219+
# without this rule the operator's HTTPS call is dropped at environmentd's
220+
# ingress and the Materialize CR never advances past status=Applying.
221+
resource "kubernetes_network_policy_v1" "allow_operator_ingress" {
222+
count = var.enable_network_policies ? 1 : 0
223+
224+
metadata {
225+
name = "allow-operator-ingress"
226+
namespace = var.instance_namespace
227+
}
228+
229+
spec {
230+
pod_selector {
231+
match_labels = {
232+
"materialize.cloud/app" = "environmentd"
233+
}
234+
}
235+
policy_types = ["Ingress"]
236+
237+
ingress {
238+
from {
239+
namespace_selector {}
240+
pod_selector {
241+
match_labels = {
242+
"app.kubernetes.io/name" = "materialize-operator"
243+
}
244+
}
245+
}
246+
ports {
247+
protocol = "TCP"
248+
port = 6876
249+
}
250+
}
251+
}
252+
253+
depends_on = [kubernetes_namespace.instance]
254+
}
255+
215256
# Allow egress to Kubernetes API server
216257
# The API server is outside the cluster, so we need
217258
# to allow HTTPS egress to the control plane IP. Using 0.0.0.0/0 on port 443

0 commit comments

Comments
 (0)