Implementing observability and traffic splitting with Linkerd
To explain how we are going to use Linkerd for observability and traffic splitting, let’s explore the following diagram:
Figure 8.4 – Traffic splitting with Linkerd
First of all, you have to install Linkerd in your Kubernetes cluster. For this small scenario, we are going to use two deployments. The first deployment is a simple API deployment that returns the message Meshed application app1 with Linkerd, and the second, a deployment that always returns error code 500
.
All the traffic will be sent by a client (in our case a loop that sends requests to the endpoint of the application) that is a load balancer created by your ingress controller service and used by an ingress definition. Every time the ingress object detects the traffic, the traffic will be split by 50% to the API deployment and 50% to the faulty deployment. This is going to simulate an error rate of 50% in your requests...