How to Deploy jager to Kubernetes
Overview
When running services in a kubernetes cluster, it will be desirable to run tracing to see how the system works as a whole, and trace the flows between the microservices.
Install jaeger
We will deploy the jaeger operator.
helm repo add jaegertracing https://jaegertracing.github.io/helm-charts
helm repo updateBefore we can install the operator, we will need to install cert manager
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.yamlNow, we can install jaeger
helm install jaeger-op --set rbac.clusterRole=true jaegertracing/jaeger-operatorTo get this up and running, we will deploy a minimal install. We can make this more complicated in the future, but let’s get something working. This is the all-in-one configuration
jaeger.yaml
---
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: jaegerReconfigure Traefik
Now that we have jaeger up and running, we need to reconfigure traefik to connect to it. First, we will modify the helm values file
traefik-values.yaml
tracing:
jaeger:
samplingServerURL: http://jaeger-agent.default.svc:5778/sampling
localAgentHostPort: jaeger-agent.default.svc:6831We will now upgrade the helm chart
helm upgrade traefik traefik/traefik --values traefik-values.yamlConfigure jaeger
We will now need to add an ingress into jaeger so that we can view the web console
jaeger-ingress.yaml
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: jaeger-ingress
namespace: default
spec:
entryPoints:
- web
- websecure
routes:
- match: Host(`jaeger.weepynet.com`)
kind: Rule
services:
- name: jaeger-query
port: 16686
middlewares:
- name: redirect-httpsWe will add this ingress
kubectl apply -f jaeger-ingress.yaml