network policies

This commit is contained in:
2025-01-19 19:16:06 +01:00
parent fa39cd58e0
commit 2644d2b50c
8 changed files with 47 additions and 11 deletions

View File

@@ -0,0 +1,13 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-all-ingress-nginx-external
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: nginx-external
policyTypes:
- Ingress
ingress:
- {}

View File

@@ -0,0 +1,20 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: restrict-ingress-nginx-internal
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: nginx-internal
policyTypes:
- Ingress
ingress:
- from:
- ipBlock:
cidr: 192.168.0.0/16
ports:
- protocol: TCP
port: 80
- protocol: TCP
port: 443

View File

@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- external-policy.yaml
- internal-policy.yaml