Added network policy
All checks were successful
Build and Push Docker Images / build-and-push (push) Successful in 22s
All checks were successful
Build and Push Docker Images / build-and-push (push) Successful in 22s
This commit is contained in:
parent
7215a74630
commit
0d163bef84
44
charts/tenant/templates/networkpolicy.yaml
Normal file
44
charts/tenant/templates/networkpolicy.yaml
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: NetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: jupyter-netpol
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app: jupyter
|
||||||
|
tenant: 'tenant-{{ .Values.name }}'
|
||||||
|
spec:
|
||||||
|
podSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: jupyter
|
||||||
|
tenant: 'tenant-{{ .Values.name }}'
|
||||||
|
policyTypes:
|
||||||
|
- Ingress
|
||||||
|
- Egress
|
||||||
|
|
||||||
|
# Entrée : Autorise le trafic vers le Notebook Jupyter sur le port 8888
|
||||||
|
ingress:
|
||||||
|
- ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 8888
|
||||||
|
|
||||||
|
# Sortie : Restreint les communications aux composants strictement nécessaires
|
||||||
|
egress:
|
||||||
|
# 1. Résolution DNS dans kube-system
|
||||||
|
- to:
|
||||||
|
- namespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
kubernetes.io/metadata.name: kube-system
|
||||||
|
ports:
|
||||||
|
- protocol: UDP
|
||||||
|
port: 53
|
||||||
|
- protocol: TCP
|
||||||
|
port: 53
|
||||||
|
|
||||||
|
# 2. Flux vers l'API MinIO (Stockage S3)
|
||||||
|
- to:
|
||||||
|
- namespaceSelector:
|
||||||
|
matchLabels:
|
||||||
|
kubernetes.io/metadata.name: minio
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 9000
|
||||||
Loading…
x
Reference in New Issue
Block a user