Skip to content

Instantly share code, notes, and snippets.

@adleong
Created October 31, 2022 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adleong/adde7854f9cad5aa53c73112e02911b2 to your computer and use it in GitHub Desktop.
Save adleong/adde7854f9cad5aa53c73112e02911b2 to your computer and use it in GitHub Desktop.
# Step 1: Install Linkerd
# Step 2: Install Linkerd Viz (optional, but helpful for seeing what's going on)
# Step 3: Install Linkerd Jaeger
# Step 4: Install Nginx Ingress:
linkerd inject https://gist.githubusercontent.com/adleong/f7318d9282ab99ba12c3479405882e60/raw/713daaa51f035d0d484ea79daf77cc3aaded8010/yml | kubectl apply -f -
# Notice the tracing related config in the nginx config configmap in the aboe gist: https://gist.github.com/adleong/f7318d9282ab99ba12c3479405882e60#file-yml-L340
# Step 5: Install Emojivoto
linkerd inject https://gist.githubusercontent.com/adleong/d6dd9636a10042a4eb1696361ef14b67/raw/937c5cab78d2b79908600f8e11fbb9bc869fd82e/gistfile1.txt | kubecctl apply -f -
# Notice the env variables have been updated in the above gist https://gist.github.com/adleong/d6dd9636a10042a4eb1696361ef14b67
# OC_AGENT_HOST has been set to collector.linkerd-jaeger:55678 for all deployments
# WEB_HOST has been set to ingress-nginx-controller.ingress-nginx:80 so that vote-bot sends to the nginx ingress
# Step 6: Create an Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
namespace: emojivoto
spec:
ingressClassName: nginx
rules:
- http:
paths:
- backend:
service:
name: web-svc
port:
number: 80
path: /
pathType: Prefix
# Now traffic should be flowing vote-bot => nginx-ingress => web => emoji/voting
# with nginx-ingress adding the x-b3 headers and spans being reported to the collector from nginx-ingress, linkerd-proxy, and web
# Validate the x-b3 heaers are being set:
linkerd tap -o json -n ingress-nginx deploy/ingress-nginx-controller
# Validate traces are in jaeger
linkerd jaeger dashboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment