From 18b888009eeabae48f9e0cbd71acca284f615295 Mon Sep 17 00:00:00 2001 From: Ludovic Piot Date: Wed, 11 Jun 2025 19:44:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20an=20MVP=20Network=20polic?= =?UTF-8?q?ies=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- k8s/M6-network-policies.yaml | 35 +++++++++++++++++++++++++ slides/k8s/M6-M01-adding-MOVY-tenant.md | 9 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 k8s/M6-network-policies.yaml diff --git a/k8s/M6-network-policies.yaml b/k8s/M6-network-policies.yaml new file mode 100644 index 00000000..4d87a658 --- /dev/null +++ b/k8s/M6-network-policies.yaml @@ -0,0 +1,35 @@ +--- +kind: NetworkPolicy +apiVersion: networking.k8s.io/v1 +metadata: + name: deny-from-other-namespaces +spec: + podSelector: {} + ingress: + - from: + - podSelector: {} +--- +kind: NetworkPolicy +apiVersion: networking.k8s.io/v1 +metadata: + name: allow-webui +spec: + podSelector: + matchLabels: + app: web + ingress: + - from: [] +--- +kind: NetworkPolicy +apiVersion: networking.k8s.io/v1 +metadata: + name: allow-db +spec: + podSelector: + matchLabels: + app: db + ingress: + - from: + - podSelector: + matchLabels: + app: web diff --git a/slides/k8s/M6-M01-adding-MOVY-tenant.md b/slides/k8s/M6-M01-adding-MOVY-tenant.md index 62ffb803..4df0ad08 100644 --- a/slides/k8s/M6-M01-adding-MOVY-tenant.md +++ b/slides/k8s/M6-M01-adding-MOVY-tenant.md @@ -197,7 +197,14 @@ pod network is still full mesh and any connection is authorized. `Network policies` may be seen as the firewall feature in the pod network. They rules ingress and egress network connections considering a described subset of pods. -They are not +Please, refer to the [`Network policies` chapter in the High Five M4 module](./4.yml.html#toc-network-policies) + +- In our case, we just add the file `~/container.training/k8s/M6-network-policies.yaml` +
in our `./tenants/base/movy` folder + +- without forgetting to update our `kustomization.yaml` file + +- and without forgetting to commit 😁 ---