简体   繁体   English

使用namerd进行DNS? (或者:如何使用Linkerd配置Nginx入口服务)

[英]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 . 我目前在/svc/hello上部署了hello world服务,并且已将dentry作为/svc/app => /svc/hello添加到我的namerd internal dtab中。

I've also deployed an nginx service that will serve as my ingress controller, and forward all traffic to the relevant services. 我还部署了一个nginx服务,它将用作我的入口控制器,并将所有流量转发到相关服务。 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: 最终它将进行标头剥离,仅将管理服务仅向列入白名单的ip范围中的开发人员公开,但是到目前为止,我使用以下配置使其非常简单:

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

However, those nginx pods fail to start, with the error 但是,这些nginx容器无法启动,并显示以下错误

nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/default.conf:3 nginx:在/etc/nginx/conf.d/default.conf:3的上游“应用”中找不到[emerg]主机

What do I need to do to get the nginx services to be able to forward to the app service via linkerd? 我需要做什么才能使nginx服务能够通过linkerd转发到应用程序服务?

I'am not sure that this is possible, use linkerd with nginx ingress. 我不确定这是否可行,请将linkerd与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. 看看这种情况, https://buoyant.io/2017/04/06/a-service-mesh-for-kubernetes-part-viii-linkerd-as-an-ingress-controller/也许可以为您提供帮助。

I was actually able to solve this by looking at a different post in the same series as what Girgoriev Nick shared : 通过查看Girgoriev Nick分享 的同一系列中的另一篇 文章,我实际上能够解决此问题:

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

That address does cluster-local name resolution in Kubernetes, and successfully finds the Linkerd service. 该地址在Kubernetes中执行集群本地名称解析,并成功找到Linkerd服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM