Back to microservices with Istio. Part 1

Back to microservices with Istio. Part 1

Note. transl.: Service meshes have definitely become a hot topic in today's infrastructure for applications following microservice architecture. While Istio may be on the radar of many DevOps engineers, it is a fairly new product that, while complex in terms of features it provides, can take a significant amount of time to get to know. The German engineer Rinor Maloku, who is in charge of cloud computing for large clients at the telecommunications company Orange Networks, has written a wonderful series of materials that allow you to quickly and deeply dive into Istio. He begins his story with what Istio can do and how you can quickly see it with your own eyes.

Istio β€” Open Source-project, developed in collaboration with teams from Google, IBM and Lyft. It solves the complexities that arise in applications based on microservices, for example, such as:

  • traffic management: timeouts, retries, load balancing;
  • Security: end user authentication and authorization;
  • observability: tracing, monitoring, logging.

All of them can be solved at the application level, however after that your services will no longer be "micro". All the extra effort to address these issues is a waste of company resources that could be used directly for business value. Consider an example:

Project Manager: How long does it take to add a feedback feature?
Developer: Two sprints.

MP: What?.. It's just CRUD!
R: Doing CRUD is the easy part of the task, but we still need to authenticate and authorize users and services. Since the network is unreliable, you will need to implement repeated requests, as well as circuit breaker pattern in clients. Also, to make sure that the whole system did not crash, timeouts and bulk heads (See later in the article for more details on both mentioned patterns.), and in order to detect problems, monitoring, tracing, […]

MP: Oh, let's just put this feature into the Product service then.

I think the idea is clear: the amount of steps and effort required to add a single service is huge. In this article, we'll take a look at how Istio removes all of the complexity mentioned above (not targeted by business logic) from services.

Back to microservices with Istio. Part 1

Note: The article assumes that you have working knowledge of Kubernetes. Otherwise, I recommend reading my introduction to Kubernetes and only then continue reading this material.

Istio idea

In a world without Istio, one service makes direct requests to another, and in case of failure, the service must handle it itself: make a new attempt, provide for a timeout, open a circuit breaker, etc.

Back to microservices with Istio. Part 1
Network traffic in Kubernetes

Istio, on the other hand, offers a specialized solution that is completely separate from services and functions by interfering with network interaction. And thus it implements:

  • fault tolerance: based on the status code in the response, it understands if the request failed and resubmits it.
  • Canary Rollouts: redirects only a fixed percentage of requests to the new version of the service.
  • Monitoring and Metrics: how long did it take for the service to respond?
  • Tracing and observability: Adds special headers to each request and traces them across the cluster.
  • Security: Retrieves a JWT token, authenticates and authorizes users.

These are just a few of the possibilities (really just a few!) to intrigue you. Now let's dive into the technical details!

Architecture

Istio intercepts all network traffic and applies a set of rules to it, inserting a smart proxy in the form of a sidecar container into each pod. Proxies that activate all possibilities form a data plane, and they can be dynamically adjusted with Control plane.

data plane

The proxies that are inserted into the pods allow Istio to easily achieve the requirements we need. For example, let's check the retries and circuit breaker functions.

Back to microservices with Istio. Part 1
How retries and circuit breaking are implemented in Envoy

To summarize:

  1. Envoy (we are talking about a proxy located in a sidecar container, which is distributed and how separate product - approx. transl.) sends a request to the first instance of service B and fails.
  2. Envoy Sidecar is trying again (retry). (1)
  3. The failed request is returned to the proxy that called it.
  4. This opens the Circuit Breaker and calls the next service for subsequent requests. (2)

This means that you don't have to use the next Retry library, you don't have to make your own implementation of Circuit Breaking and Service Discovery in the X, Y or Z programming language. All this and more is available out of the box in Istio and does not require no code changes.

Great! Now you may want to go on a voyage with Istio, but there are still some doubts, open questions. If this is a universal solution for all occasions in life, then you have a legitimate suspicion: after all, all such solutions are in fact not suitable for any case.

And finally you ask: β€œIs it customizable?”

Now you are ready for a sea voyage - and let's get acquainted with Control Plane.

Control plane

It consists of three components: Pilot, Mixer ΠΈ Citadel, which together configure Envoys to route traffic, enforce policies, and collect telemetry data. Schematically, it all looks like this:

Back to microservices with Istio. Part 1
Interaction of Control Plane with Data Plane

Envoys (i.e. data plane) are configured with Kubernetes CRD (Custom Resource Definitions) defined by Istio and specifically designed for this purpose. What this means to you is that they are just another resource in Kubernetes with a familiar syntax. Once created, this resource will be picked up by the control plane and applied to Envoys.

Relationship of services to Istio

We have described Istio's relationship to services, but not the other way around: how do services relate to Istio?

To be honest, services know about the presence of Istio as well as fish know about water, when they ask themselves: β€œWhat is water anyway?”.

Back to microservices with Istio. Part 1
Illustration Victoria Dimitrakopoulos: How do you like the water? - What is water anyway?

Thus, you can take a working cluster and after deploying the Istio components, the services in it will continue to work, and after removing these components, everything will be fine again. It is clear that in this case you will lose the opportunities provided by Istio.

Enough theory - let's put this knowledge into practice!

Istio in practice

Istio requires a Kubernetes cluster with at least 4 vCPUs and 8 GB of RAM available. To quickly raise the cluster and follow the instructions from the article, I recommend using the Google Cloud Platform, which offers new users free $300.

