<p>Setup is Kubernetes v1.13 &amp; Istio 1.0.5</p>

<p>I'm running into an issue where the Istio service discovery is creating Envoy configurations that match TCP listeners instead of HTTP listeners. </p>

<p>The communication is working in the service mesh, but I need Envoy to serve as a Layer 7 proxy and not a Layer 4 pass through. I'm not getting the logs I need for the HTTP requests coming through Envoy. </p>

<p>Here is what I see in the sidecar istio-proxy log: </p>

<p>[2019-02-05T15:40:59.403Z] - 5739 7911 149929 "127.0.0.1:80" inbound|80||api-endpoint.default.svc.cluster.local 127.0.0.1:44560 10.244.3.100:80 10.244.3.105:35204</p>

<p>Which when I inspect the Envoy config in the sidecar - this is the corresponding config for that log message.</p>

<pre><code>      "name": "envoy.tcp_proxy",
      "config": {
       "cluster": "inbound|80||api-endpoint.default.svc.cluster.local",
       "access_log": [
        {
         "name": "envoy.file_access_log",
         "config": {
          "path": "/dev/stdout",
          "format": "[%START_TIME%] %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% \"%UPSTREAM_HOST%\" %UPSTREAM_CLUSTER% %UPSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_REMOTE_ADDRESS%\n"
         }
        }
       ],
       "stat_prefix": "inbound|80||api-endpoint.default.svc.cluster.local"
      }
</code></pre>

<p>So my question is: <strong>Why is Pilot providing Envoy with a TCP config for an HTTP service?</strong></p>

<p>I've come across this, in my case the port name for my service was not in the form <code>http-xyz</code>.</p>
<p>Istio/Envoy assumes that traffic is TCP, unless it gets a hint from the port name that it is some other protocol.</p>
<p>As per <a href="https://istio.io/help/faq/traffic-management/#naming-port-convention" rel="nofollow noreferrer">https://istio.io/help/faq/traffic-management/#naming-port-convention</a></p>
<blockquote>
<p>Named ports: Service ports must be named.</p>
<p>The port names must be of the form protocol-suffix with http, http2, grpc, mongo, or redis as the protocol in order to take advantage of Istio’s routing features.</p>
<p>For example, name: http2-foo or name: http are valid port names, but name: http2foo is not. If the port name does not begin with a recognized prefix or if the port is unnamed, traffic on the port will be treated as plain TCP traffic (unless the port explicitly uses Protocol: UDP to signify a UDP port).</p>
</blockquote>
