VOOZH about

URL: https://thenewstack.io/how-ebpf-streamlines-the-service-mesh/

⇱ How eBPF Streamlines the Service Mesh - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2021-10-25 06:50:08
How eBPF Streamlines the Service Mesh
contributed,
Cloud Native Ecosystem / eBPF / Networking / Service Mesh

How eBPF Streamlines the Service Mesh

Let’s explore how eBPF allows us to streamline the service mesh, making the data plane more efficient and easier to deploy. 
Oct 25th, 2021 6:50am by Liz Rice
👁 Featued image for: How eBPF Streamlines the Service Mesh

There are several service mesh products and projects today, promising simplified connectivity between application microservices, while at the same time offering additional capabilities like secured connections, observability, and traffic management. But as we’ve seen repeatedly over the last few years, the excitement about service mesh has been tempered by practical concerns about additional complexity and overhead. Let’s explore how eBPF allows us to streamline the service mesh, making the service mesh data plane more efficient and easier to deploy.

The Sidecar Problem

Today’s service mesh solutions for Kubernetes require you to add a proxy sidecar container such as Envoy or Linkerd-proxy to every single application pod. That’s right: even in a very small environment with, say, 20 services, each running five pods, spread across three nodes, you’ve got 100 proxy containers. However small and efficient the proxy implementation is, the sheer repetition is going to cost resources.

The memory used by each proxy increases in relation to the number of services that it needs to be able to communicate with. Pranay Singhal wrote about his experiences configuring Istio to reduce consumption from around 1GB per proxy (!) to a much more reasonable 60-70MB each. But even in our small, imaginary environment with 100 proxies on three nodes, this optimized configuration still needs around 2GB per node.

👁 Image

From redhat.com/architect/why-when-service-mesh — every microservice has its own proxy sidecar

Why do we need all these sidecars? This model allows a proxy container to share a network namespace with the application container(s) in the pod. Network namespaces are the Linux kernel constructs that allow containers and pods to have their own independent network stacks, isolating containerized applications from each other. This keeps applications out of each others’ way, and it’s why, for example, you can have as many pods as you like running a web app on port 80 — the network namespaces mean they each have their own port 80. The proxy has to share the same network namespace so that it can intercept and act on traffic to and from the application containers.

Enter eBPF

eBPF is a kernel technology that allows custom programs to run in the kernel. Those programs run in response to events, and there are thousands of possible events to which eBPF programs can be attached. These events include tracepoints, the entry to or exit from any function (in kernel or user space) or — importantly for service mesh — the arrival of network packets.

Importantly, there is only one kernel per node; all the containers (and hence all the pods) running on a node share the same kernel. If you add an eBPF program to an event in the kernel, it will be triggered regardless of which process caused that event, whether it’s running in an application container or even directly on the host.

This is why eBPF is such an exciting technology for any kind of instrumentation in Kubernetes — you only need to add the instrumentation once per node, and all the application pods will be covered. Whether you’re looking for observability, security or networking, eBPF-powered solutions can instrument applications without the need for a sidecar.

The eBPF-based Cilium project (which recently joined the Cloud Computing Foundation at Incubation level) brings this “sidecarless” model to the world of service mesh. As well as the conventional sidecar model, Cilium supports running a service mesh data plane using a single Envoy proxy instance per node. Using our example from earlier, this reduces the number of proxy instances from 100 to just three.

Less YAML

Liz Rice
Liz Rice is the Chief Open Source Officer at Isovalent and Chair of the Technical Oversight Committee at the Cloud Native Computing Foundation.

In the sidecar model, the YAML that specifies every application pod needs to be modified to add the sidecar container. This is usually automated – for example, using a mutating webhook to inject the sidecar at the point each application pod is deployed.

In Istio, for example, this requires labeling the Kubernetes namespace and/or pod to define whether the sidecar should be injected — and of course it requires mutating webhooks to be enabled for the cluster.

