Skip to content

Commit

Permalink
allow all pods within namespace to talk to each other
Browse files Browse the repository at this point in the history
fine crained access control must be done outside of this module for now
  • Loading branch information
etwillbefine committed Sep 16, 2020
1 parent a1e7303 commit 046029b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ Additionally it allows Namespaces with a Label of `someLabel=value` to send Traf

**Note:** Namespace Restrictions apply on **Labels**, not on Namespace Fields!

This Module can only apply Policies to all Pods within your Namespace.
To enable fine grained Control for Apps within the created Namespace, create your own Network Policies for now.

### Context

This module is used at [goci.io](https://goci.io) to provision Kubernetes Namespaces for our Customers.
9 changes: 8 additions & 1 deletion network-policies.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

resource "kubernetes_network_policy" "deny_all" {
count = var.enable_network_policies && var.network_deny_all_policy ? 1 : 0

Expand Down Expand Up @@ -36,6 +35,10 @@ resource "kubernetes_network_policy" "allow" {
}
}

from {
pod_selector {}
}

dynamic "from" {
for_each = var.network_ingress_namespaces

Expand All @@ -48,6 +51,10 @@ resource "kubernetes_network_policy" "allow" {
}

egress {
to {
pod_selector {}
}

dynamic "to" {
for_each = var.network_egress_namespaces

Expand Down

0 comments on commit 046029b

Please sign in to comment.