In the Microservice ecosystem, usually cross-cutting concerns such as service discovery, service-to-service, and origin-to-service security, observability and resiliency, etc., are deployed via shared assets such as an API gateway or ESB. As microservice grows in size and complexity, it can become harder to understand and manage.
The service mesh technique addresses these challenges where the implementation of these cross-cutting capabilities is configured as code. A service mesh provides an array of network proxies alongside containers. Each proxy serves as a gateway to each interaction that occurs, both between containers and between servers. The proxy accepts the connection and spreads the load across the service mesh. Service mesh serves as a dedicated infrastructure layer for handling service-to-service communication.
Service mesh offers consistent discovery, security, tracing, monitoring, and failure handling without the need for a shared asset such as an API gateway or ESB. So if you have service mesh on your cluster, you can achieve all the below items without making changes to your application code.
In, Service Mesh model, each Microservice will have a companion proxy sidecar. Sidecar gets attached to the parent application and provides supporting features for the application. The sidecar also shares the same life cycle as the parent application, is created, and retired alongside the parent.
Currently, the service mesh is being offered by Linkerd, Istio, and Conduit providers. A service mesh is ideal for multi-cloud scenarios since it offers a single abstraction layer that obscures the specifics of the underlying cloud. Enterprises can set policies with the service mesh, and have them enforced across different cloud providers.
In the next section, we can look at how to implement Linkerd service mesh for the sample application we have used before i.e., Nginx deployment
Linkerd is a service sidecar and service mesh for Kubernetes and other frameworks. Linkerd sidecar is attached to the parent application and provides supporting features for the application. It also shares the same life cycle as the parent application, is created, and retired alongside the parent.
Applications and services often require related functionality, such as monitoring, logging, configuration, and networking services. Linkerd makes running your service easier and safer by giving you runtime debugging, observability, reliability, and security–all without requiring any changes to your code.
Quick Snapshot
Linkerd has three basic components: (1) User Interface (both command-line and web-based options are available), (2) data plane, and (3) control plane.
linkerd
) and a web UI. The CLI runs on your local machine; the web UI is hosted by the control plane.Next steps, we will download and install Linkerd, deploy the Sample app.
If you’re looking for a quick start on a basic understanding of Kubernetes concepts, please refer to earlier posts for understanding on Kubernetes & how to create, deploy & rollout updates to the cluster.
Check if you’re running Kubernetes cluster 1.9 or later by using kubectl version
command.
We will be using CLI to interact with the Linkerd control plane, download the CLI onto your local machine using curl
command.
You can also download the CLI directly via the Linkerd releases page.
Verify if the CLI is installed and running correctly using linkerd
command.
To ensure that the Linkerd control plane will install correctly, we are going to run a pre-check to validate that everything is configured correctly.
We are going to install the Linkerd control plane into its own namespace using linkerd install
command. Post-installation, Linkerd control plane resources will be added to your cluster and start running immediately.
Post installation, run linkerd check
to check if everything is ok.
Post validation, you should be having [ok]
status for all the items.
We have installed the control plane and its running, To view the components of the control plane, use kubectl
command.
You can also view the Linkerd dashboard by running linkerd dashboard
To view traffic, use linkerd -n linkerd top deploy/web
command.
Congrats! we have successfully installed and configured Linkerd components.
The next step is to set up a sample application, check the metrics.
We are going to use the Ngnix web app as a sample, to install run kubectl apply
command
Now the application is installed, the next step is to inject Linkerd into the app by piping linkerd inject
and kubectl apply
command. Kubernetes will execute a rolling deployment and update each pod with the data plane’s proxies, all without any downtime.
If you’ve noticed, we have added Linkerd to existing services without touching the original YAML.
To view, high-level stats about the app, you can run linkerd -n ngnix-deployment stat deploy
command.
The Linkerd dashboard provides a high-level view of what is happening with your services in real-time. It can be used to view the “golden” metrics (success rate, requests/second, and latency), visualize service dependencies, and understands the health of specific service routes. To view detailed metrics, you can use Grafana which is part of the Linkerd control plane and provides actionable dashboards for your services out of the box. It is possible to see high-level metrics and dig down into the details, even for pods.
Today, we have learned how to install Linkerd & its components. We have also deployed sample service and able to view traffic and its metrics.
Like this post? Don’t forget to share it!
There are few things as valuable to a business as well-designed software. Organizations today rely…
The cryptocurrency industry is being reshaped by the fusion of blockchain technology and artificial intelligence…
Introduction Artificial Intelligence (AI) has also found its relevance in graphic design and is quickly…
Imagine a world where the brilliance of Artificial Intelligence (AI) meets the unbreakable security of…
In today’s fast-paced digital landscape, automation is not just a luxury but a necessity for…
The world of casino gaming has leveraged the emerging technology advancements to create immersive and…
This website uses cookies.