<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tejo Chenchu on Medium]]></title>
        <description><![CDATA[Stories by Tejo Chenchu on Medium]]></description>
        <link>https://medium.com/@tejokumar?source=rss-99d62938afdd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*WoQc8TnSme0Sw0iS</url>
            <title>Stories by Tejo Chenchu on Medium</title>
            <link>https://medium.com/@tejokumar?source=rss-99d62938afdd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:12:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tejokumar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Envoy AI Gateway 1.0 Is GA — Where It Fits in a Service-Mesh Platform]]></title>
            <link>https://tejokumar.medium.com/envoy-ai-gateway-1-0-is-ga-where-it-fits-in-a-service-mesh-platform-3dc7fa1f309d?source=rss-99d62938afdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3dc7fa1f309d</guid>
            <category><![CDATA[ai-infrastructure]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[envoy-ai-gateway]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[service-mesh]]></category>
            <dc:creator><![CDATA[Tejo Chenchu]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 07:01:04 GMT</pubDate>
            <atom:updated>2026-08-11T07:01:04.117Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use the AI gateway for model-facing policy, the mesh for workload-facing policy, and inference routing for model-server selection.</h4><p>Envoy AI Gateway 1.0 became generally available on June 23, 2026. The release stabilizes its core v1beta1 APIs and brings provider translation, multi-tenant routing, token controls, MCP support, and AI-specific observability onto an Envoy Gateway foundation. <a href="https://aigateway.envoyproxy.io/release-notes/v1.0/">The project now guarantees compatibility for its core APIs across the 1.x series</a>.</p><p>That makes the product easier to adopt. It also makes an old architecture question more urgent:</p><p><strong>Should an AI gateway become part of the service mesh, sit in front of it, or replace part of it?</strong></p><p>The useful answer is not a product comparison. It is a boundary map.</p><p>An AI gateway understands model requests. A service mesh understands workload connections. An inference router understands the current state of model-server replicas. These systems may use the same proxy technology and Kubernetes APIs, but they make different decisions from different information.</p><p>Put a policy where the required information is visible. That one rule prevents most of the overlap and confusion.</p><h3>Three traffic layers, three different jobs</h3><p>Start with the request itself.</p><p>An application sends a model name, prompt, tool definition, or embedding request. The platform may need to choose a provider, translate the request, inject provider credentials, enforce a token budget, or expose only approved MCP tools. These decisions require an understanding of AI protocols and request bodies.</p><p>This is the <strong>AI gateway layer</strong>.</p><p>After the request enters the cluster, services still call token brokers, retrieval systems, policy services, MCP servers, and model endpoints. Those connections need workload identity, encryption, authorization, retries, and common network telemetry. The same controls must also cover ordinary service-to-service traffic that has nothing to do with AI.</p><p>This is the <strong>service-mesh layer</strong>.</p><p>For self-hosted models, there is another decision. Several pods may serve the same model, but they are not necessarily equally good targets. One may have a long queue. Another may already hold the prompt prefix in its key-value cache. A third may have the requested adapter loaded.</p><p>This is the <strong>inference-routing layer</strong>.</p><p>These layers can run together:</p><ol><li>The AI gateway accepts a tenant’s model request.</li><li>It authenticates the caller and applies model-facing policy.</li><li>The mesh secures calls between the gateway and internal workloads.</li><li>An inference endpoint picker selects a suitable model-server pod.</li><li>The response returns through the same controls, producing network and AI usage telemetry.</li></ol><p>The distinction is about responsibility, not necessarily the number of proxies. Envoy AI Gateway is an additive layer on Envoy Gateway, and inference extensions can add endpoint-selection logic to a compatible gateway. A deployment may combine components while keeping their policy ownership separate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzQsxeMxmN76JEEhqfhzjw.png" /><figcaption>Each layer makes decisions from different information: model context at the AI gateway, workload identity in the mesh, and replica state at the inference router</figcaption></figure><h3>What belongs at Envoy AI Gateway</h3><p>Envoy AI Gateway 1.0 exposes one OpenAI-compatible interface across supported providers and handles provider-specific translation, authentication, and routing. It also supports model virtualization, which lets applications use a stable model name while the platform changes the provider or backend behind it. <a href="https://aigateway.envoyproxy.io/release-notes/v1.0/">Version 1.0 lists 16 providers and supports chat, completions, embeddings, images, audio, and the Responses API</a>.</p><p>This is where provider normalization belongs. A mesh can route HTTP requests by host, path, or header, but it does not normally interpret an LLM model field and translate the complete request into a different provider protocol.</p><p>Token controls also belong here. Request counts are a poor measure of AI consumption. One request might use 300 tokens, while another uses 30,000. Envoy AI Gateway can extract token usage from supported responses and feed that value into usage-based rate limits. <a href="https://aigateway.envoyproxy.io/docs/next/capabilities/traffic/usage-based-ratelimiting/">Its rate-limit integration can track input, cached input, output, or total tokens and use model and tenant identifiers when selecting a limit</a>.</p><p>Quota policy handles a related but different problem. Rate limits control consumption speed. Quotas cap accumulated consumption over a window. <a href="https://aigateway.envoyproxy.io/docs/next/capabilities/traffic/quota-policy/">A </a><a href="https://aigateway.envoyproxy.io/docs/next/capabilities/traffic/quota-policy/">QuotaPolicy can define per-model token budgets and separate buckets by tenant-identifying headers</a>.</p><p>MCP policy belongs at this layer too. Model Context Protocol gives agents a standard way to discover and call tools. A gateway can combine several MCP servers behind one endpoint, filter tools, apply authorization, and record tool traffic. <a href="https://aigateway.envoyproxy.io/docs/next/capabilities/">Envoy AI Gateway’s MCP support includes server multiplexing, tool routing and filtering, OAuth authentication, and observability</a>.</p><p>The June 2026 release line made this boundary more useful for multi-tenant platforms. Hostname routing can expose different model sets through one gateway, while authorization-aware tools/list responses hide tools a caller cannot invoke. <a href="https://aigateway.envoyproxy.io/release-notes/v0.7/">Those capabilities arrived in Envoy AI Gateway 0.7 and are included in the 1.0 feature set</a>.</p><p>In simple terms, put a decision at the AI gateway when it needs to know:</p><ul><li>which tenant is consuming the model;</li><li>which logical model the application requested;</li><li>which provider API must receive the request;</li><li>how many tokens the request consumed;</li><li>which MCP tool is being discovered or called;</li><li>or which AI-specific fields may enter logs and traces.</li></ul><h3>What must remain in the service mesh</h3><p>An AI gateway protects traffic that passes through that gateway. It does not automatically protect every connection between workloads.</p><p>Suppose an agent service calls a retrieval API, which calls a document service, which reads from an internal authorization service. Those calls may bypass the AI gateway entirely. The platform still needs to identify both ends of each connection, encrypt traffic, and decide which workloads may call which services.</p><p>That is the mesh’s job.</p><p>In Istio, mutual TLS gives workloads cryptographic identities and encrypts traffic between participating proxies. Authorization policies then decide what an authenticated identity may access. Istio’s security guidance is explicit that mutual TLS provides authentication, not authorization, and recommends separate authorization policies with a default-deny approach. <a href="https://istio.io/latest/docs/ops/best-practices/security/">Istio also recommends moving from permissive to strict mutual TLS when migration needs no longer require plaintext traffic</a>.</p><p>The mesh also gives the platform a common traffic layer for AI and non-AI services. This matters because an AI application is still a distributed application. Its failure may be in DNS, connection setup, a retrieval service, an overloaded MCP server, or a policy call. Token metrics alone will not explain those paths.</p><p>Keep these controls in the mesh:</p><ul><li>workload identity and service-to-service mutual TLS;</li><li>namespace- or identity-based authorization;</li><li>east-west traffic policy;</li><li>network-level retries, timeouts, and connection controls;</li><li>dependency telemetry across all services;</li><li>and multicluster or multinetwork service communication.</li></ul><p>Do not copy all mesh policy into the AI gateway. That creates two identity systems and two incomplete maps of internal access. Instead, let the gateway establish the external tenant or user context, then let the mesh enforce workload access on internal hops.</p><p>For example, the AI gateway may allow tenant acme to use a logical model called support-large. The mesh may separately allow only the ai-gateway service account to call the provider credential broker. These policies answer different questions and should have different owners.</p><h3>Where inference-aware routing fits</h3><p>Self-hosted model serving adds a scheduling problem after the gateway has chosen a model.</p><p>Kubernetes Gateway API Inference Extension defines an InferencePool, which represents a group of model-serving backends, and an endpoint picker service, which chooses a backend for each request. <a href="https://istio.io/latest/docs/tasks/traffic-management/ingress/gateway-api-inference-extension/">Istio’s integration sends request information to the endpoint picker through Envoy’s external-processing filter before forwarding the request to the selected backend</a>.</p><p>The endpoint picker can use information that a normal round-robin load balancer does not have. The reference configuration includes queue, key-value-cache utilization, and prefix-cache scorers. <a href="https://github.com/kubernetes-sigs/gateway-api-inference-extension">The extension is designed to improve tail latency and throughput for Kubernetes-hosted model servers using cache- and request-cost-aware selection</a>.</p><p>This still does not make it a general GPU scheduler or a model runtime. It selects among model-server endpoints that already exist. Kubernetes, an accelerator scheduler, and the model-serving stack remain responsible for creating pods, assigning resources, loading models, and executing inference.</p><p>A clean request path therefore looks like this:</p><ul><li><strong>AI gateway:</strong> Choose the logical provider or self-hosted model pool.</li><li><strong>Mesh:</strong> Secure and observe the call to that internal destination.</li><li><strong>Inference router:</strong> Choose the best ready model-server endpoint.</li><li><strong>Model server:</strong> Run inference and return the result.</li></ul><p>Envoy AI Gateway can also use InferencePool backends, so provider governance and specialized endpoint selection do not have to be separate entry points. <a href="https://aigateway.envoyproxy.io/docs/capabilities/inference/">Its inference integration supports both standard </a><a href="https://aigateway.envoyproxy.io/docs/capabilities/inference/">HTTPRoute and AI-specific </a><a href="https://aigateway.envoyproxy.io/docs/capabilities/inference/">AIGatewayRoute configurations</a>.</p><h3>A practical ownership matrix</h3><p>The following split is a good starting point for platform organizations.</p><p><strong>Stable API across AI providers</strong></p><ul><li><strong>Best layer: </strong>AI gateway</li><li><strong>Typical owner: </strong>AI platform</li></ul><p><strong>Provider credential injection</strong></p><ul><li><strong>Best layer: </strong>AI gateway</li><li><strong>Typical owner: </strong>AI platform/security</li></ul><p><strong>Tenant-to-model access</strong></p><ul><li><strong>Best layer: </strong>AI gateway</li><li><strong>Typical owner: </strong>AI platform/security</li></ul><p><strong>Token rate limits and budgets</strong></p><ul><li><strong>Best layer: </strong>AI gateway</li><li><strong>Typical owner: </strong>AI platform/FinOps</li></ul><p><strong>MCP tool exposure and filtering</strong></p><ul><li><strong>Best layer: </strong>AI gateway</li><li><strong>Typical owner: </strong>AI platform/security</li></ul><p><strong>Workload identity</strong></p><ul><li><strong>Best layer: </strong>Service mesh</li><li><strong>Typical owner: </strong>Platform/security</li></ul><p><strong>East-west mutual TLS</strong></p><ul><li><strong>Best layer: </strong>Service mesh</li><li><strong>Typical owner: </strong>Platform/security</li></ul><p><strong>Service-to-service authorization</strong></p><ul><li><strong>Best layer: </strong>Service mesh</li><li><strong>Typical owner: </strong>Platform/service owners</li></ul><p><strong>Network dependency telemetry</strong></p><ul><li><strong>Best layer: </strong>Service mesh</li><li><strong>Typical owner: </strong>Platform/SRE</li></ul><p><strong>Select a model-server pod</strong></p><ul><li><strong>Best layer: </strong>Inference router</li><li><strong>Typical owner: </strong>AI platform</li></ul><p><strong>Place pods on GPUs</strong></p><ul><li><strong>Best layer: </strong>Kubernetes/scheduler</li><li><strong>Typical owner: </strong>Compute platform</li></ul><p><strong>Prompt construction and fallback meaning</strong></p><ul><li><strong>Best layer: </strong>Application</li><li><strong>Typical owner: </strong>Application team</li></ul><p><strong>Validate model output</strong></p><ul><li><strong>Best layer: </strong>Application</li><li><strong>Typical owner: </strong>Application team</li></ul><p>The last two rows are important. A gateway can perform provider fallback, but it cannot decide whether fallback preserves application meaning. Switching from one model to another may change tool-call behavior, context limits, safety properties, or output format.</p><p>The application must define what a safe fallback is. The gateway should execute that declared policy, not invent it.</p><p>The same rule applies to output validation. Network infrastructure can enforce size limits or remove sensitive fields from telemetry. It cannot determine whether a generated answer is factually correct or suitable for a business operation.</p><h3>Gateway API is the shared configuration plane, not one combined product</h3><p>Kubernetes Gateway API increasingly gives these systems a common way to describe listeners, routes, backends, and policy attachment. Version 1.5 was released on February 27, 2026 and promoted six features to its Standard channel, including ListenerSet, TLSRoute, the HTTPRoute CORS filter, client certificate validation, and ReferenceGrant. <a href="https://kubernetes.io/blog/2026/04/21/gateway-api-v1-5/">Gateway API 1.5 also introduced a regular release-train process</a>.</p><p>Envoy AI Gateway 1.0 supports Gateway API 1.5.x, and current Istio inference-extension instructions use Gateway API 1.5.1. <a href="https://aigateway.envoyproxy.io/docs/compatibility/">The supported Envoy AI Gateway 1.0 combination requires Envoy Gateway 1.8.1 or newer, Kubernetes 1.32 or newer, and Gateway API 1.5.x</a>.</p><p>This convergence is useful. Route ownership can follow Kubernetes namespaces and parentRefs instead of each product inventing a complete configuration language.</p><p>But a shared API does not erase runtime boundaries. An HTTPRoute, AIGatewayRoute, mesh policy, and InferencePool still express different intent. Treat Gateway API as shared plumbing and attachment rules, not as proof that every gateway-related component has the same job.</p><h3>Build the boundary map before installing another proxy</h3><p>Start with one real AI request and trace it from the client to the model and back.</p><p>Write down every decision along the path. Then place each decision at the first layer that has enough information to make it correctly:</p><ol><li>Put provider, model, token, tenant, and MCP decisions at the AI gateway.</li><li>Put workload identity, east-west encryption, and service authorization in the mesh.</li><li>Put model-server endpoint selection in the inference-routing layer.</li><li>Keep GPU placement in the compute platform.</li><li>Keep business meaning, prompt behavior, and output validation in the application.</li></ol><p>Next, assign one owner to each policy. Avoid configurations where the platform team believes the mesh blocks a call while the security team believes the AI gateway blocks it. Test the full path with both allowed and denied requests.</p><p>Finally, join the telemetry rather than forcing it into one layer. Carry a request identifier and tenant identifier where policy permits. Correlate gateway token and model metrics with mesh service metrics and model-server queue data. Each layer sees a different part of the failure.</p><p>Envoy AI Gateway 1.0 is not the next service-mesh feature. It is a stable AI-aware policy layer that can work with a mesh. The mesh remains responsible for trust between workloads, while inference routing handles the last model-serving hop.</p><p>That separation gives platform teams something more useful than a larger gateway: a system where every decision has a clear place and a clear owner.</p><h3>Sources</h3><ul><li><a href="https://aigateway.envoyproxy.io/release-notes/v1.0/">Envoy AI Gateway v1.0 — General Availability</a></li><li><a href="https://aigateway.envoyproxy.io/release-notes/v0.7/">Envoy AI Gateway v0.7.x Release Series</a></li><li><a href="https://aigateway.envoyproxy.io/docs/next/capabilities/traffic/usage-based-ratelimiting/">Usage-based Rate Limiting</a></li><li><a href="https://aigateway.envoyproxy.io/docs/next/capabilities/traffic/quota-policy/">Quota Policy</a></li><li><a href="https://aigateway.envoyproxy.io/docs/next/capabilities/">Envoy AI Gateway Capabilities</a></li><li><a href="https://istio.io/latest/docs/ops/best-practices/security/">Istio Security Best Practices</a></li><li><a href="https://istio.io/latest/docs/tasks/traffic-management/ingress/gateway-api-inference-extension/">Kubernetes Gateway API Inference Extension in Istio</a></li><li><a href="https://github.com/kubernetes-sigs/gateway-api-inference-extension">Gateway API Inference Extension</a></li><li><a href="https://aigateway.envoyproxy.io/docs/capabilities/inference/">Envoy AI Gateway Inference Optimization</a></li><li><a href="https://kubernetes.io/blog/2026/04/21/gateway-api-v1-5/">Gateway API v1.5: Moving Features to Stable</a></li><li><a href="https://aigateway.envoyproxy.io/docs/compatibility/">Envoy AI Gateway Compatibility Matrix</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3dc7fa1f309d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Training Pods Are Running. So Why Are the GPUs Idle?]]></title>
            <link>https://tejokumar.medium.com/your-training-pods-are-running-so-why-are-the-gpus-idle-086b6a24aac6?source=rss-99d62938afdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/086b6a24aac6</guid>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubeflow]]></category>
            <category><![CDATA[cilium]]></category>
            <dc:creator><![CDATA[Tejo Chenchu]]></dc:creator>
            <pubDate>Sun, 09 Aug 2026 17:01:01 GMT</pubDate>
            <atom:updated>2026-08-09T17:01:01.941Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical runbook for finding the scheduler–network topology gap in distributed Kubernetes training jobs</h4><p>A green Kubernetes dashboard can hide an expensive outage.</p><p>Every Pod is Running. Readiness checks pass. There are no OOMKilled containers or obvious crash loops. The cluster has allocated all requested GPUs.</p><p>But the training loop has not started, and most of those GPUs are doing no useful work.</p><p>A <a href="https://www.cncf.io/blog/2026/07/23/when-kubeflow-meets-cilium-debugging-60-idle-gpus-in-kubernetes/">CNCF failure analysis published on July 23, 2026</a> reproduced this pattern with Kubeflow and Cilium. The coordinator and workers landed in different zones. A topology-aware network policy then blocked the workers from reaching the coordinator. Kubernetes considered the Pods healthy because scheduling and container startup had succeeded.</p><p>This failure is easy to misread as a GPU, NCCL, or training-framework problem. It is usually a disagreement between three separate systems:</p><ul><li>The scheduler decides where Pods run.</li><li>The network layer decides which connections are allowed.</li><li>The training framework decides when useful GPU work can begin.</li></ul><p>Each system may be working as configured. The combined result can still be wrong.</p><p>This article gives you a diagnostic sequence for finding that gap. It also shows a safer placement pattern for tightly connected training jobs.</p><h3>Why Running does not mean training is running</h3><p>Kubernetes sets a Pod to Running after it has been assigned to a node and at least one container has started. That status does not prove that the application has reached its main work loop.</p><p>Distributed training adds another startup phase after the containers begin. The processes must discover one another, connect to the coordinator or rendezvous endpoint, form the training group, and initialize collective communication.</p><p>In simple terms, all workers wait for the rest to start.</p><p>For example, the <a href="https://www.kubeflow.org/docs/components/trainer/legacy-v1/reference/distributed-training/">Kubeflow Training Operator’s distributed PyTorch flow</a> starts worker Pods with the environment needed by torchrun. The training code still has to initialize PyTorch distributed communication before synchronized GPU work begins. Current <a href="https://www.kubeflow.org/docs/components/trainer/overview/">Kubeflow Trainer documentation</a> similarly describes multi-node training as a coordinated workload with high-throughput communication between processes.</p><p>A worker can therefore be alive but stuck before its first training step. Common waiting points include:</p><ul><li>DNS lookup for the coordinator</li><li>TCP connection to the rendezvous port</li><li>TLS or application authentication</li><li>NCCL communicator initialization</li><li>MPI startup</li><li>a framework barrier waiting for missing workers</li></ul><p>Kubernetes health checks often test only the local process. They do not test whether the complete training group can communicate.</p><p>That creates the misleading picture: healthy Pods, allocated GPUs, and no training progress.</p><h3>How the scheduler–network topology gap appears</h3><p>Assume a job has one coordinator and four GPU workers. The cluster has GPU nodes in zones A and B.</p><p>The scheduler sees resource requests, node labels, taints, affinity rules, and other scheduling constraints. Without a rule that connects the placement of all five Pods, it may put the coordinator in zone A and the workers in zone B.</p><p>The network layer evaluates the resulting traffic after placement. A Kubernetes NetworkPolicy or CiliumNetworkPolicy may allow communication only within a zone, node pool, tenant, or security boundary.</p><p>This is where the gap appears. Network policy cannot move a Pod, and the default scheduler does not inspect Cilium policy to predict whether a future connection will be allowed.</p><p>The result normally falls into one of three forms:</p><ol><li><strong>A hard block.</strong> Workers repeatedly attempt to connect to the coordinator, but policy drops the traffic. Training never starts.</li><li><strong>A slow path.</strong> The connection works, but synchronized traffic crosses zones. Training starts and performs worse than expected.</li><li><strong>An expensive path.</strong> The job runs, but repeated cross-zone transfers create avoidable data-transfer charges.</li></ol><p>The CNCF lab demonstrated the hard-block case and reported GPU utilization rising from about 40% to about 85% after co-locating the group. Treat those values as one lab result, not a general performance promise. The useful lesson is the failure mechanism: Pod placement and network reachability were correct only when examined separately.</p><h3>Debug the job in four correlated views</h3><p>Do not start by changing NCCL settings or replacing the CNI. First collect four views of the same job:</p><ol><li>application progress</li><li>GPU activity</li><li>Pod placement</li><li>network decisions</li></ol><p>The order matters. It prevents a low-utilization symptom from sending you directly into GPU tuning when the workers cannot even establish a connection.</p><h3>1. Prove that training has not started</h3><p>Check for application-level progress rather than container health alone.</p><p>Depending on the framework, useful signals include:</p><ul><li>completed training steps</li><li>samples or tokens processed</li><li>loss updates</li><li>checkpoint timestamps</li><li>successful worker registration</li><li>completion of distributed initialization</li></ul><p>Start with the controller and Pod state:</p><pre>kubectl get pods -n training -l training.example.com/job=my-job -o wide<br>kubectl describe pod -n training &lt;worker-pod&gt;<br>kubectl logs -n training &lt;worker-pod&gt; --all-containers --since=15m</pre><p>Look for repeated connection attempts, rendezvous timeouts, missing ranks, or a long pause after framework initialization.</p><p>Do not assume quiet logs mean the network is healthy. Some libraries wait or retry for a long time before printing a useful error. If the application exports a step counter, use that as the stronger signal.</p><h3>2. Check whether allocated GPUs are doing work</h3><p>Next, compare allocation with activity.</p><p>A GPU assigned to a container is not necessarily busy. Collect at least:</p><ul><li>GPU utilization</li><li>GPU memory use</li><li>power draw</li><li>active compute processes</li><li>training throughput</li></ul><p>Inside a worker, a quick check may be enough to establish the pattern:</p><pre>kubectl exec -n training &lt;worker-pod&gt; -- \<br>  nvidia-smi --query-gpu=index,utilization.gpu,memory.used,power.draw \<br>  --format=csv</pre><p>For ongoing monitoring, graph these values by job, Pod, node, and zone. A cluster-wide average hides the useful clue. You want to see whether the coordinator is active while workers remain near zero, or whether every rank is waiting.</p><p>Low GPU utilization alone does not prove a network problem. Data loading, checkpoint writes, CPU bottlenecks, compilation, and small batch sizes can produce the same headline metric. That is why the next two views matter.</p><h3>3. Put every Pod, node, and zone in one table</h3><p>List the location of each member of the training group:</p><pre>kubectl get pods -n training \<br>  -l training.example.com/job=my-job \<br>  -o custom-columns=&#39;POD:.metadata.name,ROLE:.metadata.labels.training\.example\.com/role,NODE:.spec.nodeName,IP:.status.podIP&#39;</pre><pre>kubectl get nodes \<br>  -L topology.kubernetes.io/zone \<br>  -L node.kubernetes.io/instance-type</pre><p>Then join the two outputs. The question is simple: did every process that must communicate land inside a network path that permits that communication?</p><p>Pay special attention to:</p><ul><li>coordinator zone versus worker zones</li><li>GPU and non-GPU node pools</li><li>node taints</li><li>missing or inconsistent zone labels</li><li>host-networked coordinators</li><li>Services whose selected endpoints span zones</li></ul><p>Kubernetes provides <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/">node affinity</a> to limit which nodes can accept a Pod. It also provides <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/">Pod topology spread constraints</a> to control how matching Pods are distributed across zones, nodes, or another topology key.</p><p>These tools solve different problems. Node or Pod affinity can keep communicating members in the same allowed zone. A topology spread constraint can then distribute workers across separate nodes within that zone.</p><p>A zone-level spread rule by itself does the opposite of co-location: it encourages or requires Pods to occupy multiple zones. Read the topologyKey and selector carefully.</p><h3>4. Test the exact connection and inspect the verdict</h3><p>Resolve the coordinator exactly as the worker does, then test its real port from a worker Pod.</p><pre>kubectl exec -n training &lt;worker-pod&gt; -- getent hosts &lt;coordinator-service&gt;</pre><pre>kubectl exec -n training &lt;worker-pod&gt; -- \<br>  sh -c &#39;nc -vz -w 3 &lt;coordinator-service&gt; &lt;port&gt;&#39;</pre><p>If the image does not include diagnostic tools, use an approved ephemeral debug container rather than changing the training image during the incident.</p><p>With Cilium, Hubble can show recent flows and their verdicts. Filter on the source Pod, destination Pod, namespace, or port:</p><pre>hubble observe \<br>  --namespace training \<br>  --from-pod training/&lt;worker-pod&gt; \<br>  --to-pod training/&lt;coordinator-pod&gt; \<br>  --verdict DROPPED</pre><p>Cilium’s <a href="https://docs.cilium.io/en/stable/operations/troubleshooting/">troubleshooting guide</a> recommends Hubble for inspecting recent endpoint flows. It also documents cilium-dbg monitor --type drop for finding packet drops. The <a href="https://docs.cilium.io/en/latest/cmdref/cilium-dbg_monitor/">Cilium monitor command</a> can display drop events and policy verdict notifications directly from the data path.</p><p>For example:</p><pre>kubectl -n kube-system exec &lt;cilium-pod-on-destination-node&gt; -- \<br>  cilium-dbg monitor --type drop</pre><p>A Policy denied result gives you evidence that the packet reached policy enforcement and was rejected. If there is no observed flow, move one layer down: verify DNS results, Service endpoints, routes, security groups, host firewalls, and whether Cilium manages both Pods.</p><p>If a policy applies unexpectedly, inspect the endpoint and map the realized rule back to its source. Cilium documents this process in its <a href="https://docs.cilium.io/en/stable/security/policy/troubleshooting/">policy troubleshooting guide</a>.</p><h3>The complete failure path</h3><p>At this point, you should be able to write the incident as a short sequence rather than a list of unrelated symptoms:</p><ol><li>The controller created one coordinator and several workers.</li><li>The scheduler found valid nodes with the requested resources.</li><li>The coordinator landed in zone A; workers landed in zone B.</li><li>Every container started, so the Pods became Running.</li><li>Workers resolved the coordinator and attempted to connect.</li><li>Network policy rejected the cross-zone path.</li><li>Workers waited before the first synchronized training step.</li><li>GPUs remained allocated but mostly idle.</li></ol><p>That sequence identifies the ownership boundary clearly. The scheduler did not fail to schedule. The CNI did not randomly lose packets. The framework did not receive the network path it needed.</p><p>The missing part was a placement rule that matched the communication policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*053dcopbYCxJNqAszgbVUw.png" /><figcaption>Kubernetes can start every Pod even when the training group has no usable communication path. Placement and policy must describe the same topology.</figcaption></figure><h3>Fix placement before weakening policy</h3><p>The safest general fix is to place the complete communicating group inside one allowed topology domain.</p><p>For a cluster with a known training zone, apply the same required node affinity to the coordinator and every worker:</p><pre>spec:<br>  template:<br>    spec:<br>      affinity:<br>        nodeAffinity:<br>          requiredDuringSchedulingIgnoredDuringExecution:<br>            nodeSelectorTerms:<br>              - matchExpressions:<br>                  - key: topology.kubernetes.io/zone<br>                    operator: In<br>                    values:<br>                      - us-east-1a<br>      tolerations:<br>        - key: dedicated<br>          operator: Equal<br>          value: gpu-training<br>          effect: NoSchedule</pre><p>This example is intentionally a Pod-template fragment rather than a complete Kubeflow object. Trainer APIs and runtime templates differ between Kubeflow Trainer v2 and the legacy Training Operator. Apply the placement fields through the Pod template or runtime patch supported by your installed version.</p><p>The toleration matters when GPU nodes are tainted. Without it, the workers may fit because their runtime already supplies the toleration while a CPU-only coordinator remains outside the GPU pool. That can recreate the split you were trying to remove.</p><p>Once all roles are restricted to one zone, spread workers across hosts with topology.kubernetes.io/hostname if you need separate nodes:</p><pre>topologySpreadConstraints:<br>  - maxSkew: 1<br>    topologyKey: kubernetes.io/hostname<br>    whenUnsatisfiable: DoNotSchedule<br>    labelSelector:<br>      matchLabels:<br>        training.example.com/job: my-job<br>        training.example.com/role: worker</pre><p>This constraint spreads workers across nodes, not zones. The required zone affinity defines the network boundary first.</p><p>If hard-coding a zone is unacceptable, Pod affinity can place workers in the coordinator’s zone. However, required Pod affinity introduces ordering and capacity concerns. The coordinator must exist in a schedulable location before workers can match it, and a partially created group may remain pending. Validate this pattern with the controller or gang-scheduling system that creates your workload.</p><p>Do not solve the incident by broadly allowing cross-zone traffic unless cross-zone training is an intentional, tested design. A wider rule may restore connectivity while leaving latency, cost, or isolation problems in place.</p><h3>Know what this fix does not solve</h3><p>Topology alignment is not a general cure for low GPU utilization.</p><p>It will not fix:</p><ul><li>slow object-store reads</li><li>CPU-bound preprocessing</li><li>undersized batches</li><li>GPU memory pressure</li><li>inefficient collective algorithms</li><li>bad NIC or RDMA configuration</li><li>checkpoint stalls</li><li>model compilation delays</li><li>one slow worker holding back the rest</li></ul><p>It also has a real availability tradeoff. Keeping a training group in one zone reduces the chance of cross-zone network trouble, but the job now depends on that zone. For synchronous training, this may be the correct choice because one unavailable worker can stop the whole group anyway. Make that decision explicitly rather than inheriting it from accidental placement.</p><p>Capacity is another limit. DoNotSchedule constraints can leave a job pending when the selected zone lacks enough GPU nodes. That is often better than allocating an incomplete or unreachable group, but your admission and autoscaling layers must understand the same topology requirements.</p><p>Finally, labels are part of the design. A wrong labelSelector can make a topology constraint count the wrong Pods—or fail to count the workload itself. The Kubernetes documentation calls out this failure mode in the <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#known-limitations">known limitations of topology spread constraints</a>.</p><h3>Turn this incident into a preflight check</h3><p>The best next step is not another dashboard. It is a preflight rule that blocks invalid training placement before GPUs are allocated.</p><p>Start with one production training workload and document four things:</p><ol><li>Which Pods must communicate before training can start?</li><li>Which ports and protocols do they use?</li><li>Which zones or node pools allow that traffic?</li><li>Which scheduling rules keep the complete group on an allowed path?</li></ol><p>Then add an alert that combines application and infrastructure signals. A useful condition is:</p><ul><li>the job owns allocated GPUs,</li><li>GPU utilization stays below a chosen threshold,</li><li>the training step counter does not move,</li><li>and coordinator connection failures or policy drops are present.</li></ul><p>The exact threshold depends on the workload. The correlation is more important than the number.</p><p>Also test placement as part of platform validation. Create the job repeatedly, record where each role lands, and verify worker-to-coordinator connectivity from every permitted topology. Run the same test after changes to node pools, taints, default spread rules, network policy, Trainer runtimes, or cluster autoscaling.</p><p>The core lesson is straightforward: scheduling success proves that Kubernetes found resources. It does not prove that the distributed application can use them together.</p><p>For tightly connected training jobs, treat the whole group as one placement problem. Keep its members on a known-good network path, test the exact application connection, and measure useful GPU work rather than allocated GPU count.</p><h3>Sources</h3><ul><li><a href="https://www.cncf.io/blog/2026/07/23/when-kubeflow-meets-cilium-debugging-60-idle-gpus-in-kubernetes/">When Kubeflow meets Cilium: Debugging 60% idle GPUs in Kubernetes</a></li><li><a href="https://www.kubeflow.org/docs/components/trainer/overview/">Kubeflow Trainer Overview</a></li><li><a href="https://www.kubeflow.org/docs/components/trainer/legacy-v1/reference/distributed-training/">Distributed Training with the Training Operator</a></li><li><a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/">Assigning Pods to Nodes</a></li><li><a href="https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/">Pod Topology Spread Constraints</a></li><li><a href="https://docs.cilium.io/en/stable/operations/troubleshooting/">Cilium Troubleshooting</a></li><li><a href="https://docs.cilium.io/en/latest/cmdref/cilium-dbg_monitor/">cilium-dbg monitor command reference</a></li><li><a href="https://docs.cilium.io/en/stable/security/policy/troubleshooting/">Cilium Policy Troubleshooting</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=086b6a24aac6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Multi-Tenant MCP Gateway on Kubernetes with Envoy AI Gateway and Istio]]></title>
            <link>https://tejokumar.medium.com/build-a-multi-tenant-mcp-gateway-on-kubernetes-with-envoy-ai-gateway-and-istio-9636cbc71211?source=rss-99d62938afdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9636cbc71211</guid>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ai-infrastructure]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[envoy-ai-gateway]]></category>
            <dc:creator><![CDATA[Tejo Chenchu]]></dc:creator>
            <pubDate>Sun, 09 Aug 2026 07:22:35 GMT</pubDate>
            <atom:updated>2026-08-09T07:22:35.970Z</atom:updated>
            <content:encoded><![CDATA[<h4>Expose several MCP servers through one internal endpoint without mixing up tool authorization, workload security, and tenant quotas.</h4><p>An internal MCP gateway can quickly become one of the most sensitive endpoints in a Kubernetes cluster.</p><p>It does not just return data. It may expose tools that create tickets, query customer records, change deployments, or trigger workflows. Putting several MCP servers behind one URL makes agent integration easier, but it also creates a large shared security boundary.</p><p>The finished design in this tutorial exposes one endpoint:</p><pre>https://tools.company.example/mcp</pre><p>Agent workloads send a signed JWT to that endpoint. Envoy AI Gateway validates the token, returns only the tools that caller may use, routes approved calls to the correct MCP server, and forwards selected identity claims. Istio protects traffic between the gateway and in-cluster tool servers with workload mTLS and service-level authorization.</p><p>There is one important product boundary to understand first. Envoy AI Gateway 1.0 can multiplex MCP servers, authorize individual tools, filter tools/list, and project JWT claims to backends. Its QuotaPolicy, however, targets AIServiceBackend resources and computes model-token costs. It is not an MCP tenant-quota API. For MCP request quotas, this design uses Envoy Gateway’s BackendTrafficPolicy rate limiting instead. The distinction follows the current <a href="https://aigateway.envoyproxy.io/docs/api/">Envoy AI Gateway API reference</a> and <a href="https://gateway.envoyproxy.io/docs/concepts/rate-limiting/">Envoy Gateway rate-limit design</a>.</p><h3>Split the job across the right layers</h3><p>The common mistake is to ask the service mesh to understand MCP tools. Istio sees HTTP traffic, workload identities, services, ports, and — in some deployments — HTTP paths. It does not decide whether tenant-a may call an MCP tool named restart_deployment.</p><p>Use three layers instead:</p><ol><li><strong>Envoy AI Gateway handles the agent-to-tool boundary.</strong> It validates client identity, builds the visible tool catalog, authorizes each tool call, and selects an MCP backend.</li><li><strong>Envoy Gateway handles coarse traffic controls.</strong> Its global rate limiter can create request buckets from headers populated from validated JWT claims.</li><li><strong>Istio handles east-west transport and workload access.</strong> It encrypts traffic with mTLS and controls which Kubernetes service accounts may connect to each MCP server.</li></ol><p>Envoy AI Gateway 1.0 made its core MCPRoute API stable within the 1.x series and supports authorization-aware tools/list responses. This means a caller does not merely receive a rejection after choosing a forbidden tool. The forbidden tool is omitted from discovery in the first place, which reduces information exposure and prevents wasted agent turns. The release also added per-backend header forwarding and JWT claim projection for downstream identity-aware checks (<a href="https://aigateway.envoyproxy.io/release-notes/v1.0/">Envoy AI Gateway 1.0 release notes</a>).</p><p>The request path now has a clear order:</p><ol><li>An agent sends an MCP request and bearer token.</li><li>The edge proxy validates the token and derives a trusted tenant header for rate limiting.</li><li>The MCP gateway evaluates its tool rules.</li><li>tools/list removes unauthorized tools, or tools/call rejects an unauthorized call.</li><li>The gateway chooses the matching MCP server.</li><li>Istio authenticates the gateway workload over mTLS.</li><li>The MCP server receives only the projected identity fields it needs.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1u-g624RZDJTL1EGaIecg.png" /><figcaption>Each layer makes a different decision: Envoy Gateway limits tenant traffic, Envoy AI Gateway authorizes MCP tools, and Istio protects access to backend workloads</figcaption></figure><h3>Prepare the namespaces and identities</h3><p>This tutorial assumes:</p><ul><li>Kubernetes with compatible Gateway API CRDs</li><li>Envoy AI Gateway 1.0</li><li>An Envoy Gateway version supported by that AI Gateway release</li><li>Istio with either sidecars or ambient mode</li><li>An OAuth issuer that puts tenant, sub, and scope claims in access tokens</li><li>Two Streamable HTTP MCP services named catalog-mcp and ops-mcp</li></ul><p>Check the supported Envoy Gateway, Gateway API, Envoy, and Kubernetes combinations before pinning versions. These combinations change independently, so use the project’s <a href="https://gateway.envoyproxy.io/news/releases/matrix/">compatibility matrix</a> rather than assuming that every recent release works together.</p><p>Create separate namespaces for the gateway, tool servers, and agent workloads:</p><pre>kubectl create namespace ai-gateway<br>kubectl create namespace mcp-tools<br>kubectl create namespace agents</pre><pre>kubectl label namespace ai-gateway istio-injection=enabled<br>kubectl label namespace mcp-tools istio-injection=enabled<br>kubectl label namespace agents istio-injection=enabled</pre><p>If the cluster uses Istio ambient mode, enroll the namespaces with the ambient label instead of enabling sidecar injection. The policy split remains the same. Ambient ztunnel can enforce mTLS and layer-4 authorization, while HTTP-aware rules require a waypoint proxy (<a href="https://istio.io/latest/docs/ambient/migrate/">Istio ambient migration guide</a>).</p><p>Give the gateway data plane a dedicated service account. Do not reuse the controller’s identity or a broad namespace default account.</p><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: tools-gateway<br>  namespace: ai-gateway</pre><p>The exact data-plane service account wiring depends on the Envoy Gateway deployment configuration. Confirm the service account visible in Istio telemetry before writing the final authorization policy.</p><h3>Create one Gateway and one MCPRoute</h3><p>Start with a Gateway for the internal hostname. The listener below omits certificate details because certificate management differs across clusters.</p><pre>apiVersion: gateway.networking.k8s.io/v1<br>kind: Gateway<br>metadata:<br>  name: tools-gateway<br>  namespace: ai-gateway<br>spec:<br>  gatewayClassName: envoy-gateway<br>  listeners:<br>    - name: https<br>      hostname: tools.company.example<br>      port: 443<br>      protocol: HTTPS<br>      tls:<br>        mode: Terminate<br>        certificateRefs:<br>          - kind: Secret<br>            name: tools-company-example-tls</pre><p>Now attach an MCPRoute. An MCPRoute and its parent Gateway must be in the same namespace. The route’s default path is /mcp, and its backends can be ordinary Kubernetes Services, as defined in the <a href="https://aigateway.envoyproxy.io/docs/api/">MCPRoute API</a>.</p><p>The following example exposes read-only catalog tools to two tenants. It exposes the operations tool only to tenant A with the ops.execute scope.</p><pre>apiVersion: aigateway.envoyproxy.io/v1beta1<br>kind: MCPRoute<br>metadata:<br>  name: company-tools<br>  namespace: ai-gateway<br>spec:<br>  parentRefs:<br>    - name: tools-gateway<br>      kind: Gateway<br>      group: gateway.networking.k8s.io<br>  path: /mcp<br>  backendRefs:<br>    - name: catalog-mcp<br>      namespace: mcp-tools<br>      port: 8080<br>      toolFilter:<br>        include:<br>          - search_catalog<br>          - get_product<br>    - name: ops-mcp<br>      namespace: mcp-tools<br>      port: 8080<br>      toolFilter:<br>        include:<br>          - restart_deployment<br>  securityPolicy:<br>    oauth:<br>      issuer: https://id.company.example<br>      audiences:<br>        - https://tools.company.example/mcp<br>      protectedResourceMetadata:<br>        resource: https://tools.company.example/mcp<br>        scopesSupported:<br>          - catalog.read<br>          - ops.execute<br>      claimToHeaders:<br>        - claim: sub<br>          header: x-authenticated-subject<br>        - claim: tenant<br>          header: x-authenticated-tenant<br>    authorization:<br>      defaultAction: Deny<br>      rules:<br>        - source:<br>            jwt:<br>              scopes:<br>                - catalog.read<br>          target:<br>            tools:<br>              - backend: catalog-mcp<br>                tool: search_catalog<br>              - backend: catalog-mcp<br>                tool: get_product<br>          action: Allow<br>        - source:<br>            jwt:<br>              scopes:<br>                - ops.execute<br>              claims:<br>                - name: tenant<br>                  values:<br>                    - tenant-a<br>          target:<br>            tools:<br>              - backend: ops-mcp<br>                tool: restart_deployment<br>          action: Allow</pre><p>Treat this manifest as the shape to adapt, not a file to apply without checking your installed CRDs. Fields such as cross-namespace backend references may require a ReferenceGrant, and exact selector structures must match the CRD version installed in the cluster.</p><p>The safe part of the design is the policy order: default deny, narrow allow rules, and an explicit list of tools. The API’s default authorization action is already Deny, but stating it makes the intended behavior obvious. Rules run in order and the first match wins (<a href="https://aigateway.envoyproxy.io/docs/api/">MCP authorization API</a>).</p><p>Claim projection also strips client-provided headers with the configured names before inserting verified values. This prevents an agent from forging x-authenticated-tenant or x-authenticated-subject. Only selected claims are sent upstream; the full JWT does not need to reach every MCP server (<a href="https://aigateway.envoyproxy.io/docs/api/">Envoy AI Gateway API reference</a>).</p><h3>Apply tenant request quotas at the Gateway layer</h3><p>MCP traffic is not billed in model tokens, so use request limits. Envoy Gateway implements shared global limits through BackendTrafficPolicy and its external rate-limit service. A global bucket is shared across Envoy proxy replicas rather than being recreated per pod (<a href="https://gateway.envoyproxy.io/docs/tasks/traffic/global-rate-limit/">global rate-limit task</a>).</p><p>First, configure Envoy Gateway JWT validation to copy the verified tenant claim into a trusted header. Attach the policy to the HTTPRoute generated for the MCPRoute, or to the Gateway if your installed policy version supports the behavior you need. Find the generated route name with:</p><pre>kubectl get httproute -n ai-gateway</pre><p>Then apply the policies, replacing GENERATED_MCP_HTTPROUTE:</p><pre>apiVersion: gateway.envoyproxy.io/v1alpha1<br>kind: SecurityPolicy<br>metadata:<br>  name: tools-edge-jwt<br>  namespace: ai-gateway<br>spec:<br>  targetRefs:<br>    - group: gateway.networking.k8s.io<br>      kind: HTTPRoute<br>      name: GENERATED_MCP_HTTPROUTE<br>  jwt:<br>    providers:<br>      - name: company-idp<br>        issuer: https://id.company.example<br>        audiences:<br>          - https://tools.company.example/mcp<br>        remoteJWKS:<br>          uri: https://id.company.example/.well-known/jwks.json<br>        claimToHeaders:<br>          - claim: tenant<br>            header: x-rate-limit-tenant<br>---<br>apiVersion: gateway.envoyproxy.io/v1alpha1<br>kind: BackendTrafficPolicy<br>metadata:<br>  name: tools-tenant-quota<br>  namespace: ai-gateway<br>spec:<br>  targetRefs:<br>    - group: gateway.networking.k8s.io<br>      kind: HTTPRoute<br>      name: GENERATED_MCP_HTTPROUTE<br>  rateLimit:<br>    global:<br>      rules:<br>        - clientSelectors:<br>            - headers:<br>                - name: x-rate-limit-tenant<br>                  value: tenant-a<br>          limit:<br>            requests: 600<br>            unit: Hour<br>        - clientSelectors:<br>            - headers:<br>                - name: x-rate-limit-tenant<br>                  value: tenant-b<br>          limit:<br>            requests: 200<br>            unit: Hour</pre><p>This duplicates JWT validation at two connected layers. That is deliberate: Envoy Gateway needs a verified claim for its rate-limit key, while MCPRoute needs the token claims for tool policy and MCP authorization behavior. Keep issuer, audience, and key settings generated from one platform configuration to prevent drift.</p><p>For many tenants, do not create one static rule per customer forever. Use a small number of service tiers, or connect an external authorization or entitlement service that returns trusted quota descriptors. Also remember that a request quota measures calls, not tool cost. One search and one large deployment operation both consume one request unless you split them across separate routes or policy buckets.</p><h3>Lock down east-west access with Istio</h3><p>Require mTLS for the MCP server namespace:</p><pre>apiVersion: security.istio.io/v1<br>kind: PeerAuthentication<br>metadata:<br>  name: default<br>  namespace: mcp-tools<br>spec:<br>  mtls:<br>    mode: STRICT</pre><p>STRICT means an inbound connection must use Istio mutual TLS. It prevents a workload outside the mesh from directly reaching a protected MCP pod over plaintext (<a href="https://istio.io/latest/docs/reference/config/security/peer_authentication/">Istio PeerAuthentication reference</a>).</p><p>Next, allow only the gateway data-plane identity to call the MCP services:</p><pre>apiVersion: security.istio.io/v1<br>kind: AuthorizationPolicy<br>metadata:<br>  name: catalog-mcp-ingress<br>  namespace: mcp-tools<br>spec:<br>  selector:<br>    matchLabels:<br>      app: catalog-mcp<br>  action: ALLOW<br>  rules:<br>    - from:<br>        - source:<br>            principals:<br>              - cluster.local/ns/ai-gateway/sa/tools-gateway<br>---<br>apiVersion: security.istio.io/v1<br>kind: AuthorizationPolicy<br>metadata:<br>  name: ops-mcp-ingress<br>  namespace: mcp-tools<br>spec:<br>  selector:<br>    matchLabels:<br>      app: ops-mcp<br>  action: ALLOW<br>  rules:<br>    - from:<br>        - source:<br>            principals:<br>              - cluster.local/ns/ai-gateway/sa/tools-gateway</pre><p>In ambient mode, layer-4 policies can be enforced by ztunnel. Policies that inspect HTTP methods, paths, or headers must target a waypoint. Istio recommends targetRefs for these layer-7 ambient policies rather than pod selectors (<a href="https://istio.io/latest/docs/ambient/migrate/migrate-policies/">Istio ambient policy guide</a>).</p><p>Do not reproduce individual MCP tool permissions in Istio. Most MCP calls use the same HTTP path and carry the method and tool name inside a JSON-RPC body. The MCP gateway has the protocol context needed to authorize that body correctly.</p><h3>Test discovery before testing calls</h3><p>A secure gateway must pass two different tests.</p><p>First, request tools/list with a tenant B token. The response should contain search_catalog and get_product, but not restart_deployment. Envoy AI Gateway applies tool authorization to both discovery and invocation, so an unauthorized tool should be absent rather than merely unusable (<a href="https://aigateway.envoyproxy.io/release-notes/v1.0/">Envoy AI Gateway 1.0 release notes</a>).</p><p>Second, bypass the normal agent flow and manually send a tools/call request for ops-mcp.restart_deployment with the same tenant B token. The gateway must reject it. Hidden discovery improves safety and model behavior, but invocation authorization remains the real enforcement point.</p><p>Also verify these failure cases:</p><ul><li>No bearer token: authentication fails.</li><li>Valid token with the wrong audience: authentication fails.</li><li>Forged x-authenticated-tenant: the gateway replaces or strips it.</li><li>Direct pod or Service call from an agent workload: Istio denies it.</li><li>Requests beyond the tenant bucket: the edge returns HTTP 429.</li><li>Gateway connection to an MCP server without mTLS: Istio rejects it.</li></ul><p>Finally, check the MCP servers’ logs. They should receive the projected subject and tenant headers, not an unverified client value. Avoid logging full tokens, tool arguments, or tool results by default. Those fields can contain customer data and operational secrets.</p><h3>Put the boundary under continuous test</h3><p>The first production step is not adding more MCP servers. It is turning the policy examples into automated checks.</p><p>Create a small test matrix with one token for each tenant and role. Run tools/list and expected tools/call requests after every route, identity-provider, or gateway change. Include negative tests for tools that must stay hidden. Then test direct service access from an unapproved Kubernetes service account.</p><p>This catches the failures that ordinary health checks miss: an overly broad scope rule, a changed JWT claim, a missing Istio identity, a generated HTTPRoute with a new name, or a backend that trusts a user-supplied header.</p><p>The larger design rule is simple. Let the MCP gateway understand tools. Let Envoy Gateway control request volume. Let Istio authenticate workloads and protect east-west traffic. When each layer makes decisions from information it can actually verify, tools.company.example remains one useful endpoint instead of becoming one shared bypass around the platform’s security model.</p><h3>Sources</h3><ul><li><a href="https://aigateway.envoyproxy.io/release-notes/v1.0/">Envoy AI Gateway v1.0 — General Availability</a></li><li><a href="https://aigateway.envoyproxy.io/docs/api/">Envoy AI Gateway API Reference</a></li><li><a href="https://gateway.envoyproxy.io/news/releases/matrix/">Envoy Gateway Compatibility Matrix</a></li><li><a href="https://gateway.envoyproxy.io/docs/tasks/traffic/global-rate-limit/">Envoy Gateway Global Rate Limit</a></li><li><a href="https://gateway.envoyproxy.io/docs/concepts/rate-limiting/">Envoy Gateway Rate Limiting Concepts</a></li><li><a href="https://istio.io/latest/docs/reference/config/security/peer_authentication/">Istio PeerAuthentication Reference</a></li><li><a href="https://istio.io/latest/docs/ambient/migrate/">Istio Ambient Migration Guide</a></li><li><a href="https://istio.io/latest/docs/ambient/migrate/migrate-policies/">Istio Ambient Policy Migration</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9636cbc71211" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Istio Packet Flow: Sidecar vs. Ambient Mesh, Step by Step]]></title>
            <link>https://tejokumar.medium.com/istio-packet-flow-sidecar-vs-ambient-mesh-step-by-step-35c26cfc114b?source=rss-99d62938afdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/35c26cfc114b</guid>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[sidecar]]></category>
            <category><![CDATA[service-discovery]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[ambient-mesh]]></category>
            <dc:creator><![CDATA[Tejo Chenchu]]></dc:creator>
            <pubDate>Sun, 09 Aug 2026 06:14:30 GMT</pubDate>
            <atom:updated>2026-08-09T06:14:30.517Z</atom:updated>
            <content:encoded><![CDATA[<h4>Follow one connection through sidecars, ztunnels, waypoints, and ingress gateways — and see exactly where routing, mTLS, and policy enforcement happen.</h4><p>When an Istio request fails, the first question is often: <strong>Which proxy handled it?</strong></p><p>That sounds simple. In sidecar mode, every workload pod has an Envoy proxy. In ambient mode, node-level ztunnel proxies handle Layer 4 traffic, while optional waypoint proxies handle Layer 7. Add an ingress gateway, and one request may cross two different Envoy roles before reaching the application.</p><p>The useful way to understand these designs is to follow a connection in order. We need to identify four things at each step:</p><ol><li>Where traffic is intercepted.</li><li>Which component selects the destination endpoint.</li><li>Where mutual TLS, or mTLS, starts and ends.</li><li>Which component enforces Layer 4 and Layer 7 policy.</li></ol><p>Layer 4, or L4, means connection-level data such as IP addresses, ports, and workload identity. Layer 7, or L7, means application data such as an HTTP method, path, or header.</p><p>This guide describes the current architecture in Istio 1.30, released on May 18, 2026. Sidecar and ambient workloads can coexist in the same mesh, but they do not produce identical packet paths or policy behavior (<a href="https://istio.io/latest/news/releases/1.30.x/announcing-1.30/">Istio 1.30 release</a>, <a href="https://istio.io/latest/docs/overview/dataplane-modes/">data plane modes</a>).</p><h3>Start with the main architectural difference</h3><p>In sidecar mode, Istio places an Envoy proxy next to every application container. Traffic entering or leaving the pod passes through that Envoy. The proxy can process both L4 and L7 data, including routing, retries, HTTP authorization, telemetry, and mTLS (<a href="https://istio.io/latest/docs/ops/deployment/architecture/">Istio architecture</a>).</p><p>Ambient mode separates that work into two layers:</p><ul><li><strong>ztunnel</strong> is a per-node proxy. It handles connection security, workload identity, L4 authorization, and L4 telemetry.</li><li><strong>waypoint</strong> is an optional Envoy proxy shared by a namespace or set of workloads. It handles HTTP routing, L7 authorization, retries, timeouts, and HTTP telemetry.</li></ul><p>Ztunnel does not parse HTTP headers or terminate the application’s HTTP protocol. It transports connections through HBONE, an HTTP CONNECT-based tunnel protected with mTLS. A waypoint is required when the request needs Istio’s L7 processing (<a href="https://istio.io/latest/docs/ambient/overview/">ambient overview</a>).</p><p>This split changes where decisions happen. A sidecar makes most outbound decisions beside the source application. In ambient mode with a service waypoint, the destination waypoint makes the L7 routing and load-balancing decision (<a href="https://istio.io/latest/docs/ambient/architecture/data-plane/">ambient data plane</a>).</p><h3>Sidecar mode: one in-mesh request, step by step</h3><p>Assume checkout calls payments through a Kubernetes Service. Both pods have sidecars, and mTLS is enabled.</p><h3>1. The application opens a normal connection</h3><p>The checkout process resolves the service name and opens a TCP connection to the service address. The application does not need to know that Envoy exists.</p><p>Istio normally uses Linux traffic-redirection rules to capture the connection. Outbound traffic is sent to the sidecar’s outbound listener, commonly port 15001. Inbound traffic is captured by the destination sidecar on port 15006 (<a href="https://istio.io/latest/docs/ops/deployment/application-requirements/">Istio application ports</a>, <a href="https://istio.io/latest/docs/reference/config/networking/sidecar/">Sidecar capture modes</a>).</p><h3>2. The source sidecar recovers the intended destination</h3><p>The source Envoy receives the redirected connection and identifies the original service address and port. It matches that destination against configuration supplied by Istiod.</p><p>This is where outbound VirtualService, DestinationRule, or Kubernetes Gateway API rules affect the request. For HTTP traffic, the source sidecar can inspect the host, path, method, and headers before choosing a route.</p><h3>3. The source sidecar selects an endpoint</h3><p>The source Envoy chooses a payments endpoint from its configured cluster. It can apply subset routing, load-balancing policy, connection-pool settings, outlier detection, and retries where the protocol and configuration support them (<a href="https://istio.io/latest/docs/concepts/traffic-management/">Istio traffic management</a>).</p><p>This is an important debugging fact: <strong>in sidecar mode, the source sidecar usually chooses the destination pod</strong>. Kubernetes networking carries the resulting connection, but the mesh routing decision has already happened in Envoy.</p><h3>4. The source sidecar starts mTLS</h3><p>The source sidecar opens a connection to the destination sidecar. When Istio mTLS is active, Envoy presents the source workload certificate and validates the destination identity. Istiod supplies certificates and proxy configuration to the data plane (<a href="https://istio.io/latest/docs/ops/deployment/architecture/">Istio architecture</a>).</p><p>The encrypted connection runs between the two proxies, not directly between the application processes.</p><h3>5. The destination sidecar terminates mTLS and checks policy</h3><p>The destination Envoy accepts the connection and terminates mesh mTLS. It now knows the authenticated source workload identity.</p><p>The destination proxy enforces inbound authorization. L4 rules can match properties such as identity, namespace, IP address, and port. L7 rules can additionally match HTTP properties such as methods and paths.</p><h3>6. The destination sidecar forwards plaintext locally</h3><p>After the request passes policy, the destination sidecar forwards it to the payments container over the pod network namespace. This final local connection is normally plaintext because the application is not participating in mesh mTLS itself.</p><p>The full forward path is therefore:</p><p>checkout app → checkout Envoy → mTLS → payments Envoy → payments app</p><p>The response returns through the same two proxies in reverse.</p><h3>Ambient mode without a waypoint: the L4 path</h3><p>Now remove the sidecars and enroll both workloads in ambient mode. Istio’s CNI component installs redirection inside each workload pod’s network namespace. This captures traffic without adding a proxy container to the pod (<a href="https://istio.io/latest/docs/ambient/architecture/traffic-redirection/">ztunnel traffic redirection</a>).</p><p>Assume the same checkout request calls payments, but payments has no waypoint.</p><h3>1. The application opens the connection</h3><p>The application still connects to the Kubernetes Service normally. The in-pod redirection rules capture the outbound connection and send it to the source node’s ztunnel.</p><h3>2. The source ztunnel identifies the workload and destination</h3><p>The node’s ztunnel knows which pod created the connection. It uses the certificate for that workload’s service account rather than a shared ztunnel identity. One ztunnel can therefore represent several local workload identities without treating them as the same caller (<a href="https://istio.io/latest/docs/ambient/architecture/data-plane/">ambient identity model</a>).</p><p>Ztunnel determines how to reach the destination. For Service traffic without a waypoint, routing remains close to normal Kubernetes behavior: the request goes to an endpoint belonging to that Service.</p><h3>3. The source ztunnel creates an HBONE tunnel</h3><p>Because the destination is also in the mesh, the source ztunnel sends the connection through an encrypted HBONE tunnel. HBONE carries the original TCP stream while mTLS authenticates the source and destination workload identities.</p><h3>4. The destination ztunnel terminates HBONE</h3><p>The destination node’s ztunnel accepts the tunnel and validates its identity. It enforces destination-side L4 AuthorizationPolicy rules before forwarding the connection.</p><h3>5. The destination ztunnel delivers the connection</h3><p>If policy allows the request, ztunnel sends it into the destination pod. In-pod redirection ensures that inbound traffic cannot simply skip the ambient data path (<a href="https://istio.io/latest/docs/ambient/architecture/traffic-redirection/">ztunnel traffic redirection</a>).</p><p>The path is:</p><p>checkout app → source ztunnel → HBONE/mTLS → destination ztunnel → payments app</p><p>There is no HTTP-aware proxy in this path. Ztunnel cannot enforce a rule such as “allow GET /balance but deny POST /balance.” It can allow or deny the connection based on L4 information and authenticated workload identity.</p><h3>Ambient mode with a waypoint: the L7 path</h3><p>Add a waypoint for the payments Service, and the middle of the path changes.</p><h3>1. The source ztunnel sees that the destination uses a waypoint</h3><p>The application connection is captured exactly as before. The source ztunnel checks the destination’s mesh configuration and finds the assigned waypoint.</p><p>Waypoint selection is based on the resource originally addressed. For example, traffic sent to a Service uses a waypoint configured to handle Service traffic. Istio does not first select a pod and then decide to use that pod’s waypoint (<a href="https://istio.io/latest/docs/ambient/usage/waypoint/">waypoint traffic types</a>).</p><h3>2. Ztunnel sends HBONE to the waypoint</h3><p>The source ztunnel opens an HBONE tunnel to the waypoint and preserves the source workload identity. Waypoints accept HBONE traffic rather than arbitrary direct workload connections (<a href="https://istio.io/latest/docs/ambient/architecture/data-plane/">ambient data plane</a>).</p><h3>3. The waypoint performs L7 processing</h3><p>The waypoint terminates the first HBONE tunnel and processes the application protocol. This is where Istio can enforce HTTP authorization, validate JWTs, generate HTTP metrics, and apply routing, retry, timeout, or extension configuration.</p><p>For a request addressed to a Service, the destination waypoint also performs L7 load balancing across the Service endpoints. This differs from the sidecar path, where the source Envoy normally chooses the endpoint.</p><h3>4. The waypoint opens a second HBONE tunnel</h3><p>After selecting the destination pod, the waypoint sends the request through another HBONE tunnel to the ztunnel on the destination node.</p><h3>5. The destination ztunnel applies L4 policy</h3><p>The destination ztunnel receives the connection, applies its L4 authorization checks, and forwards the allowed traffic to the workload.</p><p>The path becomes:</p><p>checkout app → source ztunnel → HBONE → waypoint → HBONE → destination ztunnel → payments app</p><p>There are two secure tunnel sections. The waypoint sits between them so it can read and process the application request. This extra hop provides L7 behavior, but it also adds another proxy and another place to inspect when latency, routing, or policy does not behave as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXpGm6NiGwH0Qr6WF04XtQ.png" /><figcaption>The main change is not only proxy placement. Endpoint selection and L7 enforcement move from the source sidecar to the destination waypoint.</figcaption></figure><h3>Ingress gateway flow in sidecar and ambient deployments</h3><p>An Istio ingress gateway is an Envoy proxy at the mesh edge. It accepts external connections and applies gateway listeners, TLS settings, routes, and gateway-attached policy. It is not the same component as an application sidecar or an ambient waypoint.</p><p>Assume an external client calls api.example.com, which routes to the payments Service.</p><h3>Sidecar destination</h3><ol><li>A cloud load balancer or node-level service sends the connection to the ingress gateway.</li><li>The gateway accepts TCP or terminates external TLS, depending on its listener configuration.</li><li>Envoy matches the request against its gateway route.</li><li>The gateway selects a payments endpoint.</li><li>It opens an upstream connection, normally using mesh mTLS when configured.</li><li>The destination sidecar terminates mTLS, applies inbound policy, and forwards to the application.</li></ol><p>The internal path is:</p><p>client → ingress Envoy → mTLS → destination Envoy → app</p><h3>Ambient destination without a waypoint</h3><p>The ingress gateway still performs edge TLS termination and route selection. It then sends the upstream connection toward the ambient workload. The destination node’s ztunnel receives mesh traffic, checks L4 policy, and delivers it to the application. Istio supports ingress gateways serving ambient, sidecar, and non-mesh destinations (<a href="https://istio.io/latest/docs/ambient/usage/add-workloads/">ambient workload interoperability</a>).</p><h3>Ambient destination with a waypoint</h3><p>This path has an important default: <strong>ingress traffic does not automatically pass through the destination Service waypoint</strong>. The istio.io/use-waypoint label controls east-west traffic from ambient workloads, not ingress-originated traffic (<a href="https://istio.io/latest/docs/ambient/usage/waypoint/">ingress gateways and waypoints</a>).</p><p>You can opt a Service or Namespace into the waypoint path with:</p><pre>kubectl label service payments istio.io/ingress-use-waypoint=true</pre><p>Istiod must also have ENABLE_INGRESS_WAYPOINT_ROUTING enabled. It defaults to false. When both settings are present, traffic receives L7 processing at the ingress gateway and again at the destination waypoint (<a href="https://istio.io/latest/docs/ambient/usage/waypoint/">waypoint configuration</a>).</p><p>The enabled path is:</p><p>client → ingress Envoy → waypoint → destination ztunnel → app</p><p>This two-tier gateway design can be useful. The ingress gateway can enforce edge concerns, while the destination waypoint enforces service-owned policy. But it can also duplicate authorization checks, metrics, header changes, or retry behavior. Decide which layer owns each rule rather than copying the same L7 configuration to both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9nc7pg8krpm9kg_n6kNvA.png" /><figcaption>A destination waypoint handles east-west ambient traffic by default. Ingress uses it only when ingress waypoint routing is explicitly enabled.</figcaption></figure><h3>What changes operationally</h3><p>The two modes move the same responsibilities to different places.</p><p><strong>Where is traffic captured?</strong></p><ul><li><strong>Sidecar mode: </strong>Inside each pod</li><li><strong>Ambient L4: </strong>Inside each pod via CNI redirection</li><li><strong>Ambient with waypoint: </strong>Same as ambient L4</li></ul><p><strong>First proxy</strong></p><ul><li><strong>Sidecar mode: </strong>Source Envoy</li><li><strong>Ambient L4: </strong>Source node ztunnel</li><li><strong>Ambient with waypoint: </strong>Source node ztunnel</li></ul><p><strong>Who handles HTTP routing?</strong></p><ul><li><strong>Sidecar mode: </strong>Usually source Envoy</li><li><strong>Ambient L4: </strong>Nobody</li><li><strong>Ambient with waypoint: </strong>Destination waypoint</li></ul><p><strong>Who selects a Service endpoint?</strong></p><ul><li><strong>Sidecar mode: </strong>Usually source Envoy</li><li><strong>Ambient L4: </strong>Ztunnel/Kubernetes-style routing</li><li><strong>Ambient with waypoint: </strong>Destination waypoint</li></ul><p><strong>Where is L4 policy enforced?</strong></p><ul><li><strong>Sidecar mode: </strong>Envoy</li><li><strong>Ambient L4: </strong>Destination ztunnel</li><li><strong>Ambient with waypoint: </strong>Destination ztunnel</li></ul><p><strong>Where is L7 policy enforced?</strong></p><ul><li><strong>Sidecar mode: </strong>Envoy</li><li><strong>Ambient L4: </strong>Not available</li><li><strong>Ambient with waypoint: </strong>Destination waypoint</li></ul><p><strong>Secure mesh transport</strong></p><ul><li><strong>Sidecar mode: </strong>Envoy-to-Envoy mTLS</li><li><strong>Ambient L4: </strong>HBONE mTLS</li><li><strong>Ambient with waypoint: </strong>HBONE on both sides of waypoint</li></ul><p>This also changes troubleshooting. Sidecar metrics commonly report source and destination proxy views. Ambient ztunnel metrics use the source reporter, while waypoint metrics use the waypoint reporter. Ztunnel workloads also do not appear in istioctl proxy-status; Istio provides istioctl ztunnel-config workloads for that data (<a href="https://istio.io/latest/docs/ambient/migrate/enable-ambient-mode/">ambient migration observability</a>).</p><p>Mixed-mode migrations need extra care. Current Istio migration guidance states that traffic from a sidecar workload to an ambient destination bypasses the destination waypoint. The sidecar applies its own L7 decisions and tunnels directly to the destination ztunnel. As a result, L7 policy attached only to the waypoint will not protect that traffic during the transition (<a href="https://istio.io/latest/docs/ambient/migrate/install-ambient-components/">sidecar and ambient interoperability</a>).</p><h3>Trace the real path before changing policy</h3><p>When a request behaves differently after a migration, do not start by rewriting the policy. First write down the expected connection path.</p><p>Use this checklist:</p><ol><li><strong>Identify the original destination.</strong> Was the client addressing a Service, a pod IP, or an external host?</li><li><strong>Find the capture point.</strong> Is the source using a sidecar or ambient redirection?</li><li><strong>Name the first proxy.</strong> It should be a source Envoy or source-node ztunnel.</li><li><strong>Find the endpoint decision.</strong> Check whether the source sidecar, ztunnel, ingress gateway, or destination waypoint chose the backend.</li><li><strong>Mark each encrypted section.</strong> Sidecar mTLS and HBONE tunnels end at different components.</li><li><strong>Place every policy at its enforcement point.</strong> L4 ambient policy belongs at ztunnel. L7 ambient policy belongs at a waypoint. Edge policy belongs at the ingress gateway.</li><li><strong>Check the ingress branch explicitly.</strong> A Service waypoint is bypassed by ingress unless ingress waypoint routing is enabled.</li><li><strong>Check for mixed data plane modes.</strong> A sidecar caller may bypass an ambient destination waypoint during migration.</li></ol><p>Once the path is clear, proxy logs and metrics become much easier to read. You know which component should have selected the endpoint, which identity should appear on the connection, and which proxy should have produced the denial.</p><p>That is the practical difference between sidecar and ambient mode. It is not simply “one proxy per pod” versus “one proxy per node.” The destination choice, security boundary, and L7 enforcement point all move. Follow the connection in order, and those changes stop being surprising.</p><h3>Sources</h3><ul><li><a href="https://istio.io/latest/news/releases/1.30.x/announcing-1.30/">Announcing Istio 1.30.0</a></li><li><a href="https://istio.io/latest/docs/overview/dataplane-modes/">Sidecar or ambient?</a></li><li><a href="https://istio.io/latest/docs/ops/deployment/architecture/">Istio Architecture</a></li><li><a href="https://istio.io/latest/docs/ambient/overview/">Ambient Overview</a></li><li><a href="https://istio.io/latest/docs/ambient/architecture/data-plane/">Ambient Data Plane</a></li><li><a href="https://istio.io/latest/docs/ambient/architecture/traffic-redirection/">Ztunnel Traffic Redirection</a></li><li><a href="https://istio.io/latest/docs/ambient/usage/waypoint/">Configure Waypoint Proxies</a></li><li><a href="https://istio.io/latest/docs/ops/deployment/application-requirements/">Application Requirements</a></li><li><a href="https://istio.io/latest/docs/reference/config/networking/sidecar/">Sidecar Reference</a></li><li><a href="https://istio.io/latest/docs/concepts/traffic-management/">Traffic Management</a></li><li><a href="https://istio.io/latest/docs/ambient/usage/add-workloads/">Add Workloads to the Ambient Mesh</a></li><li><a href="https://istio.io/latest/docs/ambient/migrate/install-ambient-components/">Install Ambient Components</a></li><li><a href="https://istio.io/latest/docs/ambient/migrate/enable-ambient-mode/">Enable Ambient Mode</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35c26cfc114b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Istio Ambient or Sidecars? Decide Before You Migrate]]></title>
            <link>https://tejokumar.medium.com/istio-ambient-or-sidecars-decide-before-you-migrate-76ed32a64387?source=rss-99d62938afdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/76ed32a64387</guid>
            <category><![CDATA[istio-service-mesh]]></category>
            <category><![CDATA[ambient-mesh]]></category>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[decision-making]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Tejo Chenchu]]></dc:creator>
            <pubDate>Fri, 31 Jul 2026 04:42:27 GMT</pubDate>
            <atom:updated>2026-07-31T04:42:27.803Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>A sidecar migration becomes attractive when mesh operations start interfering with application operations. Proxy injection changes pod specifications, proxy upgrades often require workload restarts, and every application team inherits part of the data plane lifecycle. Ambient mode moves that machinery into shared infrastructure, but it does not simply remove sidecars. It replaces one operating model with another.</p><p>The useful question is therefore not, “Can ambient lower our proxy count?” It is, “Does ambient place security, traffic management, and failure domains where our platform team can operate them safely?”</p><p>For a multi-cluster platform, the answer depends on seven things: required policy depth, L7 routing, telemetry, upgrade isolation, troubleshooting, topology, and control-plane load. If any one of those is poorly understood, a broad migration is premature.</p><h3>The architecture changes ownership</h3><p>In sidecar mode, each application pod gets an Envoy proxy. That proxy handles transport security, policy, traffic management, and telemetry close to the workload. The model is repetitive, but operationally familiar: inspect the pod, inspect its proxy, and compare its configuration with the control plane.</p><p>Ambient separates those functions into layers. A per-node ztunnel provides the secure Layer 4 overlay, including mutual TLS, workload identity, L4 authorization, and TCP telemetry. Optional waypoint proxies provide Layer 7 processing such as HTTP authorization, routing, and L7 telemetry. Applications do not need an in-pod proxy. (<a href="https://istio.io/latest/docs/ambient/overview/">istio.io</a>)</p><p>This separation changes the unit of operation:</p><ul><li><strong>Sidecar:</strong> one proxy lifecycle and resource allocation per pod.</li><li><strong>Ambient L4:</strong> one ztunnel lifecycle per node.</li><li><strong>Ambient L7:</strong> shared waypoint lifecycles, usually attached to namespaces, services, or workloads.</li></ul><p>That can remove application restarts from routine proxy upgrades and reduce duplicated proxy resources. It also concentrates responsibility. A bad sidecar usually affects one pod; a bad node-level tunnel or overloaded waypoint can affect many workloads. Ambient reduces the number of moving parts without necessarily reducing the importance of each part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBeFuW92aDzJOEPRbqQx7A.png" /><figcaption>Sidecars place L4 and L7 processing beside each workload; ambient separates node-level L4 transport from optional shared L7 processing.</figcaption></figure><h3>Start with policy, not cost</h3><p>Security-policy requirements are the first decision gate because migration can temporarily or permanently change where enforcement occurs.</p><p>If a namespace needs only encrypted workload traffic, workload identity, and L4 authorization, ztunnel may provide the complete mesh layer. This is ambient’s clearest fit: the platform gets mTLS and basic policy without adding an Envoy container to every pod.</p><p>HTTP paths, methods, headers, JWT claims, retries, traffic splitting, and other L7 behavior require a waypoint. That is not inherently a problem, but the team must identify every workload whose controls depend on HTTP semantics. A spreadsheet based only on namespace labels will miss this distinction.</p><p>Existing customizations can be a harder blocker. Istio’s migration documentation says EnvoyFilter resources targeting waypoints are not supported. It also recommends moving VirtualService configuration to Gateway API HTTPRoute resources because ambient support for VirtualService remains limited. Mixing VirtualService and HTTPRoute for the same workload produces undefined behavior. (<a href="https://istio.io/latest/docs/ambient/migrate/">istio.io</a>)</p><p>There is also an enforcement gap to plan around. Istio documents that continuous, zero-downtime migration of L7 policies is not currently possible: old sidecar-targeted policies must be removed and waypoint-targeted policies applied, leaving a period in which the L7 rules are not enforced. For regulated or high-risk services, that fact alone may require a maintenance window or justify keeping sidecars until the migration path improves. (<a href="https://istio.io/latest/docs/ambient/migrate/">istio.io</a>)</p><h3>Use a decision matrix</h3><p>Score candidate workloads rather than deciding for the entire mesh at once.</p><p><strong>Security policy</strong></p><ul><li><strong>Ambient is favored when: </strong>L4 identity and authorization cover most traffic</li><li><strong>Keep sidecars when: </strong>Continuous L7 enforcement is mandatory during migration</li></ul><p><strong>L7 routing</strong></p><ul><li><strong>Ambient is favored when: </strong>A small number of well-defined waypoints can own it</li><li><strong>Keep sidecars when: </strong>Workloads depend heavily on proxy-specific customization</li></ul><p><strong>Telemetry</strong></p><ul><li><strong>Ambient is favored when: </strong>Platform-owned TCP and waypoint telemetry is sufficient</li><li><strong>Keep sidecars when: </strong>Teams depend on pod-local proxy inspection or unproven fields</li></ul><p><strong>Upgrades</strong></p><ul><li><strong>Ambient is favored when: </strong>Removing proxy-driven workload restarts has high value</li><li><strong>Keep sidecars when: </strong>Per-workload isolation is more valuable than central operation</li></ul><p><strong>Failure domain</strong></p><ul><li><strong>Ambient is favored when: </strong>Shared node and waypoint components can be isolated and scaled</li><li><strong>Keep sidecars when: </strong>Shared waypoint impact is unacceptable</li></ul><p><strong>Multicluster</strong></p><ul><li><strong>Ambient is favored when: </strong>The platform uses multi-primary clusters on separate networks</li><li><strong>Keep sidecars when: </strong>It uses primary-remote or requires same-network support</li></ul><p><strong>Configuration</strong></p><ul><li><strong>Ambient is favored when: </strong>Gateway API and waypoint policies fit the operating model</li><li><strong>Keep sidecars when: </strong>EnvoyFilter or incompatible APIs are critical</li></ul><p>My practical rule is to require a clear ambient advantage in at least two operational categories, with no unresolved security blocker. “Fewer proxies” is only one advantage. It should not outweigh an uncertain policy path or an unsupported topology.</p><h3>Multi-cluster is the sharp edge</h3><p>Ambient multi-network, multi-cluster support reached beta with Istio 1.29. The project reported improvements in telemetry, connectivity, and reliability, including direct remote-cluster routing from ingress gateways and waypoints. Some telemetry improvements require the AMBIENT_ENABLE_BAGGAGE feature option. (<a href="https://istio.io/latest/blog/2026/ambient-multinetwork-multicluster-beta/">istio.io</a>)</p><p>Beta does not mean topology parity with sidecars. The current ambient documentation supports multiple primary clusters on separate networks. Primary-remote configurations are not supported, and same-network multicluster configurations remain untested and may be broken. By comparison, sidecar-mode documentation covers both multi-primary and primary-remote models. (<a href="https://istio.io/latest/docs/ambient/install/multicluster/">istio.io</a>)</p><p>Ambient also assumes consistently named waypoint deployments across clusters. Their configurations must be synchronized by a delivery system such as Argo CD or Flux. Service scope must remain uniform, because remote service-scope configuration is not treated as an independent source of truth. Remote-network load can also become uneven because connection pooling may favor a particular endpoint, although Istio notes that a similar limitation exists in sidecar mode. (<a href="https://istio.io/latest/docs/ambient/install/multicluster/">istio.io</a>)</p><p>These constraints turn multicluster readiness into a binary gate. If your current mesh uses primary-remote control planes, do not begin by migrating production namespaces. First decide whether changing the control-plane topology is independently worthwhile. Combining a topology redesign with a data-plane migration makes rollback and fault attribution much harder.</p><h3>What the 1.30.3 change means</h3><p>Istio 1.30.3, released July 16, 2026, narrowed ambient XDS pushes caused by workload or service address changes. Istiod now sends those updates only to affected waypoints instead of all waypoints and proxies. The behavior can be disabled with AMBIENT_SCOPED_ADDRESS_PUSHES=false. (<a href="https://istio.io/latest/news/releases/1.30.x/announcing-1.30.3/">istio.io</a>)</p><p>This improves the control-plane scaling shape for platforms with many waypoints. A deployment, endpoint, or service change should create less irrelevant configuration work across the mesh.</p><p>It does <strong>not</strong> prove that application request latency will fall. XDS push scoping concerns control-plane distribution, not the steady-state request path. Measure istiod CPU, push volume, convergence time, and proxy synchronization during churn. Measure request latency separately.</p><p>The release strengthens the case for testing ambient at platform scale, but it does not remove the need to size waypoints or model their failure domains.</p><h3>A phased migration for a two-cluster platform</h3><p>Consider a platform with two primary Kubernetes clusters in separate regions and networks. Most services require mTLS and service-account authorization. A smaller set of public APIs uses JWT validation, HTTP-route policy, and canary traffic splitting.</p><p>The safest migration proceeds in operational order.</p><h3>1. Classify the mesh inventory</h3><p>Export every AuthorizationPolicy, RequestAuthentication, VirtualService, DestinationRule, WasmPlugin, and EnvoyFilter. Map each resource to a workload owner and label it as L4, L7, or proxy-specific.</p><p>Exit only when every candidate namespace has a named policy owner and every L7 dependency has a proposed waypoint configuration. An unowned filter is not harmless legacy configuration; it is an unknown migration requirement.</p><h3>2. Prove the shared substrate</h3><p>Install the ambient-capable CNI and ztunnel while leaving existing sidecar workloads unchanged. Validate certificate delivery, traffic capture, node replacement, and CNI recovery.</p><p>Use istioctl ztunnel-config to inspect workloads, services, certificates, and raw proxy state. Confirm that expected identities appear and that node drains do not create unexplained connection failures. Istio provides separate troubleshooting paths for ztunnel and waypoints, so runbooks should reflect that split before production traffic arrives. (<a href="https://istio.io/latest/docs/ambient/usage/troubleshoot-ztunnel/">istio.io</a>)</p><p>Suggested exit criteria:</p><ul><li>All expected workloads and certificates appear in ztunnel state.</li><li>Node replacement produces no policy bypass or sustained error-rate increase.</li><li>On-call engineers can identify whether a failure sits in CNI capture, ztunnel, waypoint, gateway, or application code.</li></ul><h3>3. Migrate an L4-only namespace</h3><p>Choose an internal service with representative request volume but no HTTP-specific mesh policy. Enable ambient for its namespace, remove sidecar injection, and restart its pods in a controlled rollout.</p><p>Compare CPU and memory at the workload, node, and mesh levels. Also compare connection establishment, TCP errors, mTLS identity, and deployment duration. Lower pod memory is useful only if node-level overhead and operational risk remain acceptable.</p><p>Keep the namespace in this phase through at least one node rotation, one Istio patch upgrade, and one application rollback.</p><h3>4. Introduce a waypoint</h3><p>Select a non-critical API that uses ordinary HTTP authorization and routing. Convert its configuration to supported Gateway API and waypoint resources, then test every caller path.</p><p>This is where mixed-mode behavior matters. Istio warns that traffic from sidecar workloads to an ambient destination can bypass its waypoint. The destination’s L7 waypoint policy may therefore remain unenforced until the source is also migrated. Ingress gateways also bypass waypoints by default unless configured to use them. (<a href="https://istio.io/latest/docs/ambient/migrate/">istio.io</a>)</p><p>Build a caller matrix covering ambient pods, sidecar pods, ingress, jobs, and out-of-mesh clients. Do not approve the waypoint based on one ambient-to-ambient test.</p><h3>5. Exercise cross-cluster failure</h3><p>Deploy identically named waypoints and synchronized policy in both clusters. Then test remote routing, east-west gateway loss, cluster-local endpoint exhaustion, certificate rotation, and full regional failover.</p><p>Measure endpoint distribution rather than assuming it is even. Confirm that dashboards preserve source cluster, destination cluster, workload identity, response code, and waypoint attribution. If required telemetry depends on an opt-in feature flag, treat that flag as part of the production configuration contract.</p><h3>6. Expand by workload class</h3><p>Migrate namespaces in cohorts: L4-only services first, conventional L7 services next, and customized or regulated workloads last. Keep sidecars for workloads that fail a gate. Ambient and sidecar workloads can coexist, so hybrid operation is a valid target state rather than merely a temporary embarrassment. (<a href="https://istio.io/latest/docs/ambient/overview/">istio.io</a>)</p><h3>Measure the operating model</h3><p>A successful pilot should answer more than whether requests completed. Record:</p><ul><li>application pod CPU and memory</li><li>ztunnel resource use per node</li><li>waypoint CPU, memory, saturation, and replica recovery</li><li>istiod CPU, XDS push counts, and convergence under endpoint churn</li><li>deployment duration and number of proxy-driven restarts</li><li>request and connection error rates during upgrades</li><li>time for an on-call engineer to locate a policy or routing fault</li><li>cross-cluster traffic distribution and failover time</li></ul><p>Define rollback thresholds before migration. Examples include any confirmed policy bypass, waypoint saturation above the agreed headroom, missing security telemetry, or a material increase in recovery time. A reversible architecture is useful only when the team knows when to reverse it.</p><h3>The practical decision</h3><p>Choose ambient for workload classes where L4 coverage is common, L7 needs can be cleanly assigned to waypoints, shared infrastructure matches the platform ownership model, and the supported multicluster topology matches reality.</p><p>Keep sidecars where continuous L7 enforcement, primary-remote topology, EnvoyFilter customization, or pod-local failure isolation outweighs the lifecycle savings. Revisit those workloads as Istio closes specific gaps; do not block the whole platform on the hardest namespace.</p><p>Ambient mode is not a scheduler, a cross-region replication layer, or an application-resilience mechanism. It will not repair unsafe retries, poor timeout budgets, or a database that cannot tolerate regional failure. Its value is narrower and still substantial: it lets a platform team separate secure transport from optional L7 processing and operate those layers independently.</p><p>The right migration target is usually not “all ambient.” It is a mesh in which each workload uses the simplest data plane that satisfies its policy, routing, telemetry, and failure-domain requirements.</p><h3>Sources</h3><ul><li><a href="https://istio.io/latest/news/releases/1.30.x/announcing-1.30.3/">Announcing Istio 1.30.3</a></li><li><a href="https://istio.io/latest/blog/2026/ambient-multinetwork-multicluster-beta/">Ambient multi-network multicluster support is now Beta</a></li><li><a href="https://istio.io/latest/docs/ambient/migrate/">Migrate from Sidecar to Ambient</a></li><li><a href="https://istio.io/latest/docs/ambient/overview/">Ambient Mode Overview</a></li><li><a href="https://istio.io/latest/docs/ambient/install/multicluster/">Install Multicluster</a></li><li><a href="https://istio.io/latest/docs/ambient/usage/troubleshoot-ztunnel/">Troubleshoot connectivity issues with ztunnel</a></li><li><a href="https://istio.io/latest/docs/ambient/usage/troubleshoot-waypoint/">Troubleshoot issues with waypoints</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76ed32a64387" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Service Mesh @Box]]></title>
            <link>https://medium.com/box-tech-blog/service-mesh-box-d792cc62f8d1?source=rss-99d62938afdd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d792cc62f8d1</guid>
            <category><![CDATA[service-mesh]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[envoy-proxy]]></category>
            <category><![CDATA[box]]></category>
            <dc:creator><![CDATA[Tejo Chenchu]]></dc:creator>
            <pubDate>Wed, 19 Jan 2022 19:13:00 GMT</pubDate>
            <atom:updated>2022-01-19T19:13:00.231Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUoSCUeOTJvBIOyLqyH_lw.png" /><figcaption>Illustrated by Navied Mahdavian / Art Directed by Christie Folsom</figcaption></figure><h3>What is Service Mesh?</h3><p>This topic is explained in detail on many popular blogs like <a href="https://www.tetrate.io/blog/what-is-a-service-mesh/">Tetrate.io</a> and <a href="https://www.redhat.com/en/topics/microservices/what-is-a-service-mesh">RedHat</a>. Modern day systems are built with lots of micro services, which depend on other micro services to successfully accomplish their tasks. That’s where a Service Mesh comes in. It is a framework and infrastructure layer that lets micro services securely connect and communicate with each other. This means individual services don’t have to worry about where dependent services are located. Service Mesh takes care of that and enables individual services to route their requests through Service Mesh components. It also provides clear observability of the entire traffic pattern within the infrastructure and provides capabilities to control it. Many solutions are available in the market to address Service Mesh needs. Some of them include <a href="https://istio.io/">Istio</a>, <a href="https://linkerd.io/">Linkerd</a>, <a href="https://www.hashicorp.com/products/consul">Consul</a>, <a href="https://aws.amazon.com/app-mesh">App Mesh from AWS</a>, <a href="https://traefik.io/traefik-mesh/">trafeik-mesh</a>, <a href="https://kuma.io/">kuma</a>, and <a href="https://openservicemesh.io/">OpenServiceMesh</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*ToJLD25jAk9dc-UPFZSrfw.png" /></figure><h3>Why Service Mesh at Box?</h3><p>When Box started in 2005, all application services were built as a monolithic application with single source control. This application was deployed on multiple instances for better scalability and availability. Services were deployed as web services and could talk to each other on the same instance. Pretty cool! As Box grew, the complexities of maintaining a monolithic application also grew. Therefore, Box started migrating services to micro services architecture. All new features and services are now built as micro services. Today, hundreds of micro services are running in Box infrastructure.</p><p>All Box services are deployed in complex heterogeneous infrastructure systems. Some services run on Virtual Machines, some on Windows hosts, and some on Kubernetes. These systems are hosted in data centers located in different regions of the USA and in the public cloud. Services need to connect to other services, irrespective of where they are hosted, to accomplish their tasks. If there were only a handful of services with a few instances each, we might have been able to use a central load balancer for each service. However, our services grew large enough that it was difficult to manage central load balancers. Some services run on 1,000+ instances for better availability and scalability. This is where a Service Mesh comes in.</p><p>A Service Mesh solution can help:</p><ul><li>Service clients discover instances (endpoints) of services — <strong>Service Discovery</strong></li><li>Services are discoverable by its clients — <strong>Service Registration</strong></li><li>Services connect to each other securely — <strong>Service Proxy</strong></li></ul><p>The Service Mesh at Box is implemented using open source components — <a href="https://github.com/airbnb/nerve">Nerve</a>, <a href="https://github.com/airbnb/synapse">Synapse</a>, and <a href="https://github.com/envoyproxy/envoy">Envoy</a>.</p><h3>SmartStack-based Service Mesh Architecture at Box</h3><p>When Box started adopting a Service Mesh, very few mature solutions were available in the market. We adopted Nerve and Synapse from <a href="https://github.com/airbnb">Airbnb</a> and modified them to better integrate with Box infrastructure.</p><p>The three core functionalities of Service Mesh solution are Service Discovery, Service Registry, and Service Proxy. Box uses <a href="https://github.com/airbnb/synapse">Synapse</a>, <a href="https://github.com/airbnb/nerve">Nerve</a>, and <a href="https://www.envoyproxy.io/">Envoy</a> for Service Discovery, Service Registration and Service Proxy, respectively. Synapse and Nerve together is called <a href="https://medium.com/airbnb-engineering/smartstack-service-discovery-in-the-cloud-4b8a080de619">SmartStack</a>. All these components are deployed next to services in the same instances. In Virtual Machines, these are deployed as individual processes, and in Kubernetes Pods they are deployed as sidecar components.</p><p><strong>Synapse</strong>: Synapse is an open source project from <a href="https://github.com/airbnb/">Airbnb</a>. It is used to discover service endpoints and generate the proxy configuration. It runs next to a service as a separate process or sidecar container. The open source version of Synapse can discover endpoints registered with Zookeeper. But, services at Box are deployed on heterogeneous infrastructure systems with most of them on Kubernetes. Synapse is forked locally and enhanced to discover service endpoints from Kubernetes. It is also enhanced to generate Envoy proxy configuration. The open source version generates configuration for <a href="http://www.haproxy.org/">HAProxy</a>, another service proxy. Box migrated from HaProxy to Envoy proxy. But that is a story for another blog! Synapse can simultaneously discover endpoints of multiple services.</p><p><strong>Nerve:</strong> Nerve is another open source project from Airbnb. It is used to register end points of a service to a central location (Zookeeper) so that Synapse can discover from that location. It runs next to a service as a separate process. Nerve is deployed only on Virtual Machines, as Kubernetes provides its own service registry mechanism. Nerve constantly checks the health of a service and updates Zookeeper accordingly. It is also forked locally and enhanced to meet the needs of our Box infrastructure.</p><p><strong>Envoy</strong>: Envoy is a popular service proxy used by most of the Service Mesh solutions. Services connect to other services through Envoy. All traffic goes through the Envoy proxy and it provides better observability of the entire Service Mesh traffic flow. Envoy also provides features like advanced load balancing algorithms, outlier detection, and circuit breaking. It is deployed next to a service as a separate process or a sidecar container.</p><p><strong>Putting It All Together</strong></p><p>Synapse, Nerve, and Envoy proxies work cohesively and make the Service Mesh architecture at Box. These components are deployed next to services on the same machine or Kubernetes pod. Let’s look at some examples to understand how these components work together.</p><p><em>Example 1: Requests from Upload Service to Encryption Service</em></p><p>When the user uploads a file to Box, the upload request passes through Edge, API Gateway, and authentication layers before it reaches Upload Service. All files are encrypted before they are stored in a block storage. Let’s look at how Upload Service discovers and connects to Encryption Service. Although Upload Service can connect to a few other services, for this example let’s look at the connection to Encryption Service.</p><p><em>This assumes Upload Service is deployed on Kubernetes Platform and Encryption Service on a Virtual Machine. The image below shows all steps for Service Registration, Service Discovery, and Service Proxy functionalities of Service Mesh.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N2oawds7OyyjY2pv5FkEGQ.png" /></figure><ol><li>Nerve is running as a separate process next to Encryption Service on the same Virtual Machine. Every couple of seconds, Nerve checks the health of Encryption Service.</li><li>Depending on the health of Encryption Service, Nerve updates the status to Zookeeper. The service endpoint (IP Address of Virtual Machine) is stored as ZNode in Zookeeper against Encryption Service Pool. The service is deployed on multiple instances for better availability and scalability. Nerve running on all instances of the service, updates Zookeeper with its endpoints as ZNodes against the Service Pool. This is the Service Registration functionality of Service Mesh.</li><li>Synapse is running as a sidecar container next to Upload Service. Synapse constantly watches for any changes to ZNodes of Encryption Service in Zookeeper. This is the Service Discovery Functionality of Service Mesh.</li><li>Whenever there is any change to ZNodes (endpoints are added or removed), Synapse generates new Envoy Configuration and writes it to a file. Here, Synapse updates the endpoints configuration (EDS) file for Encryption Service.</li><li>When the EDS file for Encryption Service is updated, Envoy proxy reloads its configuration in-memory and uses the updated endpoints for Service Communication.</li><li>When a user makes an upload request, the Upload Service connects to Encryption Service running on Virtual Machines through Envoy Proxy. This is the Service Proxy functionality of Service Mesh. Envoy load balances requests from Upload Proxy across all the Encryption Service endpoints. It has features like circuit breaking, outlier detection, etc. The connection is established between Envoy Proxies of Upload Service and Encryption Service, and secured by using mTLS.</li></ol><p><em>Example 2: Requests from Download Service to Metadata Service</em></p><p>When a user makes a download request for a file, the Download Service has to connect to file Metadata Service to get more details about the file. Similar to the earlier example, the user request reaches Download Service after going through Edge, API Gateway, and Authentication layers.</p><p><em>For this example let us assume Download Service is deployed on Virtual Machines and Metadata Service on Kubernetes.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ahw-br9_T4Q1N_XelRDi6g.png" /></figure><ol><li>Metadata Service is deployed as multiple replicas in a Kubernetes namespace for Metadata. A <a href="https://kubernetes.io/docs/concepts/services-networking/service/">Kubernetes Service </a>is created for Metadata Service. Kubernetes automatically creates an “Endpoints” resource with all pod endpoints (IP addresses of pods). When any pod is bounced, Kubernetes creates a new Pod with a different IP address. New IPs of Pods are updated in the “Endpoints” resource automatically by Kubernetes. The Service Registration here is performed by Kubernetes. There is no Nerve deployed on Kubernetes Pods.</li><li>Synapse is running as a separate process next to Download Service on the same Virtual Machine. As Metadata Service registers its endpoints to “Endpoints” in Kubernetes, Synapse watches them through Kubernetes API Server. Synapse does Service Discovery from Kubernetes through its API Server.</li><li>The Envoy configuration is updated when there is any change to endpoints of Metadata Service. EDS files of Metadata Service are updated accordingly.</li><li>Envoy Proxy is running as a separate process next to Download Service on the same Virtual Machine. When EDS files are modified, Envoy loads those changes in-memory and uses updated configuration for service communication.</li><li>Similar to the previous example, when a user makes a download request, the Download Service connects to Metadata Service running on Kubernetes through Envoy Proxy. This is the Service Proxy functionality of Service Mesh. Envoy load balances requests from Download Service to Metadata Service instances. The connection is established between Envoy Proxies of Download Service and Metadata Service. This connection is secured with mTLS by Envoy.</li></ol><p>In the two examples above, Envoy is used for ingress and egress traffic by a service. This ensures that all traffic goes through Envoy.</p><p><strong>The Big Picture</strong></p><p>Services and its clients may be deployed on Virtual Machines or Kubernetes. They connect to each other using SmartStack components and Envoy Proxy. There is only one instance of SmartStack components and Envoy Proxy processes next to a service. The same process is used for multiple services discovery and connecting to multiple dependent services.</p><p>For example, Upload Service depends on Encryption Service and Metadata Service. Synapse running next to Upload Service can discover endpoints for Encryption Service from Zookeeper and Metadata Service from Kubernetes API Server. The same Envoy Proxy is used by Upload Service to connect to Encryption Service and Metadata.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DjklAP5PtqyyFbbhWr-Cyw.png" /></figure><p>Nerve is not deployed next to services deployed in Kubernetes as Kubernetes takes care of Service Registry. Synapse and Envoy are deployed next to all services, irrespective of where they are deployed. The connection between services is secured with mTLS between Envoy Proxies on either side of all services. This eliminates the need for individual services to encrypt or decrypt data in transit. Envoy provides extensive observability into the traffic going through the entire infrastructure.</p><p>We can track information like:</p><ul><li>Bytes in and bytes out of a service — this helps us in scaling services</li><li>Errors from individual services — this helps with debugging issues faster<br>– 5xx errors<br>– 4xx errors<br>– Timeout errors</li><li>Number of requests between services</li><li>Request latencies between services</li></ul><p><strong>Static Control Plane</strong></p><p>Unlike other Service Mesh solutions, the SmartStack based Service Mesh Solution at Box doesn’t have a dedicated control plane. The responsibility of Control Plane is to manage Service Mesh components and propagate appropriate mesh configuration to them. We achieve similar functionality with Source Control systems at Box.</p><p>The mesh configuration on Virtual Machines is maintained using <a href="https://puppet.com/">Puppet</a>. The mesh configuration for Kubernetes is maintained in our GitHub Enterprise repository. <a href="https://github.com/box/kube-applier">Kube Applier</a>, an open source component from Box, is deployed on each Kubernetes Cluster. It will make sure that Kubernetes manifests are applied to all resources in Kubernetes. Sometimes developers may change the mesh configuration of any service on individual Virtual Machines or any Kubernetes Cluster. This can also happen due to some faulty nodes or processes. Puppet agents and Kube applier checks configurations periodically on local instances. If there is any mismatch with master repos, the configuration is synchronized from the master.</p><h3>Pain Points with SmartStack-based Service Mesh</h3><p>As Box continues to grow and add more features, our internal infrastructure is also growing. The load on our infrastructure has increased due to more services and more traffic with growth in business. With this, we’ve started seeing some issues with our Service Mesh Solution.</p><p>Here are few of them:</p><ol><li>Synapse, Nerve and Envoy are running next to services. As services scaled, the load on those components also increased. We needed to provide more resources to Service Mesh components. To scale micro services horizontally, we needed to increase the instances of services. This added more load on Synapse, as it had to discover all those instances. At some point, Synapse was difficult to scale.</li><li>Synapse and Nerve are forked locally to add more features to them. It has become hard to rebase with upstream code. Also, there is no new development going on with those Open Source projects.</li><li>When any new service is onboarded to SmartStack-based Service Mesh, it becomes less easy to deploy Service Mesh components. To enable mTLS between services, required certificates are created using internal PKI service. As services and its dependencies grew, it became hard to maintain and create certificates.</li><li>The Service Mesh configuration is maintained in two repos (Puppet and GitHub), depending on where services are deployed. It has become difficult to maintain consistent configuration between these repos.</li><li>The mesh configuration has become complex over time. If we want to rollout a common configuration change to all services, it takes more than 3 weeks to rollout the change. The slow rollout ensures that live traffic is less affected while applying those changes to services. The canary rollout process has become complex.</li><li>When we need to upgrade any of the Service Mesh components, it takes more than 3 weeks to upgrade them across the entire mesh. If a new version of any Service Mesh component has a complex change, which requires restarting the process, it may take more than 4 weeks to rollout such changes. For example, when we upgraded Envoy configuration from V2 to V3, it took more than 8 weeks to rollout across the mesh.</li><li>In Kubernetes, any small change to Service Mesh configuration of a service requires its pods to bounce. Some services are more sensitive to restarts, requiring us to exclude them from those changes. This makes it difficult to modify Service Mesh configuration for those services. Due to this we have multiple versions of mesh configurations in the repo.</li><li>Services are deployed on multiple data centers for better availability. We need to enable Service Mesh so that services can be discovered and connected across data centers. This configuration varies from service to service and adds more complexity to the Service Mesh configuration.</li></ol><p>Considering the above pain points, we started exploring alternate Service Mesh solutions.</p><h3>NextGen Service Mesh at Box</h3><p>Box is running on a heterogeneous infrastructure. We have services deployed on Virtual Machines and Kubernetes, across multiple data centers and public cloud. When we started exploring a potential Service Mesh solution, we needed something that supported our current infrastructure and also enabled us to migrate seamlessly from SmartStack-based Service Mesh.</p><p>These factors were considered while deciding our NextGen Service Mesh solution:</p><ul><li>Where application services are hosted<br>– Kubernetes or any containerized orchestration platform<br>– Virtual Machines<br>– On Prem or Public Cloud</li><li>Extensibility<br>– Public Cloud integration<br>– Multi-cluster mesh<br>– Mesh expansion to VMs and containers</li><li>Resiliency features<br>– Circuit breaking<br>– Retries and timeouts<br>– Fault injection</li><li>Security Features</li></ul><p><a href="https://servicemesh.es/">https://servicemesh.es/</a> helped us in deciding the right Service Mesh solution. With multiple iterations of research, we ended up selecting <a href="https://istio.io/">Istio</a> to build our NextGen Service Mesh at Box. We’re already seeing a few interesting patterns, benefits and complexities with the migration. Stay tuned for more details in the next series of blogs.</p><p><em>Interested in learning more about Box? We are hiring. Checkout our </em><a href="https://careers.box.com/c/engineering-jobs"><em>careers page</em></a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d792cc62f8d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-tech-blog/service-mesh-box-d792cc62f8d1">Service Mesh @Box</a> was originally published in <a href="https://medium.com/box-tech-blog">Box Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>