Skip to content

Instantly share code, notes, and snippets.

@rafagsiqueira
Created June 19, 2020 20:39
Show Gist options
  • Save rafagsiqueira/bb7c922fb93b4c16d56267c1ec09acb5 to your computer and use it in GitHub Desktop.
Save rafagsiqueira/bb7c922fb93b4c16d56267c1ec09acb5 to your computer and use it in GitHub Desktop.
# Access to xplore
resource "kubernetes_network_policy" "allow_ingress_xplore_backend" {
metadata {
name = "allow-ingress-xplore"
namespace = "backend"
}
spec {
pod_selector {
match_labels = {
app = "xplore"
}
}
ingress {
dynamic "ports" {
for_each = [for i in range(9300, 9400): {
port = i
}]
content {
port = ports.value.port
protocol = "TCP"
}
}
}
policy_types = ["Ingress"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment