How to configure ingress gateway in istio?

后端 未结 2 1197
旧巷少年郎
旧巷少年郎 2021-01-03 16:07

I\'m new to istio, and I want to access my app through istio ingress gateway, but I do not know why it does not work. This is my kubenetes_deploy.yaml file cont

相关标签:
2条回答
  • 2021-01-03 16:32

    First of all, as @Abhyudit Jain mentioned you need to correct port in VirtualService to 8000

    And then you just add another port to your istio-ingressgateway service

    kubectl edit svc istio-ingressgateway -n istio-system
    

    add section:

    ports:
      - name: http
        nodePort: 30001
        port: 15000
        protocol: TCP
        targetPort: 80
    

    This will accept HTTP traffic on port 15000 and rout it to your destination service on port 8000

    simple schema as follows:

    incoming traffic --> istio-gateway service --> istio-gateway --> virtual service --> service --> pod
    
    0 讨论(0)
  • 2021-01-03 16:40

    You batman service listens on port 8000 and forwards traffic to container's port 7000.

    The istio traffic works like this:

    ingress-gateway -> virtual-service -> destination-rule [optional] -> service
    

    So your virtual service should be like:

    apiVersion: networking.istio.io/v1alpha3
    kind: VirtualService
    metadata:
      name: batman
    spec:
      hosts:
      - "*"
      gateways:
      - batman-gateway
      http:
        - match:
          route:
          - destination:
              host: batman
              port:
                number: 8000  <--- change
    
    0 讨论(0)
提交回复
热议问题