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[