You are on page 1of 7

A Comparative Study between Service Mesh and

standalone Kubernetes
Ameya Deshpande, Shuddhatm Choudhary, B. R. Chandavarkar

Department of Computer Science and Engineering


National Institute of Technology Karnataka
Surathkal, Mangalore, India
ameyanrd@gmail.com, choudhary.shuddhatm@gmail.com, brcnitk@gmail.com

Abstract—Kubernetes and Service Mesh are platforms Kubernetes cluster is one of the services provided by
for automating, scaling, and managing complex application cloud vendors. Kubernetes handles problems arising due
deployments and workloads. One can face many issues to a trendy architectural style called Microservices [1].
during application deployment like scaling the instances, As opposed to the old monolithic style, Microservices
rolling out new updates, health monitoring of every in-
delivers the ability to develop large software by breaking
stance, and so on. Along the continuous process of develop-
ment, the application grows more complex and even harder
into smaller services that can be deployed, scaled, and
to manage. Kubernetes and Service Mesh Kubernetes maintained independently by fully automated deploy-
are some of the container orchestration platforms which ment machinery. Microservices address the drawbacks
help with such issues and provide a better controlling of monolithic architecture and thus make scaling and
interface. In this paper, we present a study on the use deployment more flexible and efficient.
of Service Mesh Architecture and compare its advantages The issue with Microservices was to handle the de-
and disadvantages with Kubernetes. The paper begins ployment of many smaller services [2]. Some prob-
by explaining Microservices and their benefits. Then it lems were port collision among the services, unexpected
mentions the operational issues with Microservices and
service crashes, or the server machine’s security. The
suggests Orchestrators like Kubernetes as a solution. Fur-
thermore, we see Kubernetes architecture, the limitations virtualization technique can solve these problems. The
of Kubernetes, the role of Service Mesh and Service Mesh services can run in isolated environments like Virtual
architecture. The paper also focuses on additional features Machines or Containers, allowing the service to have
provided by Service Mesh. Finally, we study Istio Service its networking stack, so no port collision, unexpected
Mesh and conclude the circumstances under which an crash analysis and easy restarting of the application, and
operations team should go for Kubernetes or Service Mesh enhanced security due to its isolated environment.
Kubernetes. One of the other problems while adopting the Mi-
croservices pattern is the management of multiple mi-
I. I NTRODUCTION
croservices. This management can be in the form of elas-
During the past decade, the software industry has ticity, health checks, and software updates. Here comes
witnessed a rapid migration towards the cloud. Cloud the significant role of Kubernetes as an orchestrator.
computing makes it easier for businesses and enterprises Kubernetes handles microservices in the form of contain-
to focus on their application logic while taking care ers. Containers are light-weight and easily manageable
of all the infrastructure and platform necessities. One via Docker tools, making them an obvious choice over
of the main reasons is that the cloud providers give a Virtual Machines. Kubernetes is a popular container
wide range of services on their infrastructure, making orchestration tool that enables automated deployment,
the job easier for the customers. One of the problems scaling, and containerized applications [3].
that customers face is regarding the deployment of their Service Mesh is an infrastructure solution used on the
applications. Cloud platforms provide various solutions top of Kubernetes to ensure reliability, enhance security,
to this problem, enabling them to have a highly avail- and monitor containerized microservices [4]. We’ll see
able and geographically distributed cluster of application how Kubernetes and Service Mesh Kubernetes work and
instances. conclude the best-suited solution for a microservices
application. Figure 1 shows one example of how the service-side
In this paper, we start by looking into Microservices application is broken down into different independent
and their benefits. Further, we explore the operational components. The application is broadly divided into
issues with Microservices and suggest Orchestrators like frontend, backend and database. There are two types
Kubernetes as a solution. Furthermore, we see Kuber- of frontend, one is via the API gateway and other is
netes architecture, the limitations of Kubernetes, the role web frontend. The backend functionality is divided into
of Service Mesh and Service Mesh architecture. Finally, Account, Inventory and shipping services. Each service
we consider a case study on Istio Service Mesh and con- is connected to a database service of the respective type.
clude the circumstances under which an operations team Note that this is a small scale division into microser-
should go for Kubernetes or Service Mesh Kubernetes. vices. In large-scale deployments, there are thousands
of microservices and thousands of instances of these
II. M ICROSERVICES microservices.
Microservices is one of the popular architectural
styles, developed a few years back. In general, it over- C. Achieving Balance
comes the problem faced with the development and Organizations and Enterprises generally work on large
deployment of a monolithic application. A monolithic and complex applications. Microservices architecture can
application refers to an application having multiple large help them to write high-quality code, easy development,
and small components deployed in the same instance. and independent deployment. While this sounds feasible,
This monolithic development seems plausible for small many issues arise when the number of Microservices
scale and basic applications. However, as the number of increases. Each microservice has several instances. Some
functionality increases and the people working on them microservices depend on other microservices; the ge-
increase, it is best to divide and conquer independently. ographical distribution of the microservices should be
uniform, abruptly closed instances should be checked,
A. Microservices Architecture application load should be monitored to scale up and
According to [1] and [5], Microservices is an architec- down the number of instances, etc.
tural style that structures an application as a collection
III. U NDERSTANDING K UBERNETES
of services that are:
• Highly maintainable and testable Kubernetes is an open-source platform that helps in
• Loosely coupled managing multiple container instances. According to
• Independently deployable [3], ”Kubernetes is a portable, extensible, open-source
• Organized around business capabilities platform for managing containerized workloads and ser-
• Owned by a small team vices, that facilitates both declarative configuration and
automation.” Here, the declarative configuration refers
B. Microservices Example to using a manifest file that stores the configuration of
the deployment. Kubernetes allows for automation in the
form of CI/CD, i.e. writing builds and tests
A. Kubernetes Architecture
Kubernetes works on a cluster of machines configured
according to the Kubernetes architecture. Many cloud
providers provide an automated Kubernetes cluster, but
it can be bootstrapped from scratch. Following is a brief
on Kubernetes cluster architecture and its elements.
Figure 2 shows a glance at the components of the
Kubernetes cluster. A pod consists of containerized ap-
plications. The Control Plane of Kubernetes manages the
worker nodes and pods in turn.
• Cluster: A Kubernetes cluster consists of a set of
worker nodes that host pods of application workload
Fig. 1. Microservices Example Application [6] and a Control Plane.
Fig. 2. Kubernetes Components [3]

