I’m currently running linkerd
as a daemon set in my K8S cluster for testing w/ great success. Thank you for a great project! I am a bit confused, however, about how I can support multiple namespaces w/out having to run multiple daemon sets. I am wanting linkerd
to route requests between my gRPC services, but only w/in the same namespace, so I can maintain separation between my test and production namespaces.
Which of the following config files is the correct approach? I’ve tried the first one, but it borked comms in my current test namespace so I backed it out. I have not tried the second one yet.
This config uses the same namer with separate transformers of the same kind for each namespace, and has router configs for each namespace.
admin:
ip: 0.0.0.0
port: 9990
namers:
- kind: io.l5d.k8s
- kind: io.l5d.k8s
prefix: /io.l5d.k8s.grpc
transformers:
- kind: io.l5d.k8s.daemonset
namespace: linkerd
port: grpc-incoming-test
service: l5d
- kind: io.l5d.k8s.daemonset
namespace: linkerd
port: grpc-incoming-prod
service: l5d
routers:
- label: grpc-outgoing-test
protocol: h2
experimental: true
servers:
- port: 4340
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
dtab: |
/hp => /$/inet ;
/svc => /$/io.buoyant.hostportPfx/hp ;
/srv => /#/io.l5d.k8s.grpc/test/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
client:
kind: io.l5d.static
configs:
- prefix: "/$/inet/{service}"
tls:
commonName: "{service}"
- label: gprc-incoming-test
protocol: h2
experimental: true
servers:
- port: 4341
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
interpreter:
kind: default
transformers:
- kind: io.l5d.k8s.localnode
dtab: |
/srv => /#/io.l5d.k8s/test/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
- label: grpc-outgoing-prod
protocol: h2
experimental: true
servers:
- port: 4350
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
dtab: |
/hp => /$/inet ;
/svc => /$/io.buoyant.hostportPfx/hp ;
/srv => /#/io.l5d.k8s.grpc/prod/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
client:
kind: io.l5d.static
configs:
- prefix: "/$/inet/{service}"
tls:
commonName: "{service}"
- label: gprc-incoming-prod
protocol: h2
experimental: true
servers:
- port: 4351
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
interpreter:
kind: default
transformers:
- kind: io.l5d.k8s.localnode
dtab: |
/srv => /#/io.l5d.k8s/prod/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
This config uses a separate namer for each namespace and has router configs for each namespace that use the prefix defined in the namer.
admin:
ip: 0.0.0.0
port: 9990
namers:
- kind: io.l5d.k8s
- kind: io.l5d.k8s
prefix: /io.l5d.k8s.grpc-test
transformers:
- kind: io.l5d.k8s.daemonset
namespace: linkerd
port: grpc-incoming-test
service: l5d
- kind: io.l5d.k8s
prefix: /io.l5d.k8s.grpc-prod
transformers:
- kind: io.l5d.k8s.daemonset
namespace: linkerd
port: grpc-incoming-prod
service: l5d
routers:
- label: grpc-outgoing-test
protocol: h2
experimental: true
servers:
- port: 4340
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
dtab: |
/hp => /$/inet ;
/svc => /$/io.buoyant.hostportPfx/hp ;
/srv => /#/io.l5d.k8s.grpc-test/test/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
client:
kind: io.l5d.static
configs:
- prefix: "/$/inet/{service}"
tls:
commonName: "{service}"
- label: gprc-incoming-test
protocol: h2
experimental: true
servers:
- port: 4341
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
interpreter:
kind: default
transformers:
- kind: io.l5d.k8s.localnode
dtab: |
/srv => /#/io.l5d.k8s/test/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
- label: grpc-outgoing-prod
protocol: h2
experimental: true
servers:
- port: 4350
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
dtab: |
/hp => /$/inet ;
/svc => /$/io.buoyant.hostportPfx/hp ;
/srv => /#/io.l5d.k8s.grpc-prod/prod/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
client:
kind: io.l5d.static
configs:
- prefix: "/$/inet/{service}"
tls:
commonName: "{service}"
- label: gprc-incoming-prod
protocol: h2
experimental: true
servers:
- port: 4351
ip: 0.0.0.0
identifier:
kind: io.l5d.header.path
segments: 1
interpreter:
kind: default
transformers:
- kind: io.l5d.k8s.localnode
dtab: |
/srv => /#/io.l5d.k8s/prod/grpc ;
/svc => /$/io.buoyant.http.domainToPathPfx/srv ;
Please help!