如何使用Kubernetes Ingress揭露Traefik V2仪表板

发布于 2025-02-13 15:57:13 字数 713 浏览 1 评论 0原文

目前,我使用 traefik infressRoute 露出Traefik仪表板。我正在使用此配置:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-dashboard
  namespace: my-namespace
spec:
  routes:
  - match: Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
    kind: Rule
    services:
    - name: api@internal
      kind: TraefikService
    middlewares:
      - name: traefik-dashboard-https-redirect
      - name: traefik-dashboard-basic-auth
  tls:
    certResolver: le

它可以正常工作。

但是,我想用本机 kubernetes入口来揭露它。我找不到任何资源,这些资源显示如何从入口访问api@internal。有可能吗?

Currently I use Traefik IngressRoute to expose the Traefik dashboard. I am using this configuration:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: traefik-dashboard
  namespace: my-namespace
spec:
  routes:
  - match: Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
    kind: Rule
    services:
    - name: api@internal
      kind: TraefikService
    middlewares:
      - name: traefik-dashboard-https-redirect
      - name: traefik-dashboard-basic-auth
  tls:
    certResolver: le

and it works fine.

However I would like to expose it with a native Kubernetes Ingress. I can't find any resource which shows how to access api@internal from an Ingress. Is it even possible?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自控 2025-02-20 15:57:13

不可能从入口引用内部。

我认为有一个解决方法,可能是:

  • 将API公开为不安全,它默认情况下在端口8080上的traefik上露出仪表板
  • 。 < what-you-want>
  • 创建指向Traefik入口点的服务(默认情况下为端口8080)。
  • 创建指向服务的入口

It is not possible to reference api@internal from an Ingress.

There is a workaround I think, which could be:

  • expose the api as insecure, it exposes the dashboard by default on an entrypoint called traefik on port 8080.
  • update the entrypoint manually in the static conf: entrypoints.traefik.address=<what-you-want>
  • create a service pointing to the traefik entrypoint (port 8080 by default).
  • create an ingress pointing to the service
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文