From c6aee543e6629b1509d88dca45c6fcf12bfa9304 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Tue, 4 Apr 2023 02:31:40 -0400 Subject: [PATCH] Try to get network policy working --- cluster/apps/media/namespace.yaml | 4 +++- cluster/apps/media/network_policy.yaml | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cluster/apps/media/namespace.yaml b/cluster/apps/media/namespace.yaml index 5ec5a62..1ecda42 100644 --- a/cluster/apps/media/namespace.yaml +++ b/cluster/apps/media/namespace.yaml @@ -1,4 +1,6 @@ apiVersion: v1 kind: Namespace metadata: - name: media \ No newline at end of file + name: media + labels: + name: media \ No newline at end of file diff --git a/cluster/apps/media/network_policy.yaml b/cluster/apps/media/network_policy.yaml index 526101d..32cecdf 100644 --- a/cluster/apps/media/network_policy.yaml +++ b/cluster/apps/media/network_policy.yaml @@ -9,9 +9,12 @@ spec: ingress: - from: # Allow all pods in this namespace - - podSelector: {} + - namespaceSelector: + matchLabels: + name: "media" +# - podSelector: {} # Allow all pods with this label -# - podSelector: -# matchLabels: -# needsMedia: 'yes' \ No newline at end of file + - podSelector: + matchLabels: + needsMedia: "yes" \ No newline at end of file