TCP Ingress with Istio 0.8 and v1alpha3 Gateway

7/5/2018

I am attempting to open a TCP connection into an Istio service mesh using the v1alpha3 routing. I can successfully open a connection with the external load balancer. That traffic is making it into the default IngressGateway as expected; I have verified this with tcpdump on the IngressGateway pod.

Unfortunately, the traffic is never forwarded into the service mesh; it seems to die in the IngressGateway.

The following is an example of my configuration:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: echo-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 31400 
      protocol: TCP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: echo-gateway
spec:
  hosts:
  - "*"
  gateways:
  - echo-gateway
  tcp:
  - match:
    - port: 31400
    route:
    - destination:
        host: echo.default.svc.cluster.local
        port:
          number: 6060

I have verified that the IngressGateway can reach the Service via netcat on the specified port. Running tcpdump on the Service pod with the envoy indicates that there is never a communication attempt with the pod or proxy.

I've read over the documentation several times and I'm at a loss as how to proceed. This line from the documentation is suspicious to me:

While Istio will configure the proxy to listen on these ports, it is the responsibility of the user to ensure that external traffic to these ports are allowed into the mesh.

Any thoughts?

-- C. King
amazon-eks
istio
kubernetes

1 Answer

8/8/2018

You should give the Gateway port a name such as port: name: not_http number: 80 protocol: HTTP

(When I tried to create your cluster without a name in Istio 1.0 it was rejected). Using "not_http" helps to remind us that this is a TCP gateway and won't have access to all of the Istio configuration features.

The VirtualService looks correct. Make sure that you have only one VirtualService for the host "*" (use istioctl get all --all-namespaces).

-- esnible
Source: StackOverflow