apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: ollama-access
  namespace: llm
  labels:
    app.kubernetes.io/name: ollama
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/name: ollama
  policyTypes:
    - Ingress
  ingress:
    - from:
        - podSelector:
            matchLabels:
              app.kubernetes.io/name: llm-worker
      ports:
        - protocol: TCP
          port: 11434
    - from:
        - podSelector:
            matchLabels:
              app.kubernetes.io/role: llm-debug
      ports:
        - protocol: TCP
          port: 11434
