istio / istio.io

Source for the istio.io site
https://istio.io/
Apache License 2.0
762 stars 1.53k forks source link

Vague service port prefix guidelines #682

Closed padolan closed 6 years ago

padolan commented 6 years ago

From https://istio.io/v-0.1/docs/tasks/integrating-services-into-istio.html:

Kubernetes Services are required for properly functioning Istio service. Service ports must be named and these names must begin with http or grpc prefix to take advantage of Istio’s L7 routing features, e.g. name: http-foo or name: http is good. Services with non-named ports or with ports that do not have a http or grpc prefix will be routed as L4 traffic.

In practice what I've learned is the port must be named either http or prefixed with http-. The extra "-" is crucial, else names such as httpport2 (alongside another port called "http") causes traffic to get routed as L4 traffic.

I suggest perhaps calling this out more clearly in the instructions? Speaking for myself, it might've saved me about a week and a half of trial and error + user group assistance (thanks to Douglas Reid) to learn why things weren't working right for my app.

Thanks so much though for istio! It looks like a great product so far.

padolan commented 6 years ago

So I do see an accurate description of the port naming rules here: https://istio.io/docs/setup/kubernetes/sidecar-injection.html

Named ports: Service ports must be named. 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. 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).

..so maybe just a reference to these rules from the above page would suffice?

padolan commented 6 years ago

NVM, I now see my error! The above linked document was from an older version of the istio docs (v0.1.x). If I follow all the links from the public site I am able to navigate to https://istio.io/docs/setup/kubernetes/sidecar-injection.html#manual-sidecar-injection which is clear on the rules.