其他分享
首页 > 其他分享> > 开放grafana至集群外部

开放grafana至集群外部

作者:互联网

kubectl apply -f ./
[root@k8s-master grafana]# cat grafana-gateway.yaml 
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
  name: grafana-gateway
  namespace: istio-system
spec:
  selector:
    app: istio-ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "grafana.magedu.com"
---
[root@k8s-master grafana]# cat grafana-virtualservice.yaml 
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: grafana-virtualservice
  namespace: istio-system
spec:
  hosts:
  - "grafana.magedu.com"
  gateways:
  - grafana-gateway
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: grafana
        port:
          number: 3000
---
[root@k8s-master grafana]# cat grafana-destinationrule.yaml 
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: grafana
  namespace: istio-system
spec:
  host: grafana
  trafficPolicy:
    tls:
      mode: DISABLE
---

 

标签:name,外部,system,istio,---,集群,io,grafana
来源: https://www.cnblogs.com/zyyang1993/p/16593911.html