This tutorial will guide you through the process of deploying Jaeger on Kubernetes, assuming that you already have K3s and Helm installed in your environment. Tracing and monitoring are essential in the world of microservices and distributed systems for preserving the functionality and performance of your applications. Jaeger, an end-to-end distributed tracing system, is one such tool that has grown in popularity in recent years.
Before we get started with the deployment procedure, let’s quickly go over what Jaeger and Kubernetes are and why they work so well together.
Jaeger is an open-source, end-to-end distributed tracing system that helps developers monitor and troubleshoot complex, microservices-based architectures. It was created by Uber Technologies and is now a part of the Cloud Native Computing Foundation.
Jaeger offers a scalable and user-friendly solution for managing and analyzing traces when it is deployed on Kubernetes, making it simpler for developers to understand the behavior of their applications and locate performance bottlenecks.
Preparing for Deployment
Before deploying Jaeger on Kubernetes, ensure that your system meets the following requirements:
- A running Virtono Kubernetes cluster (In our case we will use K3s), you can find the installation guide here
- Sufficient system resources for running Jaeger and your microservices
Deploying Jaeger on Kubernetes
First, we need to add the Jaeger’s Helm chart repository to our Helm client. Run the following command:
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
Next, update your Helm repository to ensure you have the latest charts:
helm repo update
Now, we’ll install the Jaeger Operator using Helm. The Jaeger Operator is a Kubernetes operator that provides a means to deploy and manage Jaeger instances.
First, create a namespace for the cert-manager:
kubectl create namespace cert-manager
Add the Jetstack Helm repository:
helm repo add jetstack https://charts.jetstack.io
Update your local Helm chart repository cache:
helm repo update
Install the cert-manager Helm chart:
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.7.1 \
--set installCRDs=true
Install Jaeger Operator:
helm install jaeger-operator jaegertracing/jaeger-operator
Verify the installation of the Jaeger Operator by running the following command:
kubectl get pods
You should see the Jaeger Operator pod running in the output.
Deploy Jaeger on Kubernetes Instance
Finally, we’ll deploy a Jaeger instance using the Jaeger Operator. Create a YAML file named jaeger-instance.yaml
with the following content:
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: simple-prod
Then, apply this configuration using kubectl:
kubectl apply -f jaeger-instance.yaml
Accessing the Jaeger UI
Once the Jaeger instance is deployed, you can access the Jaeger UI by forwarding the Jaeger-query service port. Run the following command:
kubectl port-forward service/simple-prod-query 16686:16686
Now, you can open your browser and navigate to localhost:16686
to access the Jaeger UI.
Final Thoughts
A reliable and scalable method for tracing microservices-based applications is to deploy Jaeger on Kubernetes. Jaeger enables you to gain profound insights into the behavior of your applications, facilitating problem-solving and performance enhancement. Remember, this guide assumes you have a basic understanding of Kubernetes and Helm. If you’re new to these technologies, I recommend familiarizing yourself with their concepts and terminologies before proceeding with the deployment of Jaeger on Kubernetes.
0 Comments