New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add specific host transformer #1355

Merged
merged 1 commit into from Jun 7, 2017

Conversation

Projects
None yet
4 participants
@d10i

d10i commented Jun 2, 2017

Problem
When deploying linkerd in a linker-to-linker + per-host configuration
(i.e. one linkerd container per machine with an incoming router and
outgoing router), the incoming router needs to be able to route the
incoming request to the destination container running on the same
Docker host (i.e. machine).

The destination app container is likely to be registered against
the namer using the IP address of the Docker host it is running on and
the port that is exposed in its Docker container. The problem is that
the incoming router is unaware of the IP address of the Docker host it's
running on so won't know which of the resolved names live on the same
Docker host.

At the moment there is no transformer that can solve this problem as
io.l5d.localhost will only look at network interfaces inside the
Docker container while io.l5d.k8s.daemonset and io.l5d.k8s.localnode
are k8s-specific.

Solution
The specific host transformer filters the list of addresses down to only
addresses that have the same IP address as the specified host. This
transformer can be used by an incoming router to only route traffic to
specific destinations. This way, when linkerd is running inside a Docker
container the traffic can be routed to another Docker container in the
same host.

Add specific host transformer
**Problem**
When deploying linkerd in a linker-to-linker + per-host configuration
(i.e. one linkerd container per machine with an incoming router and
outgoing router), the incoming router needs to be able to route the
incoming request to the destination container running on the same
Docker host (i.e. machine).

The destination app container is likely to be registered against
the namer using the IP address of the Docker host it is running on and
the port that is exposed in its Docker container. The problem is that
the incoming router is unaware of the IP address of the Docker host it's
running on so won't know which of the resolved names live on the same
Docker host.

At the moment there is no transformer that can solve this problem as
`io.l5d.localhost` will only look at network interfaces inside the
Docker container while `io.l5d.k8s.daemonset` and `io.l5d.k8s.localnode`
are k8s-specific.

**Solution**

The specific host transformer filters the list of addresses down to only
addresses that have the same IP address as the specified host. This
transformer can be used by an incoming router to only route traffic to
specific destinations. This way, when linkerd is running inside a Docker
container the traffic can be routed to another Docker container in the
same host.
@wmorgan

This comment has been minimized.

Show comment
Hide comment
@wmorgan

wmorgan Jun 2, 2017

Member

@dario-simonetti Thank you! We'll take a look!

Member

wmorgan commented Jun 2, 2017

@dario-simonetti Thank you! We'll take a look!

@klingerf klingerf added the reviewable label Jun 5, 2017

@adleong

adleong approved these changes Jun 6, 2017

This is great and very useful! Thank you!

@adleong adleong merged commit 6973860 into linkerd:master Jun 7, 2017

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

elecnix added a commit to elecnix/linkerd that referenced this pull request Sep 21, 2017

Add specific host transformer (linkerd#1355)
**Problem**
When deploying linkerd in a linker-to-linker + per-host configuration
(i.e. one linkerd container per machine with an incoming router and
outgoing router), the incoming router needs to be able to route the
incoming request to the destination container running on the same
Docker host (i.e. machine).

The destination app container is likely to be registered against
the namer using the IP address of the Docker host it is running on and
the port that is exposed in its Docker container. The problem is that
the incoming router is unaware of the IP address of the Docker host it's
running on so won't know which of the resolved names live on the same
Docker host.

At the moment there is no transformer that can solve this problem as
`io.l5d.localhost` will only look at network interfaces inside the
Docker container while `io.l5d.k8s.daemonset` and `io.l5d.k8s.localnode`
are k8s-specific.

**Solution**

The specific host transformer filters the list of addresses down to only
addresses that have the same IP address as the specified host. This
transformer can be used by an incoming router to only route traffic to
specific destinations. This way, when linkerd is running inside a Docker
container the traffic can be routed to another Docker container in the
same host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment