Envoy原理介绍及线上问题踩坑Envoy原理介绍及线上问题踩坑 介绍人:张伟 Copyright © Huawei Technologies Co., Ltd. All rights reserved. Page 2 个人介绍 张伟 华为云容器网格数据面技术专家 拥有10年以上中间件及高性能系统开发经验, 作为架构师及核心开发人员发布过传输网管系 统、Tuxedo交易中间件、ts-server多媒体转码服 Technologies Co., Ltd. All rights reserved. Page 3 目录 1. Envoy启动及配置文件 2. Envoy流量拦截原理、常用部署方式 3. Envoy可扩展过滤器架构、可观测性 4. Envoy线程模型 5. 生产环境问题分析及解决方法 6. 针对Envoy做的一些优化及效果 7. 常用性能分析测试工具及使用方法 8. 华为ASM产品介绍 Copyright rights reserved. Page 5 Envoy介绍 • Envoy采用C++实现,本身为四层及七层代理,可以根据用户应用请求内的数据进行高级服务治理 能力,包括服务发现、路由、高级负载均衡、动态配置、链路安全及证书更新、目标健康检查、 完整的可观测性等。 • 目前常见数据面主要有三种:Envoy、Linkerd、Traefic。Envoy由于高性能和扩展能力前在数据面遥 遥领先。0 码力 | 30 页 | 2.67 MB | 1 年前3
Istio Security Assessmentallowing inbound and outbound access of Istio services. • Istio Envoy Usage: The configuration and implemen- tation of Envoy within Istio (NOTE: Envoy itself was not part of the assessment). • Istio Control interface exposes unnecessary ser- vices and is accessible to anyone within a default cluster. • The Envoy Proxy admin port is exposed via the Istio sidecar and would allow a malicious workload to override branch up to July 15th, 2020. Commit: 7353c84b560fd469123611476314e4aee553611d istio/proxy Istio Envoy Proxy code in the master branch up to July 15th, 2020. Commit: c51fe751a17441b5ab3f5487c37e129e44eec8230 码力 | 51 页 | 849.66 KB | 1 年前3
Extending service mesh capabilities using a streamlined way based on WASM and ORASservice mesh capabilities using a streamlined way based on WASM and ORAS 王夕宁 | 阿里云服务网格ASM 2 Envoy’s Filter Chain Listener Downstre am Filter Filter Filter Cluster Upstrea m Filter Chain 扩展自定义Filter Filter Chain 4 实际示例中用到的Envoy Filters 端口9080 监听 envoy.filte rs.network .metadata _exchange envoy.http _connectio n_manage r Cluster Productp age服务 Filter Chain envoy.filters.ht tp.wasm/envo y.wasm istio-proxy curl localhost:15000/config_dump envoy.filters .http.cors envoy.filters .http.fault envoy.filters .http.router envoy.filters.ht tp.wasm/envo y.wasm.stats envoy.filters.ht tp.wasm/xxx- wasmfilter0 码力 | 23 页 | 2.67 MB | 1 年前3
Preserve Original Source
Address within Istiohere can be load balancers like envoy/haproxy/nginx which have already supported proxy protocol #IstioCon Istio Traffic Flow – inner cluster svcA svcB envoy envoy Pod1:10.244.0.20 Pod2:10.244.0.25 Flow - ingress svcB envoy envoy Pod1:10.244.0.19 Pod2:10.244.0.25 Dest: 127.0.0.1 Src:127.0.0.1 Ingress gateway ELB ingress EIP: 192.168.1.100 #IstioCon What does envoy provide? - Original source source filter “envoy.filters.listener.original_src” The original source listener filter replicates the downstream remote address of the connection on the upstream side of Envoy. For example, if a downstream0 码力 | 29 页 | 713.08 KB | 1 年前3
Istio控制平面组件原理解析) u启动envoy u热重启envoy u监控envoy u优雅关闭envoy启动envoy ü监听/etc/certs目录 ü生成envoy静态配置文件envoy-rev0.json ü通过exec.Command启动 envoy并监听状态 • 文件配置文档 • 启动参数文档热重启envoy热重启涉及以下步骤 • Pilot-Agent只是负责启动S,其他步骤由envoy完成。 • 1 到了时间S通知P自行关闭 • 6. S升级为P • 官方博客:Envoy hot restart什么时候会进行热重启?监控envoy ü获取非正常退出状态 ü抢救机制触发 ü抢救令牌减少一个(总共10个) ü在2(n-1) * 200毫秒后执行(为什么不立即执行) ü失败再次触发抢救机制 ü10个令牌用完,没有抢救成功,放弃退出优雅关闭envoy ü K8s发送SIGTERM信号让容器优雅关闭 ü ü Pilot-Agent接收信号通过context关闭子服务,发送SIGKILL关闭envoy ü Envoy不支持优雅关闭,需要通过金丝雀或蓝绿部署方式实现 Envoy优雅关闭实现方式讨论:#3307 #2920Pilot-Discovery——配置中心(PD) uv1版本和v2版本之间的区别 u建立缓存配置 u触发配置生效方式v1版本和v2版本之间的区别 V1 HTTP1 REST0 码力 | 30 页 | 9.28 MB | 6 月前3
13 Istio 流量管理原理与协议扩展 赵化冰缺省路由 (服务名) 5 Istio 流量管理 – 数据面 – Envoy配置模型和xDS协议 ADS Server LDS RDS CDS EDS Envoy 配置模型的主要概念: • Downstream:连接到 Envoy 的下游 Host,发送请求并接收响应。 • Upstream: 上游 Host 接收来自 Envoy 的连接和请求,并返回响应。 • Listener:监听器是命名网地址(可以是TCP domain socket),可以被 下游客户端连接。在 Envoy 中,Listener 可以绑定到端口上直接对外服务,也可以不绑 定到端口上,而是接收其他 listener 转发的请求。 • Cluster:集群是指 Envoy 连接的一组上游主机,集群中的主机是对等的,对外提供相 同的服务,组成了一个可以提供负载均衡和高可用的服务集群。Envoy 通过负载均衡 策略决定将请求路由到哪个集群成员。 xDS Istio 流量管理 – 数据面 – Istio 中的 Envoy Sidecar 配置 Istio中的 Envoy Sidecar 配置: • Istio 通过 Listener、Route Config 和 Cluster 为 Mesh 中的 Envoy 生成了入向和出向两个不同方向的处理流程的配 置。 • 在 Envoy 的基础上增加了 VirtualInboundListener,0 码力 | 20 页 | 11.31 MB | 6 月前3
全栈服务网格 - Aeraki 助你在
Istio 服务网格中管理任何七层流量Traffic in Istio? Pilot Envoy Code changes at the Pilot side: ● Add AwesomeRPC support in VirtualService API ● Generate LDS/RDS for Envoy Filter AwesomeRPC Filter ● Decoding/Encoding given than envoy filter is already there Cons: ● You have to maintain a fork of Istio, which makes upgrade painful ● Writing an Envoy Filter for AwesomeRPC is painful Istio Config Envoy Config #IstioCon AwesomeRPC filter EnvoyFilter is an Istio configuration CRD, by which we can apply a “patch” to the Envoy configuration generated by Pilot. #IstioCon EnvoyFilter Example - Dubbo Traffic Splitting Replace0 码力 | 29 页 | 2.11 MB | 1 年前3
Istio is a long wild river: how to navigate it safelyDuring pod deletion ● To prevent it, we need to make sure that: 1. Envoy is started before any other container in a pod 2. Envoy is stopped after any other container in a pod 14 Kubernetes shortcomings goal. 16 Workaround: Use postStart and preStop lifecycle hooks Stabilizing Istio 1. Ensure that Envoy is started before any other container in a pod ● Use a `postStart` lifecycle hook in the istio-proxy true 17 Workaround: Use postStart and preStop lifecycle hooks Stabilizing Istio 2. Ensure that Envoy is stopped after any other container in a pod ● Use a `preStop` lifecycle hook in the istio-proxy0 码力 | 69 页 | 1.58 MB | 1 年前3
Accelerate Istio with ebpfoverhead ● All the application data goes via sidecar (envoy) ● All the data passes TCP/IP stack 3 times ○ Inbound ○ Outbound ○ Envoy to Envoy(same host) Istio Meetup China Dataflow After Acceleration(same PILOT_ENABLE_INBOUND_PASSTHROUGH Istio Meetup China Outbound Acceleration Istio Meetup China Envoy to Envoy Acceleration(same host) Istio Meetup China Deploy eBPF Istio Meetup China Performance Comparison istio benchmarking tool ◦ Two pods run on the same node Configurations ◦ mTLS enabled ◦ Number of Envoy workers: 2 ◦ Response payload size: 1KB Latency ◦ 11-17% improvement Istio Meetup China Summary0 码力 | 15 页 | 591.60 KB | 1 年前3
Kubernetes容器应用基于Istio的灰度发布实践Istio总体架构 Istio & Kubernetes:架构结合 Kube-APIServer Etcd istioctl / kubectl Pilot Envoy SVC Pod Node Envoy SVC Pod Node Envoy SVC Pod list/watch (Service, Endpoints, Pod) 用户 Istio & Kubernetes:统一服务发现 Kubernetes:统一服务发现 Pilot ServiceController( Kube) DiscoveryServe r clientset Envoy Envoy KubeApiServ er List/Watc h 1. Controller实现ServcieDiscovery 若干服务发现的接口定义 2. Controller List/Watch KubeAPIserver上service、 KubeAPIserver上service、 endpoint等资源对象 3. DiscvoeryServer使用 ServcieDiscovery接口上的服务发 现方法和用户配置的规则构造xDS 4. Envoy从Discovery获取xDS,动态 更新 Kubernetes Service Instance Instance Service Endpoint Endpoint Istio Istio & Kubernetes:Mixer0 码力 | 38 页 | 14.93 MB | 1 年前3
共 37 条
- 1
- 2
- 3
- 4