• Pod: A pod is a way of representing the running cluster and kube-dns information.
process in a cluster. A pod encapsulates one or more • kube-scheduler: Watches the changes for newly
containers. It provides a unique network IP, attaches created pods with no assigned nodes, and selects a
storage resources, and also decides how containers node for them to run on. It assigns unassigned pods
should run. Everything in a Pod is tightly coupled. to the node which has available resources (CPU and
• Node: A node is nothing but a single host, which is memory) marching Pod requiremnets.
used to run virtual or physical machines. A node in • kube-controller-manager: Manages the controller
the Kubernetes cluster is also known as a minion. processes within the Control Plane. Control plane
• Service: A logical set of pods, which works to- controller is a single program logically divided into
gether. With the help of services, users can easily separate processes to reduce the complexity.
manage load balancing configurations.
• ReplicaSet: identifies the particular number of pod
replicas are running at a given time. It replaces the Node Components [3] (Refer Figure 1):
replication controller because it is more powerful
and allows users to use the ”set-based” label selec-
tor. • kubelet: An agent that runs on each node of the
cluster and makes sure that containers are running
Control Plane Components [3] (Refer Figure 1):
on its pods. It checks whether the assigned pods
• kube-apiserver: Front end for the Kubernetes Con- are running on the node or not. If a new Pod is
trol Plane. It is the central component of a Kuber- assigned to the node Kubelet is running on, it will
netes cluster and it runs on the master node.All pull the Pod definition and use it to create containers
other components interact with API server and through Docker or any other supported container
keep watch for changes. Most of the coordination engine.
in Kubernetes consists of a component writing to • kube-proxy: Kube-proxy maintains the network
the API Server resource that another component is rules on the nodes. These rules allow for internal
watching. The second component will then react to communication from pod to pod and pod to service,
changes almost immediately. and external communication (outside the cluster).
• etcd: A distributed, consistent and highly available • Container Runtime: Responsible for running con-
key-value store which stores the desired state of the tainers within the pods.
IV. S ERVICE M ESH : K UBERNETES AND BEYOND Canary deployment keeping the older version container
A. Limitations of Kubernetes applications intact. Gradually, the deployment instances
of the new version are increased, and older version
Although Kubernetes is one of the best orchestrator instances are decreased. Finally, the newer version de-
tools to add reliability and observability, it is helpful only ployment takes place.
up to one point. Once the number of microservices in
an application reach a limit, the Kubernetes approach of
C. Service Mesh Architecture
management becomes non-sustainable [7]. This is where
Service Mesh comes in. There are several Service Mesh implementations out
With Kubernetes, as the number of microservices be- there like Istio, Linkerd, etc., all of which share some
comes large, it becomes difficult to monitor the deploy- core features. Service Mesh architectural features are
ments, trace, and diagnose any possible issues. There is designed to fulfil their goal of improving resiliency,
no metric system to monitor the cluster. Along with this, observability and discoverability across the large number
Kubernetes internal communication unencrypted, and of microservices.
there are no authorization policies for communication Service Mesh comprises of two logical planes [7], [8]:
and data access. the Control Plane and the Data Plane.
The Data Plane consists of sidecars that run alongside
B. Service Mesh Introduction
the containers. The sidecars form a gateway or proxy
Service Mesh is a dedicated infrastructure layer built for all communications from and to the application
on top of container orchestrators like Kubernetes to add containers. This allows the Service Mesh to control
more reliability, security and, most importantly, observ- and monitor traffic for different microservices without
ability. Service Mesh has been around before Kubernetes knowing the application functionality explicitly.
and has developed over the years with the development The Control Plane is an out-of-band functionality layer
of Kubernetes. as opposed to in-band sidecars of the Service Mesh. It
Service Mesh was designed for microservices systems issues TLS certificates, responsible for configuring the
which heavily reliant on the network. Service mesh proxy configurations, and enforces policies to collect
manages the traffic between different services. The ar- telemetry and expose metrics. The Control Plane pro-
chitecture allows for a graceful and scalable way of vides tools for controlling the Data Plane elements, often
introducing various services and monitoring them. using GUI, API and CLI.
Service Mesh features [7]: Figure 3 shows a general traffic overview of a produc-
• Service Discovery: Discovering how to connect to tion application. Blue arrows represent the North-South
a particular service. This feature is leveraged from traffic that comes inside via the Ingress Gateway and
Kubernetes. An additional cache is added in the goes via an Egress Gateway. Red arrows represent the
sidecars to store the results of the Service Discovery East-West traffic which describes the inter-service com-
• Load Balancing: Load balancing the incoming re- munication traffic. The application consists of a Frontend
quests over different pods based on several kinds of that contacts the Backend for a particular operation. Now,
metrics. the Backend refers to some external APIs via the Egress
• Communication Resiliency: This enables retrying Controller and the Database. This can be considered a
for timeout requests, circuit braking and rate limit- general overview of a deployment and traffic overflow.
ing. Let’s consider using Kubernetes to manage traffic
• Security: It provides end-to-end encryption between overview in Figure 3. One of the issues here will be
different microservices and authorization policies, that the Backend and Database connection will not
to say the database, etc. be encrypted, making it available for the adversary to
• Observability: Get Layer 7 metrics like HTTP 500 sniff data. One way to avoid this would be for your
or 404, tracing and alerting based on layer 7 metrics. operations team to issue those certificates and integrate
• Routing Control: Traffic shifting at the application them into the application and database. Service Mesh
level and mirroring. helps to automate the whole process and provide end-
In a Service Mesh model, application updates work to-end encryption for all the services.
similarly in incase of standalone Kubernetes. An updated Another issue using Kubernetes in Figure 3 is that,
version of the application microservice is released as a say there is some latency at the Frontend than expected,
Fig. 3. Traffic Overflow [4]

