Traefik Intress用于外部服务故障排除

发布于 2025-02-04 04:42:37 字数 829 浏览 3 评论 0原文

请一点帮助。

我试图让Traefik充当实验室中所有内容的入学,K8S托管了Docker主机上托管的POD/Services和外部服务。

我已经为要达到的服务创建了一个外部服务对象:

kind: Service
metadata:
  name: whoami
  namespace: default
spec:
  type: ExternalName
  externalName: ha.local.lan
  ports:
   - name: http
     port : 49153
     targetPort: 49153

然后,我为该服务创建了一个IngressRoute对象:

kind: IngressRoute
metadata:
  name: whoami
  #namespace: default
spec:
#  tls: {}
  entryPoints:
    - web
  routes:
    - kind: Rule
      match: Host(`whoami.local.lan`) && PathPrefix(`/`)
      services:
    # The service name and port must match the Service
    # specified in the deploy file
      - name: whoami
        port: 49153

路由器出现在Traefik中,但是流量的路由到端口49153似乎不起作用。我可以达到DNS名称,但是我仍然必须将端口添加到我的URL中才能到达站点。

我在这里错过了什么吗?

Need a little assistance please.

I'm trying to get Traefik to act as an ingress for everything in my lab, both K8s hosted pods/services and external services hosted on a Docker host.

I have created an external service object for the service I want to reach:

kind: Service
metadata:
  name: whoami
  namespace: default
spec:
  type: ExternalName
  externalName: ha.local.lan
  ports:
   - name: http
     port : 49153
     targetPort: 49153

then, I have created an IngressRoute object for that service:

kind: IngressRoute
metadata:
  name: whoami
  #namespace: default
spec:
#  tls: {}
  entryPoints:
    - web
  routes:
    - kind: Rule
      match: Host(`whoami.local.lan`) && PathPrefix(`/`)
      services:
    # The service name and port must match the Service
    # specified in the deploy file
      - name: whoami
        port: 49153

The router appears in Traefik just fine, but the routing of the traffic to port 49153 doesn't seem to work. I can reach the dns name, but I still have to add the port to my URL to reach the site.

Have I missed something here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文