编程开源技术交流,分享技术与知识

网站首页 > 开源技术 正文

istio 使用技巧概念解析(iaas的实际应用包括)

wxchong 2024-07-08 01:22:36 开源技术 25 ℃ 0 评论

istio 使用技巧概念解析,简易实例

一:istioctl 分析工具

https://www.bookstack.cn/read/istio-1.17-zh/980b8f4b765d876e.md

二:对象 Gateway

spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "bookinfo.bianmc.com"

三:对象 VirtualService

spec:
  hosts:
  - "bookinfo.bianmc.com"
  gateways:
  - bookinfo-gateway                      // 指定gateways 转发规则,要与这个对象关联
  http:
  - match:
    - port: 80                            // 默认,可以不写
      uri:
        exact: /productpage
    route:
    - destination:
        host: productpage
        port:
          number: 9080

解读:访问域名 bookinfo.bianmc.com 如果 match 端口80,路径 /productpage ,就 destination 转发到目的地名为 productpage 的svc,svc的端口为9080,所以 VirtualService 对应的是路由 route 转发规则。


合起来解读:

Gateway 对象 在标签为 istio=ingressgateway 的 POD(Envoy )中插入一个规则,这个规则定义一个 listener ,这个 listener 监听 http 协议的80 端口用户处理域名 bookinfo.bianmc.com 的请求。 VirtualService 对象在listener 中加一个转发规则,如果match 端口80,路径 /productpage ,就 destination 转发到目的地名为 productpage 的svc,svc的端口为9080





Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表