Skip to content

Commit

Permalink
Merge pull request #31 from goci-io/psp
Browse files Browse the repository at this point in the history
allow all pods within namespace to talk to each other
  • Loading branch information
etwillbefine authored Sep 16, 2020
2 parents a1e7303 + 046029b commit 6f403d4
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 6f403d4

Please sign in to comment.