# BZZZ SLURP Namespace Configuration
apiVersion: v1
kind: Namespace
metadata:
  name: bzzz-slurp
  labels:
    name: bzzz-slurp
    app.kubernetes.io/name: bzzz-slurp
    app.kubernetes.io/component: namespace
    app.kubernetes.io/part-of: bzzz-cluster
    app.kubernetes.io/version: "1.0.0"
    environment: production
    team: devops
  annotations:
    description: "BZZZ SLURP Distributed Context Distribution System"
    contact: "devops@bzzz.local"
    documentation: "https://docs.bzzz.local/slurp"

---
# Resource Quotas
apiVersion: v1
kind: ResourceQuota
metadata:
  name: bzzz-slurp-quota
  namespace: bzzz-slurp
  labels:
    app.kubernetes.io/name: bzzz-slurp
    app.kubernetes.io/component: resource-quota
spec:
  hard:
    requests.cpu: "20"
    requests.memory: 40Gi
    limits.cpu: "40"
    limits.memory: 80Gi
    requests.storage: 500Gi
    persistentvolumeclaims: "20"
    pods: "50"
    services: "20"
    secrets: "20"
    configmaps: "20"

---
# Network Policy
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: bzzz-slurp-network-policy
  namespace: bzzz-slurp
  labels:
    app.kubernetes.io/name: bzzz-slurp
    app.kubernetes.io/component: network-policy
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          name: bzzz-slurp
    - namespaceSelector:
        matchLabels:
          name: monitoring
    - namespaceSelector:
        matchLabels:
          name: ingress-nginx
  - ports:
    - protocol: TCP
      port: 8080    # HTTP API
    - protocol: TCP
      port: 9090    # Metrics
    - protocol: TCP
      port: 11434   # DHT P2P
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          name: bzzz-slurp
  - to:
    - namespaceSelector:
        matchLabels:
          name: kube-system
  - ports:
    - protocol: TCP
      port: 53
    - protocol: UDP
      port: 53
    - protocol: TCP
      port: 443
    - protocol: TCP
      port: 80