Kubernetes Grafana&;的定制负载平衡器;伊斯蒂奥

Kubernetes Grafana&;的定制负载平衡器;伊斯蒂奥,kubernetes,load-balancing,istio,Kubernetes,Load Balancing,Istio,我已经从Istio文档中加载了Grafana作为一个附加组件,我把它放在主站点的一个子域后面 但是我需要为它构建一个定制的负载平衡器,以便子域可以指向它 这就是我所拥有的: apiVersion: v1 kind: Service metadata: name: grafana-ingressgateway namespace: istio-system spec: type: LoadBalancer ports: - port: 80 targetPort

我已经从Istio文档中加载了Grafana作为一个附加组件,我把它放在主站点的一个子域后面

但是我需要为它构建一个定制的负载平衡器,以便子域可以指向它

这就是我所拥有的:

apiVersion: v1
kind: Service
metadata:
  name: grafana-ingressgateway
  namespace: istio-system
spec:
  type: LoadBalancer
  ports:
    - port: 80
      targetPort: 80
      name: http2
    - port: 443
      name: https
  selector:
    app.kubernetes.io/name: grafana-lb
    app.kubernetes.io/instance: grafana-lb
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: ingress-grafana-gateway-configuration
  namespace: istio-system
spec:
  selector:
    istio: grafana-ingressgateway
  servers:
  - port:
      number: 80
      name: grafana-http-ui
      protocol: HTTP
    hosts:
    - "grafana.xxxx.com"
    tls:
      httpsRedirect: false
  - port:
      number: 443
      name: grafana-https-ui
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: xxxx-cert
    hosts:
    - "grafana.xxxx.com"
---
kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
  name: grafana-virtual-service
  namespace: istio-system
spec:
  hosts:
    - "grafana.xxxx.com"
  gateways:
    - ingress-grafana-gateway-configuration
  http:
    - match:
      - uri:
          prefix: /
      route:
        - destination:
            host: grafana.istio-system.svc.cluster.local
但它没有加载,我已经更新了“grafana”子域,指向新的负载平衡器。cert是一个通配符,用于加密
istio系统
命名空间中的内容

这是因为我添加了与默认负载平衡器相同的名称空间吗?我没有看到任何东西说你不能在一分钟内跑超过一磅


谢谢,

据我所知,它不起作用,因为创建服务不足以在Istio中创建自定义负载平衡器


如果要创建自定义网关,请参考以下内容。您需要使用或创建它

然后,您可以使用选择器指示网关使用新的自定义入口网关,而不是默认入口网关,默认入口网关的选择器为
istio:ingresgateway


对于网关配置,如果要使用以下选择器

spec:
  selector:
    istio: grafana-ingressgateway
然后,您应该在自定义grafana入口网关上创建此标签

gateways:
  enabled: true
  custom-grafana-ingressgateway:
    namespace: default
    enabled: true
    labels:
      istio: grafana-ingressgateway