30 Days of AIDay 21 of 30 · Week 3: Infrastructure & Hosting
Course outline▾

Week 4 · Enterprise Workflows

  1. Day 22Autonomous Agents — From Passive LLMs to Goal-Driven Execution
  2. Day 23Tool Use and Function Calling — Connecting LLMs to APIs, Databases and Shells
  3. Day 24Multi-Agent Orchestration — Supervisor, Worker and Evaluator Patterns
  4. Day 25Automated CI/CD: Automating the Software Lifecycle for AI ModelsComing soon · 2026-10-25 · 7 PM IST
  5. Day 26Zero-Trust Security for AI: Sandboxing Ephemeral Execution & Model EgressComing soon · 2026-10-26 · 7 PM IST
  6. Day 27Observability & Tracing for Agentic Systems (Telemetry, Logs, and Metrics)Coming soon · 2026-10-27 · 7 PM IST
  7. Day 28Human-in-the-Loop Architecture: Machine Second, Human First in PracticeComing soon · 2026-10-28 · 7 PM IST
  8. Day 29Managing Technical Debt, Drift, and Model Governance in Enterprise ITComing soon · 2026-10-29 · 7 PM IST
  9. Day 30The 10-Year Horizon: Architecting IT Strategy for the AI-Native EnterpriseComing soon · 2026-10-30 · 7 PM IST
Open the course page →

Day 21: High-Performance Networking — Ingress and Egress for AI Clusters

2026-10-21 · 9 min read

Watch the video lesson, or subscribe on YouTube for a new lesson every day.

AI traffic does not look like ordinary web traffic. Requests carry multi-megabyte documents, and replies stream token by token over long-lived connections (Server-Sent Events). Network settings built for short page loads break that pattern. This lesson covers three places to tune: traffic coming in, traffic between services, and traffic going out.

In plain terms: Think of the cluster as a building. The front door must stay open long enough for a slow conversation, the corridors between rooms must not jam, and the exits must be locked except for the few doors you approve.

1. Ingress: keep long streams alive

An ingress controller (NGINX, Traefik or Envoy, for example) sits at the front door. Its defaults are tuned for quick requests and break AI streaming in two ways.

  • Timeouts. Default proxy read and send timeouts are often around 30 seconds, which can cut a connection while a model works through a large context. Raise them to several minutes for your slowest replies.
  • Buffering. If the proxy buffers the response, it waits for the entire reply before sending anything, which ruins real-time token streaming. Turn buffering off.
Proxy buffering kills token streaming Buffering on: the user waits for the whole replyModelIngressUserBuffering off: tokens appear as they are madeModelIngressUsernginx ingress: proxy-buffering: "off"Streaming replies use Server-Sent Events (SSE).
If an ingress proxy buffers the response it waits for the whole LLM reply before sending anything to the user, which ruins real-time token streaming. Turning buffering off lets each token through as it is generated, over Server-Sent Events.
Raise the proxy timeouts A long answer over a large contextmodel is still generating30 s default: connection cutseveral minutes: survivesRaise read and send timeouts to cover your slowest reply.In nginx ingress: proxy-read-timeout and proxy-send-timeout.
Default proxy timeouts of about 30 seconds cut off long generations over big contexts. Raising the read and send timeouts to several minutes keeps the connection open until the model finishes.

2. East-west traffic: eBPF and Cilium

Standard Kubernetes networking uses kube-proxy, which builds chains of Linux iptables rules. As services multiply, evaluating those chains becomes a bottleneck for chatty traffic such as embeddings moving between gateways, vector stores and inference engines.

An eBPF-based network plugin such as Cilium makes routing decisions with small programs running inside the Linux kernel and direct lookups, and it can replace kube-proxy. In high-throughput datacenters, specialised network cards and kernel-bypass techniques can push latency lower still. How much you gain depends on your cluster, so measure before and after you switch.

East-west traffic: iptables or eBPF kube-proxy + iptablesCilium (eBPF)rule 1rule 2rule 3rule 4rule 5 … 1000sKernel programdirect lookupRules are checked in a long chainRouting runs inside the kernelHeavy embeddings traffic stays fast as the cluster grows.Gains depend on your cluster. Measure before you switch.
kube-proxy builds long chains of iptables rules that get slow to evaluate as services multiply. An eBPF-based network plugin such as Cilium makes routing decisions with kernel programs and direct lookups, which helps heavy service-to-service traffic. Gains depend on the cluster, so measure first.

3. Egress: stop data leaving

AI workloads add a new risk: an autonomous agent or a compromised model runtime may try to send internal context to an outside server. Use a NetworkPolicy with default-deny egress, so AI Pods can reach only the internal endpoints you list, and everything else, including the open internet, is blocked. Policies are only enforced if your network plugin supports them, and Cilium and Calico do.

Default-deny egress AI Podagent or modelVector DBkube-dnsInternet✗allowedOnly the listed destinations are reachable.Allow DNS too, or nothing resolves. Needs a CNI that enforces policy.
A NetworkPolicy with default-deny egress lets an AI Pod reach only approved destinations such as the vector database, plus cluster DNS, and blocks everything else, including unauthorised internet traffic. It needs a network plugin that enforces policies, such as Cilium or Calico.

Here are the two pieces of configuration. They assume the NGINX ingress controller and a namespace called ai, with a vector database Pod labelled app: qdrant.

# Ingress: long timeouts and no buffering, for streaming replies
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: model-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "300"    # seconds
    nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
    nginx.ingress.kubernetes.io/proxy-buffering: "off"
spec:
  ingressClassName: nginx
  rules:
    - host: llm.example.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service: { name: model-svc, port: { number: 80 } }
---
# Egress: AI Pods may talk only to the vector DB and cluster DNS
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: ai-default-deny-egress
  namespace: ai
spec:
  podSelector: {}                 # every Pod in the namespace
  policyTypes: [Egress]
  egress:
    - to:
        - podSelector: { matchLabels: { app: qdrant } }
    - to:                          # allow DNS, or nothing will resolve
        - namespaceSelector: {}
          podSelector: { matchLabels: { k8s-app: kube-dns } }
      ports:
        - { protocol: UDP, port: 53 }
        - { protocol: TCP, port: 53 }

Get the allow-list right and your AI infrastructure handles big payloads with low latency, while keeping strict boundaries around what can leave. That wraps up Week 3. Next week moves to enterprise workflows, starting with autonomous agents.

Coming Up Next

Day 22: Autonomous agents: from passive LLMs to goal-driven execution.

#KubernetesNetworking #eBPF #Cilium #NetworkSecurity #DevSecOps