我已经下载了普罗米修斯头盔图表 https://github.com/helm/charts/tree/master/stable/prometheus
并将其部署到我们的集群as-is
中,我可以通过端口转发访问Prom ui 。
在使用istio
时,我想将其配置为可以通过主机(如外部IP)访问,并且我配置了以下内容,但对我来说不起作用。
我的意思是,如果我把主机放在浏览器中什么也没得到,那么你知道这里可能缺少什么吗?
我不在运行exteranal-ip
时看到任何kubectl get svc -n mon
,
仅仅是internal-ip,对我们的需求没有帮助。
gateway.yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: http-gateway
namespace: mon
spec:
selector:
istio: ingressgateway
servers:
- hosts: mo-gateway.web-system.svc.cluster.local
port:
name: https-monitoring
number: 443
protocol: HTTPS
tls:
mode: SIMPLE
privateKey: /etc/istio/sa-tls/tls.key
serverCertificate: /etc/istio/sa-tls/tls.crt
virtual_service.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: prom-virtualservice
namespace: mon
spec:
hosts:
- mo-gateway.web-system.svc.cluster.locall
gateways:
- http-gateway
http:
- match:
- uri:
prefix: /prometheus
route:
- destination:
host: prometheus-server
port:
number: 80
有人知道为什么它不起作用吗?
顺便说一句,如果我只是将Prometheus的类型更改为使用LoadBalancer,那么我可以获取external-ip
并使用它,但不能在istio上使用
istio正在运行...