Using namerd for DNS? (Or: how to configure an nginx ingress service with Linkerd)

2/22/2018

I currently have a hello world service deployed on /svc/hello, and I've added a dentry to my namerd internal dtab as /svc/app => /svc/hello.

I've also deployed an nginx service that will serve as my ingress controller, and forward all traffic to the relevant services. Eventually it's going to do header stripping, exposing admin services only to developers in whitelisted ip ranges etc, but for now I've kept it really simple with the following config:

server {
  location / {
    proxy_pass http://app;
  }
}

However, those nginx pods fail to start, with the error

nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:3

What do I need to do to get the nginx services to be able to forward to the app service via linkerd?

-- Tomas Aschan
kubernetes
linkerd
nginx

2 Answers

2/22/2018

I was actually able to solve this by looking at a different post in the same series as what Girgoriev Nick shared:

proxy_pass http://l5d.default.svc.cluster.local;

That address does cluster-local name resolution in Kubernetes, and successfully finds the Linkerd service.

-- Tomas Aschan
Source: StackOverflow

2/22/2018

I'am not sure that this is possible, use linkerd with nginx ingress. Look on this case, https://buoyant.io/2017/04/06/a-service-mesh-for-kubernetes-part-viii-linkerd-as-an-ingress-controller/ May be it can help you.

-- Grigoriev Nick
Source: StackOverflow