Hey guys! Have a question about routing using headers.
Right now I’ve configured a dtab based on a marathon namer and a
/$/io.buoyant.http.domainToPathPfx rewriting namer. I do want to save this config, but add an identifier - or any other module/block - to route requests using a custom header key, let’s call it
x-app-route. I want Linkerd to extract the value of this header and somehow route it to the (Marathon) namer in the dtab, which will resolve it to the right bound name.
I’m not sure what’s the proper way of achieving this. Right now I’ve tried using an identifier from kind
io.l5d.header.token, with a token configured for
x-app-route already mentioned. My dtab looks something like that:
/domain/<DOMAIN_SEGMENTS> => /#/io.l5d.marathon; /app-route/<DOMAIN_SEGMENTS> => /#/io.l5d.marathon; /host => /$/io.buoyant.http.domainToPathPfx/domain; /host => /$/io.buoyant.http.domainToPathPfx/app-route/x-app-route; /svc => /host;
So I was hoping that Linkerd would take the header token (key=x-app-route, value=bound name) using the identifier and resolve it to
/domain/name/and/segments/bound-name using the dtab posted above.
Was I wrong? Is there a smarter way of doing it? Would be glad to know Thanks!