跳至主内容
版本:2.6.7

通过 Ingress 暴露 Chaos Dashboard

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

有时您可能需要让外部用户访问 Chaos Dashboard,同时将其部署在当前监控面板的子路径下。

以下示例展示了如何在 /chaos-mesh 路径下暴露 Chaos Dashboard:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-chaos-dashboard-under-subpath
namespace: chaos-mesh
annotations:
nginx.ingress.kubernetes.io/use-regex: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/configuration-snippet: |
sub_filter '<head>' '<head> <base href="/chaos-mesh/">';
spec:
rules:
- http:
paths:
- path: /chaos-mesh/?(.*)
pathType: Prefix
backend:
service:
name: chaos-dashboard
port:
number: 2333

您也可以在 https://github.com/chaos-mesh/chaos-mesh/blob/master/examples/dashboard/ingress-subpath.yaml 查看此配置示例。