Protocol Selection

Istio supports proxying all TCP traffic by default, but in order to provide additional capabilities,such as routing and rich metrics, the protocol must be determined.This can be done automatically or explicitly specified.

Manual protocol selection

Protocols can be specified manually by naming the Service port name: <protocol>[-<suffix>].The following protocols are supported:

  • grpc
  • grpc-web
  • http
  • http2
  • https
  • mongo
  • mysql*
  • redis*
  • tcp
  • tls
  • udp
  • These protocols are disabled by default to avoid accidentally enabling experimental features.To enable them, configure the corresponding Pilot environment variables.

Below is an example of a Service that defines a mysql port and an http port:

  1. kind: Service
  2. metadata:
  3. name: myservice
  4. spec:
  5. ports:
  6. - number: 3306
  7. name: mysql
  8. - number: 80
  9. name: http-web

Automatic protocol selection (experimental)

Istio can automatically detect HTTP and HTTP/2 traffic. If the protocol cannot automatically be determined, traffic will be treated as plain TCP traffic.

This feature is experimental and off by default. It can be turned on by providing the install option —set values.pilot.enableProtocolSniffing=true.