Fig. 4. Service Mesh Traffic Overflow [4]

finding the pod or service causing the problem is diffi- usage. Still, unfortunately, Kubernetes cannot perform
cult. Service Mesh helps to solve this issue by enabling load balancing based on the number of HTTP requests.
to trace the problematic service or pod. Service Mesh helps with this kind of load balancing.
In Figure 3, say we to load balance the traffic from The same metric can be used to scale the application
Frontend to Backend. Here, we want the new request to pods. Service Mesh implementation also helps in scaling
hit the instance having less number of requests currently. according to the HTTP requests per second per pod.
In general, the Kubernetes HPA controller will help Figure 4 shows the Service Mesh traffic overflow.
in load balancing based on CPU usage or memory Here, a sidecar proxy like Nginx or Envoy is injected
into the Frontend, Backend and Database pods. These high-level routing rules into Envoy-specific con-
sidecars will be configured with TLS certificates to have figurations and propagates them to the sidecars at
end-to-end encryption. The advantage here is that the runtime. Istiod security enables strong service-to-
application doesn’t have to know about TLS, and the service and end-user authentication with built-in
sidecars handle everything. identity and credential management.
Sidecars help in tracing problematic regions as well.
V. C ONCLUSION : K UBERNETES OR S ERVICE M ESH
All traffic is routed in and out of the pod via its in-band
K UBERNETES
sidecar. This allows the sidecars to attach tracing headers
to find time-consuming places. The frontend pod sidecar Kubernetes is one of the most popular solutions used
can attach the tracing label to the request and route to by enterprises for their applications. We have seen that
the backend, and the backend pod can attach its label Service Mesh provides a solution to the problems leading
after the processing to the response message. to the increased number of microservices. Using Service
Mesh Kubernetes solves the issue of whether the number
D. Case Study – Istio of microservices is high or low. However, customers
tend to use Kubernetes more often than Service Mesh
Istio is a popular open platform Service Mesh technol- Kubernetes. This is true even for a reasonably high
ogy that is experiencing dynamic growth. It is an open number of microservices as well.
platform to connect, manage and secure microservices. One of the main reasons for using Kubernetes over
It was founded in 2017 in association with Google, Service Mesh Kubernetes is the complexity involved
IBM and Lyft, and is widely adopted in the Kubernetes in implementing a Service Mesh. The operations team
community. needs to understand and take care of the additional
Istio is considered to be one of the best implementa- components and deal with all the related issues. So, im-
tions of Service Mesh at this point. It enables the deploy- plementing Service Mesh requires adding new elements
ment of complex microservices and provides behavioural that add new functionality and complexity issues.
insights and operational control over the Service Mesh. Service Mesh implementations like Istio and Linkerd
Some of the complex operational tasks Istio helps with try to reduce the complexity of these deployments and
are A/B testing, Canary rollouts, rate limiting, access eases the operations teams’ strain. Also, these implemen-
control and end-to-end authentication. tations help Kubernetes users to migrate to Service Mesh
Istio provides additional capabilities to the microser- Kubernetes with ease.
vices implementation like intelligent routing, load bal- It is best to identify the application’s scale in terms
ancing, service discovery, policy enforcement, in-depth of the microservices and their deployments and decide
telemetry, circuit breaking and retry functionalities, log- which solution to pick. If the number of microservices
ging, monitoring, and more. is very high, one can go for standard Service Mesh
1) Istio Architecture: Istio Service Mesh consists of implementations to ease out control and management.
a Data Plane and Control Plane. The Data Plane consists However, the additional benefits of Service Mesh like
of Envoy deployed as the in-band sidecars [10]. These load balancing, service discovery, policy enforcement,
proxies control all network communications between in-depth telemetry and retry functionalities, logging,
different microservices. They also collect and report monitoring, etc., make the adoption more likely provided
telemetry on the mesh traffic. they pick standard implementations, and the operations
Figure 5 shows different components of Istio Service team is qualified to understand any complexity arising
Mesh. Following is a brief on the components of Istio’s out of it.
core [3]: [1]–[17]
• Envoy: Envoy is a high-performance proxy devel- R EFERENCES
oped to mediate all inbound and outbound traffic for
[1] A. Sill, The Design and Architecture of Microservices, https:
Service Mesh services. Envoy proxies are deployed //ieeexplore.ieee.org/abstract/document/7742259/ (2016).
as sidecars to services. The sidecar deployment [2] A. L. L. M. M. F. M. R. M. L. S. Nicola Dragoni, Save-
allows Istio to enforce policy decisions and extract rio Giallorenzo, Microservices: Yesterday, Today, and To-
morrow, https://link.springer.com/chapter/10.1007/978-3-319-
telemetry to monitor and generate alerts.
67425-4 12 (2017).
• Istiod: Istiod provides service discovery, configu- [3] K. Hightower, Kubernetes Documentation, https:
ration and certificate management. Istiod converts //kubernetes.io/docs/home (2020).
Fig. 5. Istio Architecture [9]

[4] S. Prodan, T. Nakahara, Intro to Service Meshes and Progressive architecture fig1 320248964 (2018).
Delivery, https://www.weaveworks.works (2019). [12] D. M. D. P. C. F. Ozair Sheikh, Serjik G Dikaleh, Mod-
[5] N. A. Nuha Alshuqayran, R. Evans, A Systematic Map- ernize digital applications with microservices management us-
ping Study in Microservice Architecture, https://core.ac.uk/ ing the istio service mesh, https://dl.acm.org/doi/abs/10.5555/
download/pdf/188256155.pdf (2014). 3291291.3291339 (2018).
[6] C. Richardson, Microservice Architecture, https: [13] Z. B. Ramaswamy Chandramouli, Building Secure
//microservices.io (2020). Microservices-based Applications Using Service-Mesh
[7] J. G. Z. Z. Wubin Li, Yves Lemieux, Y. Han, Service Mesh: Architecture, https://doi.org/10.6028/NIST.SP.800-204A
Challenges, State of the Art, and Future Research Opportunities, (2020).
https://ieeexplore.ieee.org/document/8705911 (2019). [14] U. Z. Amine El Malki, Guiding Architectural Deci-
[8] K. Indrasiri, P. Siriwardena, Service Mesh: Designing, sion Making on Service Mesh Based Microservice Archi-
Developing, and Deploying, https://www.researchgate.net/ tectures, https://link.springer.com/chapter/10.1007/978-3-030-
publication/328946942 Service Mesh Designing 29983-5 1 (2019).
Developing and Deploying (2018). [15] Z. B. Lee Calcote, Istio: Up and Running: Using
a Service Mesh to Connect, Secure, Control, and
[9] M. T. F. K. Leila Abdollahi Vayghan, Mohamed Aymen Saied,
Observe, https://www.oreilly.com/library/view/istio-up-
Deploying Microservice Based Applications with Kubernetes:
and/9781492043775/ch01.html (2020).
Experiments and Lessons Learned, https://ieeexplore.ieee.org/
[16] N. C. M. J. L. S. T. Pooyan Jamshidi, Claus Pahl, Mi-
abstract/document/8457916 (2018).
croservices: The Journey So Far and Challenges Ahead, https:
[10] M. Jösch, Ronja, Managing Microservices with a Service Mesh:
//ieeexplore.ieee.org/abstract/document/8354433/ (2018).
An implementation of a service mesh with Kubernetes and
[17] J. B. U. A. Vı́ctor Medel, Omer F Rana, Modelling perfor-
Istio, https://www.diva-portal.org/smash/record.jsf?pid=diva2%
mance resource management in kubernetes, https://dl.acm.org/
3A1464891&dswid=3240 (2020).
doi/abs/10.1145/2996890.3007869 (2016).
[11] C. . A. U. . T.-C. R. . B. J. . R. O. Medel, Vı́ctor Tolón,
Client-side scheduling based on application characterization
on kubernetes, https://www.researchgate.net/figure/Kubernetes-

You might also like