47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# services/ai-llm/batch-networkpolicy.yaml
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: ollama-batch-offline
|
|
namespace: ai
|
|
spec:
|
|
podSelector:
|
|
matchLabels: {app: ollama-batch}
|
|
policyTypes: [Ingress, Egress]
|
|
egress: []
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels: {kubernetes.io/metadata.name: hermes}
|
|
podSelector:
|
|
matchLabels: {app: hermes-model-gate}
|
|
ports:
|
|
- {protocol: TCP, port: 11434}
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: ollama-batch-seed
|
|
namespace: ai
|
|
spec:
|
|
podSelector:
|
|
matchLabels: {app: ollama-batch-seed}
|
|
policyTypes: [Ingress, Egress]
|
|
ingress: []
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels: {kubernetes.io/metadata.name: kube-system}
|
|
podSelector:
|
|
matchLabels: {k8s-app: kube-dns}
|
|
ports:
|
|
- {protocol: UDP, port: 53}
|
|
- {protocol: TCP, port: 53}
|
|
# This finite download job never receives inference traffic or source data.
|
|
- to:
|
|
- ipBlock:
|
|
cidr: 0.0.0.0/0
|
|
except: [10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16]
|
|
ports:
|
|
- {protocol: TCP, port: 443}
|