But what if something goes wrong? If a namespace or pod is incorrectly labeled, the sidecar won’t be injected and the pod will not be connected to the service mesh. And worse, if an attacker compromises the cluster and is able to run a malicious workload — say, a crypto-currency miner — they will be unlikely to label it so that it participates in the service mesh. It won’t be visible through the traffic observability that the service mesh provides.

In contrast, in the eBPF-enabled, sidecarless proxy model, the pods do not need any additional YAML in order to be instrumented. Instead, a CRD is used to configure the service mesh on a cluster-wide basis. Even pre-existing pods can become part of the service mesh without needing a restart!

If the attacker attempts to bypass Kubernetes orchestration by running the workload directly on the host, eBPF programs can see and control this activity, because it is all visible from the kernel.

eBPF-Enabled Network Efficiency

Eliminating sidecars isn’t the only way that eBPF optimizes a service mesh. eBPF-enabled networking allows packets to take short-cuts that bypass parts of the kernel’s network stack, and this can lead to significant performance improvements in Kubernetes networking. Let’s see how this applies in the service mesh data plane.

👁 Cilium directly connects the app to the node-based proxy on the host

Network packets travel through a much shorter path in the eBPF-accelerated, sidecarless proxy model for service mesh

In the case of service mesh, with the proxy running as a sidecar in a traditional network, the path a packet has to take to reach the application is pretty tortuous: an inbound packet has to traverse the host TCP/IP stack to reach the pod’s network namespace via a virtual Ethernet connection. From there, the packet has to go through the pod’s network stack to reach the proxy, which forwards the packet through the loopback interface to reach the application. Bearing in mind that traffic has to flow through a proxy at both ends of the connection, this results in significant increases in latency compared to non-service mesh traffic.

An eBPF-based Kubernetes CNI implementation such as Cilium can use eBPF programs, judiciously hooked into specific points in the kernel, to redirect the packet along a much more direct route. This is possible because Cilium is aware of all the Kubernetes endpoints and service identities. When a packet arrives on the host, Cilium can dispatch it straight to the proxy or pod endpoint to which it is destined.

Encryption in the Network

Given a networking solution that is aware of Kubernetes services, and provides networking connectivity between the endpoints of those services, it is not surprising that it can offer the capabilities of a service mesh data plane. But these capabilities can go beyond basic connectivity. One example is transparent encryption.

It’s common to use a service mesh to ensure that all application traffic is authenticated and encrypted. This is achieved through mutual TLS (mTLS); the service mesh proxy component acts as the end-point for the network connection, and negotiates a secure TLS connection with its remote peer. This connection encrypts traffic between the proxies, without having to make any changes at all to the application.

But TLS, managed at the application layer, is not the only way to achieve authenticated and encrypted traffic between components. Another option is to encrypt traffic at the network layer, using IPSec or WireGuard. Because it operates at the network layer, this encryption is entirely transparent not only to the application but also to the proxy — and it can be enabled with or without a service mesh. If your only reason for using a service mesh is to provide encryption, you may want to consider network-level encryption. Not only is it simpler, but it can also be used to authenticate and encrypt any traffic on the node — it is not limited to only those workloads that are sidecar-enabled.

eBPF is the Data Plane for the Service Mesh

Now that eBPF is widely supported in the kernel versions used in Linux production distributions, enterprises can take advantage of it for a more efficient networking solution, and as a more efficient data plane for service mesh. Solo.io described this at the recent ServiceMeshCon as “Super Charging your Service Mesh with eBPF”.

Last year I made some predictions, on behalf of the CNCF’s Technical Oversight Committee, about consolidation and clarity in the area of service mesh. In the same keynote, I covered the likelihood of eBPF becoming the basis for more projects and for more widely deployed capabilities. These two ideas are now coming together, as eBPF appears to be the natural path for the service mesh data plane.

TRENDING STORIES
Liz Rice is Chief Open Source Officer at Isovalent, and chair of the CNCF’s Technical Oversight Committee.
Read more from Liz Rice
SHARE THIS STORY
TRENDING STORIES
The Cloud Native Computing Foundation is a sponsor of The New Stack.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.