Book Image

Mastering Service Mesh

By : Anjali Khatri, Vikram Khatri
Book Image

Mastering Service Mesh

By: Anjali Khatri, Vikram Khatri

Overview of this book

Although microservices-based applications support DevOps and continuous delivery, they can also add to the complexity of testing and observability. The implementation of a service mesh architecture, however, allows you to secure, manage, and scale your microservices more efficiently. With the help of practical examples, this book demonstrates how to install, configure, and deploy an efficient service mesh for microservices in a Kubernetes environment. You'll get started with a hands-on introduction to the concepts of cloud-native application management and service mesh architecture, before learning how to build your own Kubernetes environment. While exploring later chapters, you'll get to grips with the three major service mesh providers: Istio, Linkerd, and Consul. You'll be able to identify their specific functionalities, from traffic management, security, and certificate authority through to sidecar injections and observability. By the end of this book, you will have developed the skills you need to effectively manage modern microservices-based applications.
Table of Contents (31 chapters)
1
Section 1: Cloud-Native Application Management
4
Section 2: Architecture
8
Section 3: Building a Kubernetes Environment
10
Section 4: Learning about Istio through Examples
18
Section 5: Learning about Linkerd through Examples
24
Section 6: Learning about Consul through Examples

To get the most out of this book

You will get the most out of this book by building an environment yourself and practicing with it using the examples provided herein.

If you have not used Kubernetes before, it is best to follow the example of building your Kubernetes environment on your Windows laptop or MacBook. This book is not about Kubernetes, but having a Kubernetes environment is a must. We explain how to build your Kubernetes environment in Chapter 6, Building Your Own Kubernetes Environment.

If you are comfortable with any other Kubernetes provider, you can take and test the examples in a Kubernetes environment of your choosing.

Since technology is evolving rapidly, we have a GitHub repository, which you can refer to for the latest changes.

You can practice examples given in this book either on a Windows or macOS platform. The hardware/software requirements are as under. Refer to Chapter 6, Building Your Own Kubernetes Environment for further details.

Software/Hardware covered in the book

OS Requirements

Workstation/Laptop or MacBook with a minimum 16 GB RAM / Intel Core i7 or higher, a minimum of 512 GB SSD Windows 10 or macOS Pro (2015 or later)
VMware Player V15.x or VMware Fusion 11.x Windows or macOS
7z Software for Windows or Free 7z Unarchiver for macOS Windows or macOS

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to copy/pasting of code.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once you download the file, please make sure that you unzip or extract the folder using the latest version of:

  • 7-Zip for Windows
  • Free 7z Unarchiver for Mac

The code bundle for the book is on GitHub at https://github.com/PacktPublishing/Mastering-Service-Mesh.

Note: For the implementation chapters throughout this book, we recommend our readers to pull all the necessary source code files from https://github.com/servicemeshbook/ for Istio, Linkerd, and Consul. We will have chapter-specific repository links, with clear instructions regarding all GitHub repository exports. Both Mastering-Service-Mesh and servicemeshbook GitHub page(s) will continue to stay active and up to date.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are several text conventions used throughout this book.

CodeInText: Indicates code words in a text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Optionally, you can configure a separate disk to mount /var/lib/docker and restart Docker."

A block of code is as follows:

apiVersion: authentication.istio.io/v1alpha1
kind: Policy
metadata:
name: SVC-A-mTLS-disable
namespace: ns1
spec:
targets:
- name: Service-A
peers:
- mtls:
mode: DISABLE

When we wish to draw your attention to a particular part of a code block, the relevant lines shows in bold:

  peers:
- mtls:
mode: DISABLE

Any command-line input or output shows as follows:

$ kubectl get pods
$ istioctl proxy

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "On the left-hand menu under Workloads, click Pods."

Warnings or important notes appear like this.
Tips and tricks appear like this.

Errata

The technology landscape is evolving rapidly. When we started writing this book, the Istio release was 1.0.3, this book's current Istio release is 1.3.5. It is a similar case with Linkerd and Consul. The time to market is of the essence and these three open-source projects show a true CICD (short for Continuous Improvement and Continuous Delivery) approach using agile DevOps tools.

In order to run commands and scripts from this book, stick to the version used herein. However, we will update our GitHub repository for this book at https://github.com/servicemeshbook with newer versions that will be released in the future. You can switch to the newer branch in each repository for updated scripts and commands.

We were conscientious and implemented hands-on testing during development for all three service meshes and it is likely that some issues may remain. We suggest that you open issues that you encounter while going through the book. Use these links to open an issue for any errata and bugs:

Your feedback is important to us and you may open an issue for suggestions and any further proposed improvements in relation to the above-mentioned service meshes.