Linker-to-linker setup issue

Hi guys.

I have a docker compose file with consul, consul-registrator, linkerd and an http service running on port 8080 that simply returns ‘hello’ (‘SERVICE_NAME=hello’). Below is the linkerd.yml.

namers:
- kind: io.l5d.consul
  host: consul
  port: 8500
routers:
- protocol: http
  label: outgoing
  dstPrefix: /out
  identifier:
   kind: io.l5d.path
   segments: 1
   consume: true
  dtab: |
    /out => /#/io.l5d.consul/dc1;
  servers:
  - port: 4140
    ip: 0.0.0.0
  client:
  interpreter:
    kind: default
    transformers:
    - kind: io.l5d.port
      port: 4141
- protocol: http
  label: incoming
  dstPrefix: /in
  identifier:
    kind: io.l5d.header
    header: l5d-dst-service
  dtab: |
      /in/out => /#/io.l5d.consul/dc1;
  servers:
  - port: 4141
    ip: 0.0.0.0
  interpreter:
    kind: default
    transformers:
     - kind: io.l5d.localhost

With this configuration, the outgoing router should transform the request port to 4141, which then was supposed to be sent/forwarded to the incoming router (listening on port 4141).

However, the request ‘curl localhost:4140/hello’ returns the following (172.23.0.3 is the ‘hello’ container address):

Connection refused: /172.23.0.3:4141. Remote Info: Upstream Address: /172.23.0.1:33780, Upstream Client Id: Not Available, Downstream Address: /172.23.0.3:4141, Downstream Client Id: %/io.l5d.port/4141/#/io.l5d.consul/dc1/hello

The request is being sent to the resolved service (by consul) instead for being ‘forwarded’ to the incoming router. What am I missing? did I not fully understand how linker-to-linker works?

Thanks.

Hi,

Thanks for providing additional context including the config. This config is set up as if Linkerd is running as a sidecar, but there isn’t anything listening on port 4141 in the hello container. If you remove the transformer from your config, your setup should work (just not as a linker to linker setup).

Linker to linker might be tricky to set up in a docker-compose environment. For linker to linker you’ll need an environment that allows for the grouping of services, which I am not sure docker-compose is well equipped for.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.