Kiali:避免 KIA1106 - 同一主机的多个虚拟服务

时间:2021-03-02 19:27:05

标签: kubernetes istio kiali istio-kiali

我在 Istio/Kubernetes 上使用 Kiali 来监控我的网格。

我需要根据 URL 包含路由 2 个不同的 Pod,为此,我正在学习 Split large virtual services and destination rules into multiple resources 中的教程。因此,我为同一主机和网关创建了 2 个 VirtualService:

服务 1:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: vs-product-composite
spec:
  hosts:
  - "kubernetes.b-thinking.com"
  gateways:
  - gw-ingress
  http:
  - match:
    - uri:
        prefix: /product-composite
    route:
    - destination:
        port:
          number: 80
        host: product-composite

服务 2:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: uaa
spec:
  replicas: 1
  selector:
    matchLabels:
      app: uaa
  template:
    metadata:
      labels:
        app: uaa
    spec:
      containers:
      - name: uaa
        image: bthinking/uaa
        imagePullPolicy: Never
        env:
        - name: LOGGING_LEVEL_ROOT
          value: DEBUG
        ports:
        - containerPort: 8090
        resources:
          limits:
            memory: 350Mi
---
apiVersion: v1
kind: Service
metadata:
  name: uaa
spec:
  type: NodePort
  selector:
    app: uaa
  ports:
    - port: 8090
      nodePort: 31090
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: vs-auth
spec:
  hosts:
  - "kubernetes.b-thinking.com"
  gateways:
  - gw-ingress
  http:
  - match:
    - uri:
        prefix: /oauth
    rewrite:
      uri: "/uaa/oauth"
    route:
    - destination:
        port:
          number: 8090
        host: uaa

但是,我收到警告 KIA1106 - More than one Virtual Service for same host

查看 docs,它解释了案例(这是我的案例),但它重定向到我遵循的同一指南。

0 个答案:

没有答案