Search code examples
nginxkuberneteslinkerd

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


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?


Solution

  • 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.