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 yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
settings. -
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
Running
state:kubectl get pods | grep jaeger
-
Find out the name of the
jaeger-ydb-store-agent
service:kubectl get svc | grep ydb-store-agent
Result:
<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.yaml
containing 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
hotrod
application:kubectl apply -f hotrod.yaml
-
Make sure the
hotrod
pods have entered theRunning
state:kubectl get pods | grep hotrod
Test Jaeger
-
Find out the name of the
jaeger-ydb-store-query
service:kubectl get svc | grep jaeger-ydb-store-query
Result:
<name_of_jaeger-ydb-store-query_application> LoadBalancer 10.2.222.155 130.133.51.247 16686:31189/TCP ...
-
Configure
jaeger-ydb-store-query
port 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
hotrod
application to the local computer:kubectl port-forward hotrod 8080:8080
-
Open the URI of the
hotrod
application 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.