From 98671ea7569765bb7fd53169715476503d66e7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Fri, 10 Dec 2021 16:27:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=91=20Minor=20tweaks=20in=20netpol=20s?= =?UTF-8?q?ection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s/netpol-dockercoins.yaml | 3 +-- slides/k8s/netpol.md | 26 +++----------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/k8s/netpol-dockercoins.yaml b/k8s/netpol-dockercoins.yaml index 1238e14f..fd4c595a 100644 --- a/k8s/netpol-dockercoins.yaml +++ b/k8s/netpol-dockercoins.yaml @@ -3,8 +3,7 @@ apiVersion: networking.k8s.io/v1 metadata: name: deny-from-other-namespaces spec: - podSelector: - matchLabels: + podSelector: {} ingress: - from: - podSelector: {} diff --git a/slides/k8s/netpol.md b/slides/k8s/netpol.md index 0ee5de8c..b78dab90 100644 --- a/slides/k8s/netpol.md +++ b/slides/k8s/netpol.md @@ -176,15 +176,7 @@ The `curl` command should now time out. This is the file that we applied: ```yaml -kind: NetworkPolicy -apiVersion: networking.k8s.io/v1 -metadata: - name: deny-all-for-testweb -spec: - podSelector: - matchLabels: - app: testweb - ingress: [] +@@INCLUDE[k8s/netpol-deny-all-for-testweb.yaml] ``` --- @@ -211,19 +203,7 @@ spec: This is the second file that we applied: ```yaml -kind: NetworkPolicy -apiVersion: networking.k8s.io/v1 -metadata: - name: allow-testcurl-for-testweb -spec: - podSelector: - matchLabels: - app: testweb - ingress: - - from: - - podSelector: - matchLabels: - run: testcurl +@@INCLUDE[k8s/netpol-allow-testcurl-for-testweb.yaml] ``` --- @@ -359,7 +339,7 @@ spec: ## Applying both network policies -- Both network policies are declared in the file `k8s/netpol-dockercoins.yaml` +- Both network policies are declared in the file @@LINK[k8s/netpol-dockercoins.yaml] .exercise[