Expose Chaos Dashbaord with Ingress

At times, you may need to make the Chaos Dashboard accessible to external users, while placing it under the subpath of your current monitoring dashboard.

Below is an example of how to expose the Chaos Dashboard under the path /chaos-mesh:

  1. apiVersion: networking.k8s.io/v1
  2. kind: Ingress
  3. metadata:
  4. name: ingress-chaos-dashboard-under-subpath
  5. namespace: chaos-mesh
  6. annotations:
  7. nginx.ingress.kubernetes.io/use-regex: 'true'
  8. nginx.ingress.kubernetes.io/rewrite-target: /$1
  9. nginx.ingress.kubernetes.io/configuration-snippet: |
  10. sub_filter '<head>' '<head> <base href="/chaos-mesh/">';
  11. spec:
  12. rules:
  13. - http:
  14. paths:
  15. - path: /chaos-mesh/?(.*)
  16. pathType: Prefix
  17. backend:
  18. service:
  19. name: chaos-dashboard
  20. port:
  21. number: 2333

You can also find this example in https://github.com/chaos-mesh/chaos-mesh/blob/master/examples/dashboard/ingress-subpath.yaml.