Istio 协议选择

Istio支持代理的协议

  • 支持代理任何类型的TCP流量,包括HTTP、HTTPS、gRPC及原始TCP(raw tcp)协议

  • 但为了提供额外的能力,比如路由和更加丰富的指标,Istio需要确定更具体的协议(应用层协议)

  • Istio不会代理UDP协议

协议选择

  • Istio能够自动检测并识别HTTP和HTTP/2的流量,未检测出的协议类型将一律视为普通的TCP流量

  • 也支持由用户手动指定

手动指定协议

  • Service Port应该明确指定使用的协议

  • 命名格式

    • <protocol>[-<suffix>]

    • Kubernetes v1.18及之后的版本中,可以直接使用appProtocol字段进行标识

示例

kind: Service
metadata:
  name: myservice
spec:
  ports:
  - port: 3306
    name: database
    appProtocol: https
  - port: 80
    name: http-web

Istio支持的协议类型

参考文档

https://istio.io/latest/docs/ops/configuration/traffic-management/protocol-selection/

posted @ 2022-10-28 16:58  小吉猫  阅读(111)  评论(0编辑  收藏  举报