ingress访问prometheus、grafana、dashboard失败(k8s部署)

请问可能是什么原因呢?

使用 Ingress 访问 TiDB Dashboard 请参考此文档进行设置:https://docs.pingcap.com/zh/tidb-in-kubernetes/stable/access-dashboard

好的,dashboard已经可以访问了,但是 prometheus、grafana还是不行:cold_sweat:

Ingress 访问 TidbMonitor 的可以参考一下这里的例子进行配置:
https://docs.pingcap.com/zh/tidb-in-kubernetes/stable/monitor-using-tidbmonitor#使用-ingress-访问-tidbmonitor

这样配置prometheus和grafana的path好像是一样的,只能访问到prometheus,grafana如何访问到呢?

apiVersion: pingcap.com/v1alpha1
kind: TidbMonitor
metadata:
name: ingress-demo
spec:
clusters:
- name: demo
persistent: false
prometheus:
baseImage: prom/prometheus
version: v2.11.1
ingress:
hosts:
- exmaple.com
annotations:
foo: “bar”
grafana:
baseImage: grafana/grafana
version: 6.0.1
service:
type: ClusterIP
ingress:
hosts:
- exmaple.com
annotations:
foo: “bar”
initializer:
baseImage: pingcap/tidb-monitor-initializer
version: v4.0.4
reloader:
baseImage: pingcap/tidb-monitor-reloader
version: v1.0.1
imagePullPolicy: IfNotPresent

这里可以设置不同的 hosts 即可,例如 prometheus 使用 example1.com,grafana 使用 example2.com 即可。

apiVersion: pingcap.com/v1alpha1
kind: TidbMonitor
metadata:
  name: ingress-demo
spec:
  clusters:
    - name: demo
  persistent: false
  prometheus:
    baseImage: prom/prometheus
    version: v2.11.1
    ingress:
      hosts:
      - exmaple1.com
      annotations:
        foo: "bar"
  grafana:
    baseImage: grafana/grafana
    version: 6.0.1
    service:
      type: ClusterIP
    ingress:
      hosts:
        - exmaple2.com
      annotations:
        foo: "bar"
  initializer:
    baseImage: pingcap/tidb-monitor-initializer
    version: v4.0.4
  reloader:
    baseImage: pingcap/tidb-monitor-reloader
    version: v1.0.1
  imagePullPolicy: IfNotPresent

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。