mirror of https://github.com/linkerd/linkerd2.git
* Jaeger injector mutating webhook Closes #5231. This is based off of the `alex/sep-tracing` branch. This webhook injects the `LINKERD2_PROXY_TRACE_COLLECTOR_SVC_ADDR`, `LINKERD2_PROXY_TRACE_COLLECTOR_SVC_NAME` and `LINKERD2_PROXY_TRACE_ATTRIBUTES_PATH` environment vars into the proxy spec when a pod is created, as well as the podinfo volume and its mount. If any of these are found to be present already in the pod spec, it exits without applying a patch. The `values.yaml` file has been expanded to include config for this webhook. In particular, one can define a `namespaceSelector` and/or a `objectSelector` to filter which pods will this webhook act on. The config entries in `values.yam` for `collectorSvcAddr` and `collectorSvcAccount` can be overriden with the `config.linkerd.io/trace-collector` and `config.alpha.linkerd.io/trace-collector-service-account` annotation at the namespace or pod spec level. ## How to test: ```bash docker build . -t ghcr.io/linkerd/jaeger-webhook:0.0.1 -f jaeger/proxy-mutator/Dockerfile k3d image import ghcr.io/linkerd/jaeger-webhook:0.0.1 bin/helm-build linkerd install helm install jaeger jaeger/charts/jaeger linkerd inject https://run.linkerd.io/emojivoto.yml | kubectl apply -f - kubectl -n emojivoto get po -l app=emoji-svc -oyaml | grep -A1 TRACE ``` ## Reinvocation policy The webhookconfig resource is configured with `reinvocationPolicy: IfNeeded` so that if the tracing injector gets triggered before the proxy injector, it will get triggered a second time after the proxy injector runs so it can act on the injected proxy. By default this won't be necessary because the webhooks run in alphabetical order (this is not documented in k8s docs though) so `linkerd-proxy-injector-webhook-config` will run before `linkerd-proxy-mutator-webhook-config`. In order to test the reinvocation mechanism, you can change the name of the former so it gets called first. I versioned the webhook image as `0.0.1`, but we can decide to align that with linkerd's main version tag. |
||
---|---|---|
.. | ||
win | ||
_docker.sh | ||
_log.sh | ||
_os.sh | ||
_release.sh | ||
_tag.sh | ||
_test-helpers.sh | ||
build-cli-bin | ||
certs-openssl | ||
create-release-tag | ||
docker | ||
docker-build | ||
docker-build-cli-bin | ||
docker-build-cni-plugin | ||
docker-build-controller | ||
docker-build-debug | ||
docker-build-grafana | ||
docker-build-jaeger-webhook | ||
docker-build-proxy | ||
docker-build-web | ||
docker-cache-prune | ||
docker-images | ||
docker-pull | ||
docker-pull-binaries | ||
docker-push | ||
docker-retag-all | ||
docker-test-proxy | ||
fetch-proxy | ||
fmt | ||
git-commit-proxy-version | ||
go-run | ||
goimports | ||
helm | ||
helm-build | ||
image-load | ||
install-deps | ||
install-pr | ||
k3d | ||
kind | ||
kubectl | ||
linkerd | ||
lint | ||
markdownlint | ||
markdownlint-all | ||
minikube-start-hyperv.bat | ||
mkube | ||
protoc | ||
protoc-diff | ||
protoc-go.sh | ||
root-tag | ||
shellcheck | ||
shellcheck-all | ||
test-cleanup | ||
test-clouds | ||
test-clouds-cleanup | ||
test-scale | ||
tests | ||
update-codegen.sh | ||
web |