Using Jaeger to trace requests in Managed Service for YDB
The Jaeger
In this article, you will learn how to install the Jaeger platform in a Managed Service for Kubernetes cluster and configure it to work with Yandex Managed Service for YDB:
- Install and configure Jaeger.
- Install a test application to create load on a Kubernetes cluster.
- Test Jaeger by making several test requests.
Required paid resources
The support cost includes:
- Fee for the Managed Service for Kubernetes cluster: using the master and outgoing traffic (see Managed Service for Kubernetes pricing).
- Cluster nodes (VM) fee: using computing resources, operating system, and storage (see Compute Cloud pricing).
- Fee for a public IP address assigned to cluster nodes (see Virtual Private Cloud pricing).
- Fee for a Managed Service for YDB database in Dedicated mode: using computing resources allocated to the database and disk space (see Managed Service for YDB pricing).
Getting started
-
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the
yc config set folder-id <folder_ID>command. You can also set a different folder for any specific command using the--folder-nameor--folder-idparameter. -
Create security groups for the Managed Service for Kubernetes cluster and its node groups.
Warning
The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.
-
Create a Managed Service for Kubernetes cluster and a node group in any suitable configuration. When creating them, specify the security groups prepared earlier.
-
Install kubect
and configure it to work with the new cluster.
Install and configure Jaeger
-
Install Jaeger over YDB from the Yandex Cloud Marketplace application catalog. When installing the application, select the default namespace (
default). -
Make sure that all the Jaeger pods have entered the
Runningstate:kubectl get pods | grep jaeger -
Find out the name of the
jaeger-ydb-store-agentservice:kubectl get svc | grep ydb-store-agentResult:
<jaeger-ydb-store-agent_application_name> ClusterIP 10.2.238.190 ...
Install a test application
To test Jaeger, use the HotROD
-
Create a manifest named
hotrod.yamlcontaining a description of the application:--- apiVersion: v1 kind: Pod metadata: name: hotrod spec: containers: - name: hotrod image: jaegertracing/example-hotrod:latest env: - name: JAEGER_AGENT_HOST value: "<jaeger-ydb-store-agent_application_name>.default.svc.cluster.local" - name: JAEGER_AGENT_PORT value: "6831" ports: - containerPort: 8080 - containerPort: 8081 - containerPort: 8082 - containerPort: 8083 -
Create a pod with the
hotrodapplication:kubectl apply -f hotrod.yaml -
Make sure the
hotrodpods have entered theRunningstate:kubectl get pods | grep hotrod
Test Jaeger
-
Find out the name of the
jaeger-ydb-store-queryservice:kubectl get svc | grep jaeger-ydb-store-queryResult:
<name_of_jaeger-ydb-store-query_application> LoadBalancer 10.2.222.155 130.133.51.247 16686:31189/TCP ... -
Configure
jaeger-ydb-store-queryport forwarding to the local computer:kubectl port-forward service/<name_of_jaeger-ydb-store-query_application> 16686:16686 -
In a different console window, configure port forwarding for the
hotrodapplication to the local computer:kubectl port-forward hotrod 8080:8080 -
Open the URI of the
hotrodapplication in your browser and make several test requests to Jaeger. -
Open Jaeger's URI in your browser.
Make sure that the test requests have been transmitted successfully and have been included in the trace.
Delete the resources you created
Delete the resources you no longer need to avoid paying for them:
- Delete the Managed Service for YDB database.
- Delete the Managed Service for Kubernetes cluster.
- Delete the cluster public static IP address if you reserved one.