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