在本文中,我们将描述如何部署Service Mesh,解决微服务体系结构中的一些问题以及减轻开发人员和基础架构工程师的负担。
为什么我们需要服务网格
Service Mesh越来越受欢迎。我认为再次定义和描述一切可能会派上用场的原因是没有意义的。如果您不知道这是什么意思,但是您的公司有很多团队,服务,或者您打算独占一席之地,那么您应该熟悉该主题。您可以首先翻译由第一个Service Mesh项目的创建者William Morgan撰写的文章。
在过去的一年中,公司的产品团队数量增长了1.5倍。在撰写本文时,我们有20多个团队,几乎每个人都有开发人员。随着它们数量的增加,整体的开发变得越来越容易,因此我们开始更加积极地朝微服务架构发展。然而,虽然我们只是在旅程的开始,但是已经在3-4年前,用于各种目的的服务开始以可观的速度成倍增长。
当然,服务越多,跟踪它们就越困难,管理它们和基础结构配置就越困难。在开发人员和管理员之间存在隔离墙的传统系统中,这尤其困难。因此,在创建微服务的同时,我们开始将开发服务的启动和运营的大部分责任交给开发人员,并提供Ops考试即服务。但是,开发人员当然并不知道设置基础结构的所有细节。
Service Mesh十分成功地将开发人员的内容组合并从中抽象出来,例如:
- 服务发现
- 分布式跟踪;
- 电路中断/重试/超时;
- 监视/遥测交互以及许多其他交互。
, , Docker-. Nomad, Consul. , Kubernetes , Nomad .
, Kubernetes, , HashiCorp-.
Nomad Docker- ( QEMU, raw/isolated fork/exec Java). Consul Service Discovery DNS-.

Nomad- Consul-. - ( ), .
Nomad Consul . Consul , (node), healthcheck . (TCP, HTTP, gRPC, script). Nomad key-value Consul Vault, , -. Nomad consul-template.
Nomad, Consul HTTP API, , , Nomad , — ip-port - healthcheck. , k8s Pod, Allocation, .
, , operations engineer. , , : , , .
HashiCorp-, . Service Mesh , Redis .
Service Mesh
Service Mesh : (data plane control plane). Data plane , - . control plane, . .
— sidecar ( Pod’e/). , .
Service Mesh . Linkerd linkerd-proxy, Consul Connect Istio third-party . Envoy Lyft. open source , .
, :
- Service Mesh 2018 . , .
- .
- control plane .
control plane
control plane — , Service Mesh . , , . , , .
Service Mesh , Mesh, . Envoy , , , .
Envoy data plane
Envoy sidecar- . sidecar-, . . (ingress) Consul, (egress) -. , , , .
: Nomad .

Service Discovery
Service Discovery? , ? sidecar, control plane agent, control plane API, API Consul API Envoy. endpoint discovery (EDS). «» - Consul. Envoy , .
Prometheus. Envoy , , Circuit Breaker - . :

, , Vizceral Netflix:

— , . , - . , Envoy Distributed tracing Zipkin/Jaeger (X-b3-headers).

, , Jaeger Elastic APM (Application Performance Management). — Kibana, . Elastic , , , Jaeger, , APM Distributed tracing. Jaeger-, Envoy, , , , Elastic APM. Jaeger, Elastic APM , HTTP- trace-id . Jaeger , Elastic , .
Service Mesh . — . HTTP/1, TCP Redis. Mesh , . , . , Service Mesh.
Ops- Mesh: , , Canary, . , Istio .
Service Mesh
, Service Mesh:
- — .
- Service Discovery , - . c-plane 10 , , , , . , . Envoy 150 RAM, . , 100 RPS, 30 .
- . 2–3 .
- — , .
: