Istioexplained Preview Final2 73028873USEN PDF
Istioexplained Preview Final2 73028873USEN PDF
Istioexplained Preview Final2 73028873USEN PDF
m
pl
im
en
ts
of
Istio
Explained
Getting Started with Service Mesh
Preview
Edition
REPORT
Run Istio on the IBM Cloud to connect, manage and
secure microservices at scale. Explore tutorials,
sample code and tech talks to learn more.
ibm.biz/oreilly-istio-tech
Istio Explained
Getting Started with Service Mesh
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Istio Explained,
the cover image, and related trade dress are trademarks of O’Reilly Media, Inc.
The views expressed in this work are those of the authors, and do not represent the
publisher’s views. While the publisher and the authors have used good faith efforts
to ensure that the information and instructions contained in this work are accurate,
the publisher and the authors disclaim all responsibility for errors or omissions,
including without limitation responsibility for damages resulting from the use of or
reliance on this work. Use of the information and instructions contained in this
work is at your own risk. If any code samples or other technology this work contains
or describes is subject to open source licenses or the intellectual property rights of
others, it is your responsibility to ensure that your use thereof complies with such
licenses and/or rights.
This work is part of a collaboration between O’Reilly and IBM. See our statement of
editorial independence.
978-1-492-07393-2
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
iii
Preface
v
incremental approach to teaching you how to adopt a service mesh
like Istio, our goal being to set you up for gradual adoption so you
can see benefits as quickly as possible.
Why Istio?
While there are many service mesh options to choose from, as you’ll
see in Chapter 1, we are personally most familiar with Istio and so
chose to illustrate the benefits service mesh can offer through Istio’s
features. We encourage you to use the information we provide in
this book to evaluate and choose the right solution for your needs.
Prerequisites
The working examples in the book build on Kubernetes for manag‐
ing the sample’s containers and Kubernetes serves as the platform
for Istio itself. To get the most out of the working examples, it would
be helpful for you to have a basic understanding of Kubernetes. To
get quickly up to speed, we recommend that you check out this
Kubernetes tutorial: Kubernetes 101. As with any adoption process
of a new technology, you are likely to run into trouble with configu‐
ration or setup. We provide a chapter that introduces techniques and
commands that may help you troubleshoot issues that you may
encounter on your journey to adopt service mesh.
vi | Preface
CHAPTER 1
Introduction to Service Mesh
In this chapter we explore the notion of a service mesh and the vast
ecosystem that has emerged in support of service mesh solutions.
Organizations face many challenges when managing services espe‐
cially in a cloud-native environment. We are introducing service
mesh as a key solution on your cloud-native journey because we
believe that a service mesh should be a serious consideration for
managing complex interactions between services. An understanding
of service mesh and its ecosystem will help you choose an appropri‐
ate implementation for your cloud solution.
7
2. Traffic management at depth becomes more important to
enable specialized routing for A/B or canary deployments
without impacting clients within the system.
3. Securing communication by encrypting the data flows is more
complicated when the services are decoupled and not part of the
same binary process.
4. Managing timeouts and communication failures between the
services can lead to cascading failures and is more complicated
to get correct when the services are distributed.
Many of these challenges can be resolved directly in the services
code. However, adjusting the service code puts a massive burden on
you to properly code solutions to these problems and it requires
each microservice owner to agree on the same solution approach to
assure consistency. Solutions to these types of problems are complex
and it is extremely error prone to rely on application code changes
to provide the solutions. Removing the burden of codifying solu‐
tions to these problems is a primary reason we have seen the intro‐
duction of the service mesh.
Envoy
Envoy proxy is an open source project originally created by the folks
at Lyft. Envoy proxy is an edge and service proxy that was custom
built to deal with the complexities and challenges of cloud native
applications. While Envoy itself does not constitute a service mesh,
it is definitely a key component of the service mesh ecosystem. What
you will see from exploring the service mesh implementations is that
the client-side proxy from the reference architecture in Figure 1-1 is
often implemented using an Envoy proxy.
Envoy is one of the six Graduated projects in the Cloud Native
Computing Foundation (CNCF). The CNCF is part of the Linux
foundation and it hosts a number of open source projects that are
used to manage modern cloud native solutions. The fact that Envoy
is a CNCF graduated project is an indicator that it has a strong com‐
munity with adopters using Envoy proxy in production settings.
Istio
The Istio project is an open source project co-founded by IBM and
Google in 2017. Istio makes it possible to connect, secure, and
observe your microservices while being language agnostic. Istio has
grown to have contributions beyond just IBM and Google with con‐
tributions from VMware, Red Hat, and Aspen Mesh. Figure 1-3
shows the company contributions over the past twelve months using
the CNCF DevStats tool. The recent open-source project named
Knative builds upon Istio as well to provide tools and capabilities to
build, deploy, and manage serverless workloads. At the time of writ‐
ing this book, Istio was not contributed to the Cloud Native Com‐
puting Foundation (CNCF) but many of the components that Istio
uses are in the CNCF such as Envoy, Kubernetes, Jaeger, and Prome‐
theus. Istio is listed as part of the CNCF Cloud Native Land‐
scape under the Service Mesh category.
The Istio control plane extends the Kubernetes API server and uti‐
lizes the popular Envoy proxy for its client-side proxies. Istio sup‐
ports mTLS communication between services, traffic shifting, mesh
gateways, monitoring and metrics with Prometheus and Grafana, as
well as custom policy injection. Istio has installation profiles such as
demo and production to make it easier to provision and configure
the Istio control plane for specific use cases.
Consul Connect
Consul Connect is a service mesh that is developed by Hashicorp.
Consul Connect extends Hashicorp’s existing Consul offering which
has service discovery as a primary feature as well as other built-in
features such as a key-value store, health checking, and service seg‐
mentation for secure TLS communication between services. Consul
Connect is available as an open-source project with Hashicorp itself
being the predominate contributor. Hashicorp has an enterprise
offering for Consul Connect for purchase with support. At the time
of writing this book, Consul Connect was not contributed to the
CNCF or another foundation. Consul is listed as part of the CNCF
Cloud Native Landscape under the Service Mesh category.
Consul Connect uses Envoy as the sidecar proxy and the Consul
server as the control plane for programming the sidecars. Consul
Connect includes secure mTLS support between microserves and
observability using Prometheus and Grafana projects. The secure
connectivity support leverages the Hashicorp Vault product for
managing the security certificates. Recently, Hashicorp has intro‐
Linkerd
The Linkerd service mesh project is an open-source project as well
as a CNCF incubating project. The predominate contributors to the
Linkerd project are from Buoyant as shown in the twelve month
CNCF DevStats company contribution graph shown in Figure 1-4.
Linkerd has the key capabilities of a service mesh which includes
observability using Prometheus and Grafana, secure mTLS commu‐
nication, and the project recently added support for service traffic
shifting. The client-side proxy used with Linkerd is proprietary to
the Linkerd project itself written in Rust. Linkerd provides an injec‐
tor to inject proxies during a Kubernetes pod deployment based on
an annotation to the Kubernetes pod specification. Linkerd also
includes a UI dashboard to view and configure settings of the mesh.
App Mesh
App Mesh is a cloud service hosted by AWS to provide a service
mesh with application-level networking support for compute serv‐
ices within AWS such as Amazon ECS, AWS Fargate, Amazon
EKS, and Amazon EC2. As the project URL suggests, AWS App
Mesh is not open source and is proprietary to Amazon. App Mesh
does utilize the Envoy proxy for the sidecar proxies within the
mesh which does have the benefit that it may be compatible with
other AWS partners and open source tools. It appears that App
Mesh has similar routing concepts as the Istio control plane which
is not surprising since Istio serves as a control plane for Envoy
Kong
Kong’s service mesh builds upon the Kong edge capabilities for
managing APIs and has delivered these capabilities throughout the
entire mesh. While Kong is an open source project, it appears that
the contributions are heavily dominated by Kong members. Kong is
not a member of a foundation but it is listed as part of the CNCF
Cloud Native Landscape under the API Gateway category. Kong
does provide Kong Enterprise which is a paid product with support.
Much like all the other service mesh implementations, Kong has
both a control plane to program and manage the mesh as well as a
client-side proxy. In Kong’s case the client side proxy is unique to
the Kong project. Kong includes support for end-to-end mTLS
encryption between services. Kong promotes their extensibility fea‐
ture as a key advantage. You can extend the Kong proxy using Lua
plugins to inject custom behavior at the proxies.
AspenMesh
AspenMesh is unlike the other service mesh implementations
because ApsenMesh is a supported distribution of the Istio project.
AspenMesh does have many open source projects on Github but
their primary direction is not to build a new service mesh imple‐
mentation but rather to harden and support an open source service
mesh implementation through a paid offering. AspenMesh hosts
components of Istio such as Prometheus and Jaeger making it easier
to get started and use over time. They have features above and
beyond the Istio base project such as a UI and dashboard to view
and manage Istio resources. AspenMesh has introduced additional
tools such as Istio Vet which is used to detect and resolve misconfi‐
gurations within an instance of Istio. AspenMesh is an example
where there are new markets emerging to offer support and build
upon source service mesh implementation such as Istio.
Conclusion
The service mesh ecosystem is vibrant and you have learned that
there are many open source projects as well as vendor specific
projects that provide implementations for a service mesh. As we
continue to explore service mesh more deeply, we will turn our
attention to the Istio project. We have selected the Istio project
because it uses the Envoy proxy, it is rich in features, it has a diverse
open source community, and, most importantly, we both have expe‐
rience with the project.