使用 SOFAMosn 构建 SOFAMesh

本文介绍的内容将包括 :

至于 SOFAMesh 的使用跟 Istio 没有区别,只是截止本文发稿时 SOFAMosn 的流量管理只支持:

  • 按 version 路由
  • 按 weight 路由
  • 按照特定 header 路由

SOFAMosn 是使用 Go 语言开发的 Service Mesh 数据平面代理,而 SOFAMesh 则是基于 Istio 改进和扩展而来的 Service Mesh 大规模落地实践方案, SOFAMosn SOFAMesh 的关键组件。目前由于 SOFAMosn 相比 Envoy 做了一些改造,无法在 Istio 下直接使用,所以本文的实验需要在 SOFAMesh 体系中进行。下图是 SOFAMesh 整体框架下,SOFAMosn 的工作示意图。

执行下面的命令部署 SOFAMesh。

SOFAMosn in SOFAMesh

部署完成后,我们再检查下在 istio-system 命名空间下启动的 pod 和 service。

  1. # 获取 pod 状态
  2. $ kubectl -n istio-system get pod
  3. istio-citadel-5cf74d467f-c8dkr 1/1 Running 0 1h
  4. istio-egressgateway-d4c9f6864-hpz86 1/1 Running 0 1h
  5. istio-galley-6886984468-szfhc 1/1 Running 0 1h
  6. istio-ingressgateway-64465cbb5f-5rmrf 1/1 Running 0 1h
  7. istio-policy-6ff7df778c-x87k7 1/1 Running 0 1h
  8. istio-sidecar-injector-69577c64c5-b86sc 1/1 Running 0 1h
  9. istio-statsd-prom-bridge-55965ff9c8-22hrf 1/1 Running 0 1h
  10. istio-telemetry-65d66f78f6-l8mkc 1/1 Running 0 1h
  11. prometheus-7456f56c96-mptww 1/1 Running 0 1h
  12. # 获取服务状态
  13. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  14. istio-citadel ClusterIP 10.254.216.170 <none> 8060/TCP,9093/TCP 1h
  15. istio-galley ClusterIP 10.254.70.174 <none> 443/TCP,9093/TCP 1h
  16. istio-ingressgateway NodePort 10.254.116.52 <none> 80:31380/TCP,443:31390/TCP,31400:31400/TCP,15011:32270/TCP,8060:30226/TCP,15030:31883/TCP,15031:31955/TCP 1h
  17. istio-pilot ClusterIP 10.254.150.248 <none> 15010/TCP,15011/TCP,8080/TCP,9093/TCP 1h
  18. istio-policy ClusterIP 10.254.80.42 <none> 9091/TCP,15004/TCP,9093/TCP 1h
  19. istio-sidecar-injector ClusterIP 10.254.183.202 <none> 443/TCP 1h
  20. istio-statsd-prom-bridge ClusterIP 10.254.51.10 <none> 9102/TCP,9125/UDP 1h
  21. istio-telemetry ClusterIP 10.254.176.114 <none> 9091/TCP,15004/TCP,9093/TCP,42422/TCP 1h
  22. prometheus ClusterIP 10.254.17.234 <none> 9090/TCP 1h