After creating the cluster and setting up access to Kubernetes through the console utility, you can install Istio through the Helm package manager.

Helm Installation

Install the Helm client on your computer as described in official documentation. We will use it to generate templates for installing Istio in the next section.

Installation

Download Istio resources from latest release (the original author's link to version 1.0.5 has been changed to the current one, i.e. 1.0.6 - approx. transl.), extract the contents to a single directory, which I will refer to as [istio-resources].

For easy identification of Istio resources, create a namespace in the K8s cluster istio-system:

$ kubectl create namespace istio-system

Complete the installation by navigating to the directory [istio-resources] and running the command:

$ helm template install/kubernetes/helm/istio 
  --set global.mtls.enabled=false 
  --set tracing.enabled=true 
  --set kiali.enabled=true 
  --set grafana.enabled=true 
  --namespace istio-system > istio.yaml

This command will output the key components of Istio to a file istio.yaml. We have modified the standard template for ourselves by specifying the following parameters:

  • global.mtls.enabled installed in false (i.e. mTLS authentication is disabled - approx. transl.)to simplify our dating process;
  • tracing.enabled enables request tracing with Jaeger;
  • kiali.enabled installs Kiali into a cluster to visualize services and traffic;
  • grafana.enabled installs Grafana to visualize the collected metrics.

Apply the generated resources with the command:

$ kubectl apply -f istio.yaml

Installation of Istio in the cluster is complete! Wait until all pods in the namespace istio-system will be able Running or Completedby running the command below:

$ kubectl get pods -n istio-system

We are now ready to continue on to the next section, where we will raise and run the application.

Sentiment Analysis Application Architecture

Let's use the example of the Sentiment Analysis microservice application used in the already mentioned Introduction article to Kubernetes. It is complex enough to show the possibilities of Istio in practice.

The application consists of four microservices:

  1. Service SA-Frontend, which serves the front-end application on Reactjs;
  2. Service SA Web App, which serves Sentiment Analysis queries;
  3. Service SA Logicwhich performs itself sentiment analysis;
  4. Service SA Feedback, which receives feedback from users on the accuracy of the analysis performed.

Back to microservices with Istio. Part 1

In this diagram, in addition to services, we also see the Ingress Controller, which in Kubernetes routes incoming requests to the corresponding services. Istio uses a similar concept as part of the Ingress Gateway, details of which will follow.

Launching an application with a proxy from Istio

For further operations mentioned in the article, clone your repository istio-mastery. It contains the application and manifests for Kubernetes and Istio.

Inserting sidecars

Insertion can be made automatically or manually. To automatically insert sidecar containers, you need to set the label to the namespace istio-injection=enabled, which is done by the following command:

$ kubectl label namespace default istio-injection=enabled
namespace/default labeled

Now each pod that will be deployed in the default namespace (default) will get its sidecar container. To verify this, let's deploy a test application by going to the root directory of the repository [istio-mastery] and running the following command:

$ kubectl apply -f resource-manifests/kube
persistentvolumeclaim/sqlite-pvc created
deployment.extensions/sa-feedback created
service/sa-feedback created
deployment.extensions/sa-frontend created
service/sa-frontend created
deployment.extensions/sa-logic created
service/sa-logic created
deployment.extensions/sa-web-app created
service/sa-web-app created

Having deployed the services, check that the pods have two containers (with the service itself and its sidecar) by running the command kubectl get pods and making sure that under the column READY value specified 2/2, symbolizing that both containers are running:

$ kubectl get pods
NAME                           READY     STATUS    RESTARTS   AGE
sa-feedback-55f5dc4d9c-c9wfv   2/2       Running   0          12m
sa-frontend-558f8986-hhkj9     2/2       Running   0          12m
sa-logic-568498cb4d-2sjwj      2/2       Running   0          12m
sa-logic-568498cb4d-p4f8c      2/2       Running   0          12m
sa-web-app-599cf47c7c-s7cvd    2/2       Running   0          12m

Visually it looks like this:

Back to microservices with Istio. Part 1
Envoy proxy in one of the pods

Now that the application is up and running, we need to allow incoming traffic to enter the application.

Ingress Gateway

The best practice to achieve this (allow traffic in the cluster) is through Ingress Gateway in Istio, which is located at the β€œedge” of the cluster and allows you to enable Istio features such as routing, load balancing, security, and monitoring for incoming traffic.

The Ingress Gateway component and the service that forwards it outward were installed on the cluster during the Istio installation. To find out the external IP address of a service, run:

$ kubectl get svc -n istio-system -l istio=ingressgateway
NAME                   TYPE           CLUSTER-IP     EXTERNAL-IP
istio-ingressgateway   LoadBalancer   10.0.132.127   13.93.30.120

We will continue to access the application using this IP (I will refer to it as EXTERNAL-IP), so for convenience, we will write the value to a variable:

$ EXTERNAL_IP=$(kubectl get svc -n istio-system 
  -l app=istio-ingressgateway 
  -o jsonpath='{.items[0].status.loadBalancer.ingress[0].ip}')

If you try to access this IP through a browser now, you will get a Service Unavailable error, because by default Istio blocks all incoming trafficuntil Gateway is defined.

Gateway resource

Gateway is a CRD (Custom Resource Definition) in Kubernetes, defined after installing Istio in a cluster and enabling the ability to specify ports, protocol, and hosts for which we want to allow incoming traffic.

In our case, we want to allow HTTP traffic on port 80 for all hosts. The problem is realized by the following definition (http-gateway.yaml):

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: http-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
- "*"

This configuration needs no explanation except for the selector istio: ingressgateway. With this selector, we can specify which Ingress Gateway to apply the configuration to. In our case, this is the Ingress Gateway controller, which was installed by default in Istio.

The configuration is applied by calling the following command:

$ kubectl apply -f resource-manifests/istio/http-gateway.yaml gateway.networking.istio.io/http-gateway created

The gateway now allows access to port 80 but has no idea where to route the requests. For this you will need Virtual Services.

Virtual Service resource

The VirtualService tells the Ingress Gateway how to route requests that are allowed within the cluster.

Requests to our application coming through the http-gateway must be sent to the sa-frontend, sa-web-app and sa-feedback services:

Back to microservices with Istio. Part 1
Routes to be configured with VirtualServices

Consider the requests that should be sent to SA-Frontend:

  • Exact match along the way / should be sent to SA-Frontend to get index.html;
  • Paths with a prefix /static/* should be sent to SA-Frontend to get static files used in the frontend, such as CSS and JavaScript;
  • Paths matching the regular expression '^.*.(ico|png|jpg)$', must be sent to SA-Frontend, because These are the pictures displayed on the page.

The implementation is achieved by the following configuration (sa-virtualservice-external.yaml):

kind: VirtualService
metadata:
  name: sa-external-services
spec:
  hosts:
  - "*"
  gateways:
  - http-gateway                      # 1
  http:
  - match:
    - uri:
        exact: /
    - uri:
        exact: /callback
    - uri:
        prefix: /static
    - uri:
        regex: '^.*.(ico|png|jpg)

Π’Π°ΠΆΠ½Ρ‹Π΅ ΠΌΠΎΠΌΠ΅Π½Ρ‚Ρ‹:

  1. Π­Ρ‚ΠΎΡ‚ VirtualService относится ΠΊ запросам, приходящим Ρ‡Π΅Ρ€Π΅Π· http-gateway;
  2. Π’ destination опрСдСляСтся сСрвис, ΠΊΡƒΠ΄Π° ΠΎΡ‚ΠΏΡ€Π°Π²Π»ΡΡŽΡ‚ΡΡ запросы.
ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΠ΅: ΠšΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΡ Π²Ρ‹ΡˆΠ΅ хранится Π² Ρ„Π°ΠΉΠ»Π΅ sa-virtualservice-external.yaml, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ Ρ‚Π°ΠΊΠΆΠ΅ содСрТит настройки для ΠΌΠ°Ρ€ΡˆΡ€ΡƒΡ‚ΠΈΠ·Π°Ρ†ΠΈΠΈ Π² SA-WebApp ΠΈ SA-Feedback, Π½ΠΎ Π±Ρ‹Π» сокращён здСсь Π² ΡΡ‚Π°Ρ‚ΡŒΠ΅ для лаконичности. ΠŸΡ€ΠΈΠΌΠ΅Π½ΠΈΠΌ VirtualService Π²Ρ‹Π·ΠΎΠ²ΠΎΠΌ:
$ kubectl apply -f resource-manifests/istio/sa-virtualservice-external.yaml
virtualservice.networking.istio.io/sa-external-services created

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΠ΅: Когда ΠΌΡ‹ примСняСм рСсурсы Istio, Kubernetes API Server создаёт событиС, ΠΊΠΎΡ‚ΠΎΡ€ΠΎΠ΅ ΠΏΠΎΠ»ΡƒΡ‡Π°Π΅Ρ‚ Istio Control Plane, ΠΈ ΡƒΠΆΠ΅ послС этого новая конфигурация примСняСтся ΠΊ прокси-сСрвСрам Envoy ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ pod'Π°. А ΠΊΠΎΠ½Ρ‚Ρ€ΠΎΠ»Π»Π΅Ρ€ Ingress Gateway прСдставляСтся ΠΎΡ‡Π΅Ρ€Π΅Π΄Π½Ρ‹ΠΌ Envoy, сконфигурированным Π² Control Plane. Всё это Π½Π° схСмС выглядит Ρ‚Π°ΠΊ:

Назад ΠΊ микросСрвисам вмСстС с Istio. Π§Π°ΡΡ‚ΡŒ 1
ΠšΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΡ Istio-IngressGateway для ΠΌΠ°Ρ€ΡˆΡ€ΡƒΡ‚ΠΈΠ·Π°Ρ†ΠΈΠΈ запросов

ΠŸΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Sentiment Analysis стало доступным ΠΏΠΎ http://{EXTERNAL-IP}/. НС ΠΏΠ΅Ρ€Π΅ΠΆΠΈΠ²Π°ΠΉΡ‚Π΅, Ссли Π²Ρ‹ ΠΏΠΎΠ»ΡƒΡ‡Π°Π΅Ρ‚Π΅ статус Not Found: ΠΈΠ½ΠΎΠ³Π΄Π° трСбуСтся Ρ‡ΡƒΡ‚ΡŒ большС Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ для Ρ‚ΠΎΠ³ΠΎ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ конфигурация вступила Π² силу ΠΈ кэши Envoy обновились.

ΠŸΠ΅Ρ€Π΅Π΄ Ρ‚Π΅ΠΌ, ΠΊΠ°ΠΊ ΠΏΡ€ΠΎΠ΄ΠΎΠ»ΠΆΠΈΡ‚ΡŒ, ΠΏΠΎΡ€Π°Π±ΠΎΡ‚Π°ΠΉΡ‚Π΅ Π½Π΅ΠΌΠ½ΠΎΠ³ΠΎ с ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΡΠ³Π΅Π½Π΅Ρ€ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Ρ‚Ρ€Π°Ρ„ΠΈΠΊ (Π΅Π³ΠΎ Π½Π°Π»ΠΈΡ‡ΠΈΠ΅ Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ для наглядности Π² ΠΏΠΎΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΡ… дСйствиях β€” ΠΏΡ€ΠΈΠΌ. ΠΏΠ΅Ρ€Π΅Π².).

Kialiβ€Š: Π½Π°Π±Π»ΡŽΠ΄Π°Π΅ΠΌΠΎΡΡ‚ΡŒ

Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠΏΠ°ΡΡ‚ΡŒ Π² административный интСрфСйс Kiali, Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΡƒΡŽ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ:

$ kubectl port-forward 
    $(kubectl get pod -n istio-system -l app=kiali 
    -o jsonpath='{.items[0].metadata.name}') 
    -n istio-system 20001

… ΠΈ ΠΎΡ‚ΠΊΡ€ΠΎΠΉΡ‚Π΅ http://localhost:20001/, залогинившись ΠΏΠΎΠ΄ admin/admin. Π—Π΄Π΅ΡΡŒ Π²Ρ‹ Π½Π°ΠΉΠ΄Π΅Ρ‚Π΅ мноТСство ΠΏΠΎΠ»Π΅Π·Π½Ρ‹Ρ… возмоТностСй, Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, для ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠΈ ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ΠΎΠ² Istio, Π²ΠΈΠ·ΡƒΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ сСрвисов ΠΏΠΎ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ, собранной ΠΏΡ€ΠΈ ΠΏΠ΅Ρ€Π΅Ρ…Π²Π°Ρ‚Π΅ сСтСвых запросов, получСния ΠΎΡ‚Π²Π΅Ρ‚ΠΎΠ² Π½Π° вопросы Β«ΠšΡ‚ΠΎ ΠΊ ΠΊΠΎΠΌΡƒ обращаСтся?Β», Β«Π£ ΠΊΠ°ΠΊΠΎΠΉ вСрсии сСрвиса Π²ΠΎΠ·Π½ΠΈΠΊΠ°ΡŽΡ‚ сбои?Β» ΠΈ Ρ‚.ΠΏ. Π’ ΠΎΠ±Ρ‰Π΅ΠΌ, ΠΈΠ·ΡƒΡ‡ΠΈΡ‚Π΅ возмоТности Kiali ΠΏΠ΅Ρ€Π΅Π΄ Ρ‚Π΅ΠΌ, ΠΊΠ°ΠΊ Π΄Π²ΠΈΠ³Π°Ρ‚ΡŒΡΡ дальшС β€” ΠΊ Π²ΠΈΠ·ΡƒΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊ с Grafana.

Назад ΠΊ микросСрвисам вмСстС с Istio. Π§Π°ΡΡ‚ΡŒ 1

Grafana: визуализация ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊ

Π‘ΠΎΠ±Ρ€Π°Π½Π½Ρ‹Π΅ Π² Istio ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡŽΡ‚ Π² Prometheus ΠΈ Π²ΠΈΠ·ΡƒΠ°Π»ΠΈΠ·ΠΈΡ€ΡƒΡŽΡ‚ΡΡ с Grafana. Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠΏΠ°ΡΡ‚ΡŒ Π² административный интСрфСйс Grafana, Π²Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρƒ Π½ΠΈΠΆΠ΅, послС Ρ‡Π΅Π³ΠΎ ΠΎΡ‚ΠΊΡ€ΠΎΠΉΡ‚Π΅ http://localhost:3000/:

$ kubectl -n istio-system port-forward 
    $(kubectl -n istio-system get pod -l app=grafana 
    -o jsonpath={.items[0].metadata.name}) 3000

ΠšΠ»ΠΈΠΊΠ½ΡƒΠ² Π½Π° мСню Home слСва свСрху ΠΈ Π²Ρ‹Π±Ρ€Π°Π² Istio Service Dashboard Π² Π»Π΅Π²ΠΎΠΌ Π²Π΅Ρ€Ρ…Π½Π΅ΠΌ ΡƒΠ³Π»Ρƒ, Π½Π°Ρ‡Π½ΠΈΡ‚Π΅ с сСрвиса sa-web-app, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Π½Π° собранныС ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊΠΈ:

Назад ΠΊ микросСрвисам вмСстС с Istio. Π§Π°ΡΡ‚ΡŒ 1

Π—Π΄Π΅ΡΡŒ нас ΠΆΠ΄Ρ‘Ρ‚ пустоС ΠΈ ΡΠΎΠ²Π΅Ρ€ΡˆΠ΅Π½Π½ΠΎ скучноС прСдставлСниС β€” руководство Π½ΠΈΠΊΠΎΠ³Π΄Π° Ρ‚Π°ΠΊΠΎΠ΅ Π½Π΅ ΠΎΠ΄ΠΎΠ±Ρ€ΠΈΡ‚. Π”Π°Π²Π°ΠΉΡ‚Π΅ ΠΆΠ΅ создадим Π½Π΅Π±ΠΎΠ»ΡŒΡˆΡƒΡŽ Π½Π°Π³Ρ€ΡƒΠ·ΠΊΡƒ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅ΠΉ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ:

$ while true; do 
    curl -i http://$EXTERNAL_IP/sentiment 
    -H "Content-type: application/json" 
    -d '{"sentence": "I love yogobella"}'; 
    sleep .8; done

Π’ΠΎΡ‚ Ρ‚Π΅ΠΏΠ΅Ρ€ΡŒ Ρƒ нас Π³ΠΎΡ€Π°Π·Π΄ΠΎ Π±ΠΎΠ»Π΅Π΅ симпатичныС Π³Ρ€Π°Ρ„ΠΈΠΊΠΈ, Π° Π² Π΄ΠΎΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ ΠΊ Π½ΠΈΠΌ β€” Π·Π°ΠΌΠ΅Ρ‡Π°Ρ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ инструмСнты Prometheus для ΠΌΠΎΠ½ΠΈΡ‚ΠΎΡ€ΠΈΠ½Π³Π° ΠΈ Grafana для Π²ΠΈΠ·ΡƒΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΌΠ΅Ρ‚Ρ€ΠΈΠΊ, Ρ‡Ρ‚ΠΎ позволят Π½Π°ΠΌ ΡƒΠ·Π½Π°Ρ‚ΡŒ ΠΎ ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ, состоянии Π·Π΄ΠΎΡ€ΠΎΠ²ΡŒΡ, ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½ΠΈΡΡ…/Π΄Π΅Π³Ρ€Π°Π΄Π°Ρ†ΠΈΠΈ Π² Ρ€Π°Π±ΠΎΡ‚Π΅ сСрвисов Π½Π° протяТСнии Π²Ρ€Π΅ΠΌΠ΅Π½ΠΈ.

НаконСц, посмотрим Π½Π° трассировку запросов Π² сСрвисах.

Jaegerβ€Š: трассировка

Врассировка Π½Π°ΠΌ потрСбуСтся, ΠΏΠΎΡ‚ΠΎΠΌΡƒ Ρ‡Ρ‚ΠΎ Ρ‡Π΅ΠΌ большС Ρƒ нас сСрвисов, Ρ‚Π΅ΠΌ слоТнСС Π΄ΠΎΠ±Ρ€Π°Ρ‚ΡŒΡΡ Π΄ΠΎ ΠΏΡ€ΠΈΡ‡ΠΈΠ½Ρ‹ сбоя. ΠŸΠΎΡΠΌΠΎΡ‚Ρ€ΠΈΠΌ Π½Π° простой случай ΠΈΠ· ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠΈ Π½ΠΈΠΆΠ΅:

Назад ΠΊ микросСрвисам вмСстС с Istio. Π§Π°ΡΡ‚ΡŒ 1
Π’ΠΈΠΏΠΎΠ²ΠΎΠΉ ΠΏΡ€ΠΈΠΌΠ΅Ρ€ случайного Π½Π΅ΡƒΠ΄Π°Ρ‡Π½ΠΎΠ³ΠΎ запроса

Запрос ΠΏΡ€ΠΈΡ…ΠΎΠ΄ΠΈΡ‚, ΠΏΠ°Π΄Π°Π΅Ρ‚ β€” Π² Ρ‡Ρ‘ΠΌ ΠΆΠ΅ ΠΏΡ€ΠΈΡ‡ΠΈΠ½Π°? ΠŸΠ΅Ρ€Π²Ρ‹ΠΉ сСрвис? Или Π²Ρ‚ΠΎΡ€ΠΎΠΉ? Π˜ΡΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΡ Π΅ΡΡ‚ΡŒ Π² ΠΎΠ±ΠΎΠΈΡ… β€” Π΄Π°Π²Π°ΠΉΡ‚Π΅ посмотрим Π½Π° Π»ΠΎΠ³ΠΈ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ. Как часто Π²Ρ‹ Π»ΠΎΠ²ΠΈΠ»ΠΈ сСбя Π·Π° Ρ‚Π°ΠΊΠΈΠΌ занятиСм? Наша Ρ€Π°Π±ΠΎΡ‚Π° большС ΠΏΠΎΡ…ΠΎΠΆΠ° Π½Π° Π΄Π΅Ρ‚Π΅ΠΊΡ‚ΠΈΠ²ΠΎΠ² ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, Π° Π½Π΅ разработчиков…

Π­Ρ‚ΠΎ ΡˆΠΈΡ€ΠΎΠΊΠΎ распространённая ΠΏΡ€ΠΎΠ±Π»Π΅ΠΌΠ° Π² микросСрвисах ΠΈ Ρ€Π΅ΡˆΠ°Π΅Ρ‚ΡΡ ΠΎΠ½Π° распрСдСлёнными систСмами трассировки, Π² ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… сСрвисы ΠΏΠ΅Ρ€Π΅Π΄Π°ΡŽΡ‚ Π΄Ρ€ΡƒΠ³ Π΄Ρ€ΡƒΠ³Ρƒ ΡƒΠ½ΠΈΠΊΠ°Π»ΡŒΠ½Ρ‹ΠΉ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΎΠΊ, послС Ρ‡Π΅Π³ΠΎ эта информация пСрСнаправляСтся Π² систСму трассировки, Π³Π΄Π΅ ΠΎΠ½Π° сопоставляСтся с Π΄Π°Π½Π½Ρ‹ΠΌΠΈ запроса. Π’ΠΎΡ‚ ΠΈΠ»Π»ΡŽΡΡ‚Ρ€Π°Ρ†ΠΈΡ:

Назад ΠΊ микросСрвисам вмСстС с Istio. Π§Π°ΡΡ‚ΡŒ 1
Для ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ†ΠΈΠΈ запроса ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ TraceId

Π’ Istio ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ Jaeger Tracer, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ Ρ€Π΅Π°Π»ΠΈΠ·ΡƒΠ΅Ρ‚ нСзависимый ΠΎΡ‚ Π²Π΅Π½Π΄ΠΎΡ€ΠΎΠ² Ρ„Ρ€Π΅ΠΉΠΌΠ²ΠΎΡ€ΠΊ OpenTracing API. ΠŸΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ доступ ΠΊ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΎΠ³ΠΎ интСрфСйсу Jaeger ΠΌΠΎΠΆΠ½ΠΎ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅ΠΉ ΠΊΠΎΠΌΠ°Π½Π΄ΠΎΠΉ:

$ kubectl port-forward -n istio-system 
    $(kubectl get pod -n istio-system -l app=jaeger 
    -o jsonpath='{.items[0].metadata.name}') 16686

Π’Π΅ΠΏΠ΅Ρ€ΡŒ Π·Π°ΠΉΠ΄ΠΈΡ‚Π΅ Π½Π° http://localhost:16686/ ΠΈ Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ сСрвис sa-web-app. Если сСрвис Π½Π΅ ΠΏΠΎΠΊΠ°Π·Π°Π½ Π² Π²Ρ‹ΠΏΠ°Π΄Π°ΡŽΡ‰Π΅ΠΌ мСню β€” проявитС/сгСнСрируйтС Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΡΡ‚ΡŒ Π½Π° страницС ΠΈ ΠΎΠ±Π½ΠΎΠ²ΠΈΡ‚Π΅ интСрфСйс. ПослС этого Π½Π°ΠΆΠΌΠΈΡ‚Π΅ Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ Find Traces, которая ΠΏΠΎΠΊΠ°ΠΆΠ΅Ρ‚ самыС послСдниС трСйсы β€” Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ любой β€” покаТСтся дСтализированная информация ΠΏΠΎ всСм трСйсам:

Назад ΠΊ микросСрвисам вмСстС с Istio. Π§Π°ΡΡ‚ΡŒ 1

Π­Ρ‚ΠΎΡ‚ трСйс ΠΏΠΎΠΊΠ°Π·Ρ‹Π²Π°Π΅Ρ‚:

  1. Запрос ΠΏΡ€ΠΈΡ…ΠΎΠ΄ΠΈΡ‚ Π² istio-ingressgateway (это ΠΏΠ΅Ρ€Π²ΠΎΠ΅ взаимодСйствиС с ΠΎΠ΄Π½ΠΈΠΌ ΠΈΠ· сСрвисов, ΠΈ для запроса гСнСрируСтся Trace ID), послС Ρ‡Π΅Π³ΠΎ шлюз направляСт запрос Π² сСрвис sa-web-app.
  2. Π’ сСрвисС sa-web-app запрос подхватываСтся Envoy sidecar'ΠΎΠΌ, создаётся Β«Ρ€Π΅Π±Ρ‘Π½ΠΎΠΊΒ» Π² span'Π΅ (поэтому ΠΌΡ‹ Π²ΠΈΠ΄ΠΈΠΌ Π΅Π³ΠΎ Π² трСйсах) ΠΈ пСрСнаправляСтся Π² ΠΊΠΎΠ½Ρ‚Π΅ΠΉΠ½Π΅Ρ€ sa-web-app. (Span β€” логичСская Π΅Π΄ΠΈΠ½ΠΈΡ†Π° Ρ€Π°Π±ΠΎΡ‚Ρ‹ Π² Jaeger, ΠΈΠΌΠ΅ΡŽΡ‰Π°Ρ Π½Π°Π·Π²Π°Π½ΠΈΠ΅, врСмя Π½Π°Ρ‡Π°Π»ΠΎ ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ ΠΈ Π΅Ρ‘ ΠΏΡ€ΠΎΠ΄ΠΎΠ»ΠΆΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ. Span'Ρ‹ ΠΌΠΎΠ³ΡƒΡ‚ Π±Ρ‹Ρ‚ΡŒ Π²Π»ΠΎΠΆΠ΅Π½Π½Ρ‹ΠΌΠΈ ΠΈ упорядочСнными. ΠžΡ€ΠΈΠ΅Π½Ρ‚ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹ΠΉ ацикличСский Π³Ρ€Π°Ρ„ ΠΈΠ· span'ΠΎΠ² ΠΎΠ±Ρ€Π°Π·ΡƒΠ΅Ρ‚ trace. β€” ΠΏΡ€ΠΈΠΌ. ΠΏΠ΅Ρ€Π΅Π².)
  3. Π—Π΄Π΅ΡΡŒ запрос обрабатываСтся ΠΌΠ΅Ρ‚ΠΎΠ΄ΠΎΠΌ sentimentAnalysis. Π­Ρ‚ΠΈ трСйсы ΡƒΠΆΠ΅ сгСнСрированы ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ, Ρ‚.Π΅. для Π½ΠΈΡ… ΠΏΠΎΡ‚Ρ€Π΅Π±ΠΎΠ²Π°Π»ΠΈΡΡŒ измСнСния Π² ΠΊΠΎΠ΄Π΅.
  4. Π‘ этого ΠΌΠΎΠΌΠ΅Π½Ρ‚Π° инициируСтся POST-запрос Π² sa-logic. Trace ID Π΄ΠΎΠ»ΠΆΠ΅Π½ Π±Ρ‹Ρ‚ΡŒ ΠΏΡ€ΠΎΠ±Ρ€ΠΎΡˆΠ΅Π½ ΠΈΠ· sa-web-app.
  5. …

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΠ΅: На 4 шагС ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π΄ΠΎΠ»ΠΆΠ½ΠΎ ΡƒΠ²ΠΈΠ΄Π΅Ρ‚ΡŒ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ, сгСнСрированныС Istio, ΠΈ ΠΏΠ΅Ρ€Π΅Π΄Π°Ρ‚ΡŒ ΠΈΡ… Π² ΠΏΠΎΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠ΅ запросы, ΠΊΠ°ΠΊ ΠΏΠΎΠΊΠ°Π·Π°Π½ΠΎ Π½Π° ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΈ Π½ΠΈΠΆΠ΅:

Назад ΠΊ микросСрвисам вмСстС с Istio. Π§Π°ΡΡ‚ΡŒ 1
(A) Π—Π° проброс Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΎΠ² ΠΎΡ‚Π²Π΅Ρ‡Π°Π΅Ρ‚ Istio; (B) Π—Π° Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ ΠΎΡ‚Π²Π΅Ρ‡Π°ΡŽΡ‚ сСрвисы

Istio Π΄Π΅Π»Π°Π΅Ρ‚ ΠΎΡΠ½ΠΎΠ²Π½ΡƒΡŽ Ρ€Π°Π±ΠΎΡ‚Ρƒ, Ρ‚.ΠΊ. Π³Π΅Π½Π΅Ρ€ΠΈΡ€ΡƒΠ΅Ρ‚ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ для входящих запросов, создаёт Π½ΠΎΠ²Ρ‹Π΅ span'Ρ‹ Π² ΠΊΠ°ΠΆΠ΄ΠΎΠΌ sidecare'Π΅ ΠΈ пробрасываСт ΠΈΡ…. Однако Π±Π΅Π· Ρ€Π°Π±ΠΎΡ‚Ρ‹ с Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠ°ΠΌΠΈ Π²Π½ΡƒΡ‚Ρ€ΠΈ сСрвисов ΠΏΠΎΠ»Π½Ρ‹ΠΉ ΠΏΡƒΡ‚ΡŒ трассировки запроса Π±ΡƒΠ΄Π΅Ρ‚ утСрян.

НСобходимо ΡƒΡ‡ΠΈΡ‚Ρ‹Π²Π°Ρ‚ΡŒ (ΠΏΡ€ΠΎΠ±Ρ€Π°ΡΡ‹Π²Π°Ρ‚ΡŒ) ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠ΅ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ:

x-request-id
x-b3-traceid
x-b3-spanid
x-b3-parentspanid
x-b3-sampled
x-b3-flags
x-ot-span-context

Π­Ρ‚ΠΎ нСслоТная Π·Π°Π΄Π°Ρ‡Π°, ΠΎΠ΄Π½Π°ΠΊΠΎ для упрощСния Π΅Ρ‘ Ρ€Π΅Π°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ ΡƒΠΆΠ΅ сущСствуСт мноТСство Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊ β€” Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, Π² сСрвисС sa-web-app ΠΊΠ»ΠΈΠ΅Π½Ρ‚ RestTemplate пробрасываСт эти Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ, Ссли просто Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ Π±ΠΈΠ±Π»ΠΈΠΎΡ‚Π΅ΠΊΠΈ Jaeger ΠΈ OpenTracing Π² Π΅Π³ΠΎ зависимости.

Π—Π°ΠΌΠ΅Ρ‚ΡŒΡ‚Π΅, Ρ‡Ρ‚ΠΎ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Sentiment Analysis дСмонстрируСт Ρ€Π΅Π°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ Π½Π° Flask, Spring ΠΈ ASP.NET Core.

Π’Π΅ΠΏΠ΅Ρ€ΡŒ, ΠΊΠΎΠ³Π΄Π° стало ясно, Ρ‡Ρ‚ΠΎ ΠΌΡ‹ ΠΏΠΎΠ»ΡƒΡ‡Π°Π΅ΠΌ ΠΈΠ· ΠΊΠΎΡ€ΠΎΠ±ΠΊΠΈ (ΠΈΠ»ΠΈ ΠΏΠΎΡ‡Ρ‚ΠΈ Β«ΠΈΠ· ΠΊΠΎΡ€ΠΎΠ±ΠΊΠΈΒ»), рассмотрим вопросы Ρ‚ΠΎΠ½ΠΊΠΎ настраиваСмой ΠΌΠ°Ρ€ΡˆΡ€ΡƒΡ‚ΠΈΠ·Π°Ρ†ΠΈΠΈ, управлСния сСтСвым Ρ‚Ρ€Π°Ρ„ΠΈΠΊΠΎΠΌ, бСзопасности ΠΈ Ρ‚.ΠΏ.!

ΠŸΡ€ΠΈΠΌ. ΠΏΠ΅Ρ€Π΅Π².: ΠΎΠ± этом Ρ‡ΠΈΡ‚Π°ΠΉΡ‚Π΅ Π² ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅ΠΉ части ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»ΠΎΠ² ΠΏΠΎ Istio ΠΎΡ‚ Rinor Maloku, ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄Ρ‹ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… ΠΏΠΎΡΠ»Π΅Π΄ΡƒΡŽΡ‚ Π² нашСм Π±Π»ΠΎΠ³Π΅ Π² блиТайшСС врСмя. UPDATE (14 ΠΌΠ°Ρ€Ρ‚Π°): Вторая Ρ‡Π°ΡΡ‚ΡŒ ΡƒΠΆΠ΅ ΠΎΠΏΡƒΠ±Π»ΠΈΠΊΠΎΠ²Π°Π½Π°.

P.S. ΠΎΡ‚ ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄Ρ‡ΠΈΠΊΠ°

Π§ΠΈΡ‚Π°ΠΉΡ‚Π΅ Ρ‚Π°ΠΊΠΆΠ΅ Π² нашСм Π±Π»ΠΎΠ³Π΅:

Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ: habr.com

route:
- destination:
host: sa-frontend # 2
port:
number: 80

Important points:

  1. This VirtualService refers to requests coming through http-gateway;
  2. Π’ destination defines the service to which the requests are sent.

Note: The configuration above is stored in a file sa-virtualservice-external.yaml, which also contains settings for routing to SA-WebApp and SA-Feedback, but has been shortened here in the article for brevity.

Apply VirtualService by calling:


Note: When we apply Istio resources, the Kubernetes API Server fires an event that the Istio Control Plane receives, and after that the new configuration is applied to each pod's Envoy proxy. And the Ingress Gateway controller appears to be another Envoy configured in the Control Plane. All this looks like this in the diagram:

Back to microservices with Istio. Part 1
Istio-IngressGateway configuration for request routing

Sentiment Analysis is now available on http://{EXTERNAL-IP}/. Don't worry if you get Not Found status: sometimes it takes a little longer for the configuration to take effect and for the Envoy caches to update.

Before proceeding, play a little with the application to generate traffic (its presence is necessary for clarity in subsequent actions - approx. transl.).

Kiali: observability

To get to the Kiali admin interface, run the following command:


…and open http://localhost:20001/by logging in as admin/admin. Here you will find many useful features, for example, to check the configuration of Istio components, visualize services from information collected by intercepting network requests, get answers to the questions β€œWho is contacting whom?”, β€œWhich version of the service is experiencing failures?” and so on. In general, explore the possibilities of Kiali before moving on to visualizing metrics with Grafana.

Back to microservices with Istio. Part 1

Grafana: visualization of metrics

The metrics collected in Istio end up in Prometheus and are visualized with Grafana. To get to the Grafana admin interface, run the command below, then open http://localhost:3000/:


By clicking on the menu Home top left and select Istio Service Dashboard in the top left corner, start with service sa-web-appto view the collected metrics:

Back to microservices with Istio. Part 1

Here we are waiting for an empty and completely boring performance - management will never approve of this. Let's create a small load with the following command:


Now we have much prettier graphs, and in addition to them, the wonderful tools Prometheus for monitoring and Grafana for visualizing metrics, which will allow us to learn about performance, health status, improvements / degradation in services over time.

Finally, let's look at request tracing in services.

Jaeger: tracing

We will need tracing, because the more services we have, the more difficult it is to get to the cause of the failure. Let's look at a simple case from the picture below:

Back to microservices with Istio. Part 1
Typical example of a random failed request

Request comes, falls - what is the reason? First service? Or second? There are exceptions in both - let's look at the logs of each. How often have you caught yourself doing this? Our job is more like software detectives than developers…

This is a widespread problem in microservices and is solved by distributed tracing systems, in which services pass a unique header to each other, after which this information is redirected to the tracing system, where it is compared with the request data. Here is an illustration:

Back to microservices with Istio. Part 1
TraceId is used to identify the request

Istio uses Jaeger Tracer, which implements a vendor-independent OpenTracing API framework. You can access the Jaeger user interface with the following command:


Now go to http://localhost:16686/ and select a service sa-web-app. If the service is not shown in the dropdown menu, show/generate activity on the page and update the interface. After that click on the button Find traces, which will show the most recent traces - select any - detailed information on all traces will appear:

Back to microservices with Istio. Part 1

This trace shows:

  1. The request comes in istio-ingressgateway (this is the first interaction with one of the services, and a Trace ID is generated for the request), after which the gateway sends the request to the service sa-web-app.
  2. In the service sa-web-app the request is picked up by the Envoy sidecar, a "child" is created in the span (that's why we see it in traces) and redirected to the container sa-web-app. (Team - a logical unit of work in Jaeger, having a name, the start time of the operation and its duration. Spans can be nested and ordered. A directed acyclic graph of spans forms a trace. - approx. transl.)
  3. Here the request is processed by the method sentimentAnalysis. These traces are already generated by the application, i.e. they required code changes.
  4. From this moment, a POST request is initiated in sa-logic. Trace ID must be forwarded from sa-web-app.
  5. ...

Note: In step 4, the application should see the headers generated by Istio and pass them to subsequent requests, as shown in the image below:

Back to microservices with Istio. Part 1
(A) Header forwarding is the responsibility of Istio; (B) Services are responsible for headers

Istio does the bulk of the work because generates headers for incoming requests, creates new spans in each sidecare and forwards them. However, without working with headers inside services, the full request trace path will be lost.

The following headers must be considered (forwarded):


This is a simple task, but to simplify its implementation, there is already many libraries - for example, in the sa-web-app service, the RestTemplate client forwards these headers if you simply add the Jaeger and OpenTracing libraries to its dependencies.

Note that the Sentiment Analysis application demonstrates implementations in Flask, Spring, and ASP.NET Core.

Now that it's clear what we're getting out of the box (or almost out of the box), let's look at fine-tuning routing, network traffic management, security, and more!

Note. transl.: read about this in the next part of the materials on Istio from Rinor Maloku, the translations of which will follow on our blog in the near future. UPDATED (March 14th): The second part already published.

PS from translator

Read also on our blog:

Source: habr.com