ingress_rewrite.yaml_bak 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. apiVersion: networking.k8s.io/v1
  2. kind: Ingress
  3. metadata:
  4. name: obfront
  5. namespace: observe
  6. annotations:
  7. nginx.ingress.kubernetes.io/enable-cors: "true"
  8. nginx.ingress.kubernetes.io/cors-allow-origin: "*"
  9. nginx.ingress.kubernetes.io/proxy-cache: "true"
  10. nginx.ingress.kubernetes.io/proxy-cache-path: "/tmp/nginx-cache"
  11. nginx.ingress.kubernetes.io/proxy-cache-methods: "GET,HEAD,POST"
  12. nginx.ingress.kubernetes.io/proxy-cache-min_uses: "1"
  13. nginx.ingress.kubernetes.io/proxy-cache-lock: "on"
  14. nginx.ingress.kubernetes.io/proxy-cache-valid: "10m"
  15. nginx.ingress.kubernetes.io/proxy-cache-max-size: "100m"
  16. spec:
  17. rules:
  18. - host: observe-ui.cestong.com.cn
  19. http:
  20. paths:
  21. - path: /
  22. pathType: Prefix
  23. backend:
  24. service:
  25. name: obf
  26. port:
  27. number: 80
  28. ingressClassName: nginx
  29. ---
  30. apiVersion: networking.k8s.io/v1
  31. kind: Ingress
  32. metadata:
  33. name: obui
  34. namespace: observe
  35. annotations:
  36. nginx.ingress.kubernetes.io/rewrite-target: /$1
  37. spec:
  38. rules:
  39. - host: observe-ui.cestong.com.cn
  40. http:
  41. paths:
  42. - path: /top/(.*)
  43. pathType: Prefix
  44. backend:
  45. service:
  46. name: obui
  47. port:
  48. number: 80
  49. ingressClassName: nginx
  50. ---
  51. apiVersion: networking.k8s.io/v1
  52. kind: Ingress
  53. metadata:
  54. name: rewrite2grafana
  55. namespace: observe
  56. annotations:
  57. nginx.ingress.kubernetes.io/enable-cors: "true"
  58. nginx.ingress.kubernetes.io/cors-allow-origin: "*"
  59. nginx.ingress.kubernetes.io/rewrite-target: /$1
  60. spec:
  61. rules:
  62. - host: observe-ui.cestong.com.cn
  63. http:
  64. paths:
  65. - path: /grafana(/|$)(.*) # 匹配外部 Grafana URL,并捕获字符
  66. pathType: Prefix
  67. backend:
  68. service:
  69. name: grafana
  70. port:
  71. number: 80
  72. ingressClassName: nginx