lbk60ox 发表于 2024-10-10 07:02:42

基于火山引擎微服务引擎 MSE 的全链路灰度落地实践

<img src="https://mmbiz.qpic.cn/mmbiz_gif/FMhibf6tm6dBSoib0riaH1ibQYquamiasEm1oNw2CSmWbC7bo0CrrKXujicD7Ktw81tngJrQPicgRMqiawPB8Rxwx94xmA/640?wx_fmt=gif&amp;wxfrom=5&amp;wx_lazy=1&amp;tp=webp" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">微服务引擎 MSE(Microservices Engine)是火山引擎<span style="color: black;">供给</span>的一款面向微服务全生命周期的一站式微服务<span style="color: black;">处理</span><span style="color: black;">方法</span>。<span style="color: black;">制品</span><span style="color: black;">供给</span>开源<span style="color: black;">加强</span>的 Nacos 注册<span style="color: black;">发掘</span>、配置管理,兼容原生 Spring Cloud 、gRPC 及 Service Mesh 架构丰富微服务治理能力。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">源自</span>&nbsp;| 火山引擎云原生团队</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在业务发布变更过程中,为最大限度降低对在线用户影响,<span style="color: black;">保证</span>版本发布质量,<span style="color: black;">一般</span>采用</span><span style="color: black;"><strong style="color: blue;">灰度发布</strong></span><span style="color: black;">的方式将少量的<span style="color: black;">实质</span>生产流量导入至更新版本,达到预期结果及充分测<span style="color: black;">实验</span>证后,将流量渐进式切流至更新版本随即完成基线版本服务下线。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">然而在微服务架构体系中,<span style="color: black;">因为</span>服务间依赖关系错综<span style="color: black;">繁杂</span>,单个功能模块发版需依赖上下游多个服务<span style="color: black;">同期</span>上线,需<span style="color: black;">保证</span>从网关流量入口<span style="color: black;">起始</span>到多个发版微服务间对特征版本充分验证的<span style="color: black;">同期</span>实现基准流量的业务闭环。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">针对<span style="color: black;">以上</span>挑战,业界提出全链路灰度发布的实现<span style="color: black;">方法</span>,有效<span style="color: black;">处理</span>微服务架构多服务并行发布的流量隔离问题。在字节跳动内部,抖音、电商等多个业务域已将全链路灰度发布<span style="color: black;">做为</span>在线服务发布的标准规范并沉淀标准化工具,承载超过</span><span style="color: black;"><strong style="color: blue;">30 万</strong></span><span style="color: black;">微服务、每周超 </span><span style="color: black;"><strong style="color: blue;">10 万次</strong></span><span style="color: black;">发布构建,有效<span style="color: black;">提高</span>了版本发布成功率,<span style="color: black;">同期</span><span style="color: black;">亦</span><span style="color: black;">帮忙</span>业务团队提前<span style="color: black;">发掘</span>变更业务<span style="color: black;">反常</span>,降低发布变更失败业务损失。</span></p><span style="color: black;">本文结合火山引擎微服务引擎 MSE(Microservices Engine)在全链路灰度发布场景的实践探索,介绍全链路灰度发布场景实践<span style="color: black;">办法</span>、<span style="color: black;">方法</span>设计思考及案例实践。</span><strong style="color: blue;"><span style="color: black;">从灰度发布实践出发</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">要<span style="color: black;">认识</span>全链路灰度发布的实践过程,<span style="color: black;">咱们</span>有必要先<span style="color: black;">认识</span>传统灰度发布背景、流程,分析在微服务架构体系下存在的问题。</span></p><strong style="color: blue;"><span style="color: black;">1.1 传统灰度发布过程</span></strong><span style="color: black;">传统的灰度发布<span style="color: black;">通常</span>是在生产环境单独隔离部分资源,复用<span style="color: black;">实质</span>生产环境配套的<span style="color: black;">基本</span><span style="color: black;">设备</span>如中间件、数据库等以实现无限接近于生产环境。在灰度发布过程中,新版本<span style="color: black;">首要</span>在一部分测试用户中进行测试,<span style="color: black;">倘若</span>新版本表现稳定,再逐步扩大用户范围;<span style="color: black;">倘若</span>新版本<span style="color: black;">显现</span>故障或问题,则仅影响测试用户并可<span style="color: black;">经过</span>流量回切快速故障恢复,</span><span style="color: black;">从而减轻发布变更的故障影响</span><span style="color: black;">。</span><span style="color: black;">其<span style="color: black;">详细</span>实现流程如下:</span><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mAO6iapypibvk5Uic4iaoAia5LCPDrKuPGLNQFbpFtnyWudKxy8KUiaCcx5hg/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">过程</span>一:在生产环境设置指定资源池,该资源池与<span style="color: black;">实质</span>生产业务应用的<span style="color: black;">基本</span>资源保持一致(<span style="color: black;">包含</span>网络策略、数据库、中间件及第三方服务),屏蔽因资源环境差异<span style="color: black;">引起</span>发布变更<span style="color: black;">反常</span>;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">过程</span>二:在指定资源池发布该服务的灰度实例;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">过程</span>三:待灰度实例上线成功后,<span style="color: black;">调节</span>负载策略配置将少量<span style="color: black;">实质</span>生产流量路由至服务 A 的灰度节点;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">过程</span>四:灰度版本验证成功后,逐步<span style="color: black;">调节</span>灰度版本流量比例或一次性切流至灰度版本;</span></p><span style="color: black;"><span style="color: black;">过程</span>五:当发布结果符合预期时,将原有负载的灰度流量规则取消并下线服务灰度实例,至此完成一次完整的灰度发布动作。</span><strong style="color: blue;"><span style="color: black;">1.2 微服务 × 灰度发布</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">与单个服务的灰度发布<span style="color: black;">区别</span>,微服务架构的发布过程更为<span style="color: black;">繁杂</span>。举个例子,在一个业务<span style="color: black;">行业</span>存在 A、B、C、D 四个相互依赖的微服务<span style="color: black;">一起</span>构建闭环的业务<span style="color: black;">规律</span>,服务 A、B、C 之间采用标准 HTTP 协议通信,服务 C 和服务 D <span style="color: black;">经过</span><span style="color: black;">信息</span>中间件进行异步解耦。这 4 个服务<span style="color: black;">触及</span>两个</span><span style="color: black;">业务团队,服务 A、服务 C 归属团队 A ,在 feature_a 版本发布过程中存在相互依赖需要协同发布;服务 B、服务 D 归属团队 B,在 feature_B 版本发布过程中<span style="color: black;">一样</span>需要协同发布,且因归属<span style="color: black;">区别</span>团队且<span style="color: black;">拥有</span><span style="color: black;">一样</span>的发布窗口,存在</span><span style="color: black;"><strong style="color: blue;">并行发布</strong></span><span style="color: black;">场景。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">怎样</span><span style="color: black;">处理</span><span style="color: black;">以上</span><span style="color: black;">繁杂</span>的全链路灰度发布问题,<span style="color: black;">这儿</span><span style="color: black;">咱们</span>列举了<span style="color: black;">有些</span>对应落地的要点:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mFve1spuNHGibm96yibaqmDCRSaDmhPGCqBicNBNCe8Wc0ZnwVyqiciaIw8Q/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在流量入口需要能够识别 feature_a、feature_b 的流量特征,将流量匹配规则路由至下游服务对应的灰度版本,<span style="color: black;">因此呢</span>需要依赖于流量入口负载或网关的流量匹配、标识染色和流量路由能力。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">feature_a 在服务 B、服务 D<span style="color: black;"><span style="color: black;">无</span>对应特征版本</span>(同理 feature_b 在服务 A、服务 C <span style="color: black;">亦</span>无<span style="color: black;">对应特征版本</span>),针对未匹配灰度规则的流量,需要将流量自动回流至基线版本,<span style="color: black;">保证</span>业务<span style="color: black;">规律</span>闭环。<span style="color: black;">同期</span>,在服务实例进程及线程切换过程中完成上下文串联。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">服务 A、B、C 的单个服务实例<span style="color: black;">按照</span>接受的流量特征<span style="color: black;">区别</span>,需要匹配<span style="color: black;">区别</span>的流量路由规则,将其路由至下游指定的灰度版本。路由规则之间不相互影响,<span style="color: black;">伴同</span>灰度版本上线动态完成路由规则生效。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">服务 C 和服务 D <span style="color: black;">经过</span>异步<span style="color: black;">信息</span>事件进行解耦,在 HTTP 或 RPC 灰度流量经过<span style="color: black;">信息</span>投递时,需要将特征流量转化为特征<span style="color: black;">信息</span>事件完成流量标识在<span style="color: black;">信息</span>中间件的透传。</span></p><strong style="color: blue;"><span style="color: black;">1.3 问题与挑战</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">结合<span style="color: black;">以上</span>分析, <span style="color: black;">咱们</span><span style="color: black;">能够</span><span style="color: black;">发掘</span>,传统基于单一入口负载灰度发布机制在微服务场景<span style="color: black;">重点</span>面临如下挑战:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">没法</span>实现<span style="color: black;">关联</span>业务域内多个服务灰度发布的流量闭环</span></strong></span><span style="color: black;">。<span style="color: black;">因为</span>服务调用<span style="color: black;">触及</span><span style="color: black;">繁杂</span>调用关系,单个功能特性发布依赖相同业务域下多个微服务发布更新,需要将灰度流量<span style="color: black;">精细</span>调度在多个上下游依赖灰度服务实例,</span><span style="color: black;"><span style="color: black;">同期</span>为<span style="color: black;">保证</span>整体业务闭环,<span style="color: black;">准许</span>灰度流量路由至服务的基线版本</span><span style="color: black;">。要完成以上灰度流量的业务闭环,需在全链路服务调用过程中对灰度流量进行<span style="color: black;">精细</span>识别和路由<span style="color: black;">掌控</span>。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">没法</span><span style="color: black;">供给</span><span style="color: black;">拥有</span>特定业务规则的流量标识</span></strong></span><span style="color: black;">。</span><span style="color: black;">在<span style="color: black;">实质</span>业务场景中,为进一步<span style="color: black;">知道</span>影响范围或基于业务规则对特征用户流量进行版本验证,<span style="color: black;">一般</span>需<span style="color: black;">按照</span>指定的用户 ID、地域、终端类型等特征业务标识对流量进行染色标记,将染色流量路由到指定的服务版本。<span style="color: black;">因此呢</span>,需要在流量入口能够基于业务语义<span style="color: black;">精细</span>识别特征流量,添加染色标识,并路由至下游服务的灰度版本。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">没法</span>满足多个特征版本并行发布场景</strong></span><span style="color: black;">。在一个大型<span style="color: black;">制品</span>体系下业务域<span style="color: black;">繁杂</span>,将相同闭环的业务单元划分为相对独立的业务域,归属于<span style="color: black;">区别</span>的业务团队。在发布窗口有限的<span style="color: black;">状况</span>下,需要通<span style="color: black;">太多</span>个特性版本并行发布<span style="color: black;">提高</span>发布效率,然而<span style="color: black;">区别</span>的业务团队<span style="color: black;">没法</span>做到</span><span style="color: black;">同步的发布感知</span><span style="color: black;">,在并行发布过程中需要避免各业务团队的相互影响,使其在发布<span style="color: black;">反常</span>时能准确识别<span style="color: black;">自己</span><span style="color: black;">规律</span>变更<span style="color: black;">诱发</span>的<span style="color: black;">反常</span>问题。</span></p><span style="color: black;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">没法</span><span style="color: black;">处理</span>跨中间件的灰度标识的透传</span></strong></span><span style="color: black;">。在弱网环境或高并发业务场景,系统<span style="color: black;">一般</span>采用<span style="color: black;">信息</span>中间件的异步消费订阅机制实现微服务架构的解耦。当灰度流量<span style="color: black;">经过</span>业务<span style="color: black;">规律</span>转发至<span style="color: black;">信息</span>中间件时,</span><span style="color: black;"><span style="color: black;">倘若</span>不<span style="color: black;">增多</span>额外的<span style="color: black;">规律</span>,将<span style="color: black;">导致</span>灰度标识的断联,</span><span style="color: black;"><span style="color: black;">诱发</span>灰度流量中断或<span style="color: black;">反常</span>。</span><strong style="color: blue;"><span style="color: black;">全链路灰度设计与实现</span></strong><strong style="color: blue;"><span style="color: black;">2.1&nbsp;设计原则</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">经过<span style="color: black;">以上</span>剖析,结合业界及字节跳动内部实践,<span style="color: black;">咱们</span><span style="color: black;">能够</span>简单总结出微服务场景全链路灰度发布的设计原则:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mR7Kl229Wn6YyUZzkSw0tJSyS4SRNLjkhR5bWdaEaIK8mcJm1hxqDxw/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">供给</span>流量<span style="color: black;">规律</span>隔离概念泳道</span></strong><span style="color: black;">。泳道<span style="color: black;">触及</span>服务实例染色标记、流量匹配规则及发布依赖<span style="color: black;">相关</span>的一组服务。泳道内的服务实例仅接受染色标记流量,并优先将染色流量路由至下游匹配染色标记的<span style="color: black;">目的</span>实例;<span style="color: black;">每一个</span>泳道流量相互独立,支持多个泳道并行生效,满足多<span style="color: black;">制品</span>特性并行上线验证<span style="color: black;">需要</span>。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">在流量入口匹配业务规则对流量进行标记</span></strong><span style="color: black;">。需要将流量入口(入口网关、入口服务等)与泳道进行<span style="color: black;">相关</span>,匹配对应的染色规则和路由策略,将流量路由至对应泳道的服务实例,流量入口和泳道<span style="color: black;">准许</span>一对多关系。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">泳道<span style="color: black;">相关</span>的路由及染色规则支持动态生效</span></strong><span style="color: black;">。与泳道<span style="color: black;">相关</span>的路由策略需<span style="color: black;">伴同</span>版本发布的切流动作动态下发至泳道内的所有服务实例并<span style="color: black;">即时</span>生效,<span style="color: black;">经过</span>泳道染色规则生效策略<span style="color: black;">掌控</span>版本发布节奏。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">供给</span>基准泳道概念并生成默认的泳道规则</span></strong><span style="color: black;">:未匹配染色标记的流量将统一路由至基线泳道的服务实例。在泳道范围的灰度实例未上线时或未有匹配的流量路由规则时,<span style="color: black;">准许</span>流量自动回流至基线版本,<span style="color: black;">保证</span>业务的整体闭环。</span></p><strong style="color: blue;"><span style="color: black;">2.2 实现原理</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mQXmDxl7SlfWCpZPIPmQBD6Dok94Y1ZP6ApYHPrHU8FDzcp8SorR1fQ/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">火山引擎微服务引擎 MSE&nbsp;</span>的全链路灰度设计的核心原理<span style="color: black;">包括</span> 3 个要素:流量染色、实例打标、染色标记透传。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">流量染色</span></strong></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">重点</span>在入口网关、入口服务等<span style="color: black;">拜访</span>入口,</span><span style="color: black;">对入口流量匹配业务规则的流量进行染色标记,在出口流量<span style="color: black;">按照</span>下游服务实例识别灰度标识,路由至对应泳道的服务。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><span style="color: black;">微服务引擎 MSE&nbsp;</span></span><span style="color: black;"><span style="color: black;">供给</span> 2 种实现方式</span><span style="color: black;">:针对 Spring Cloud Gateway 为<span style="color: black;">表率</span>的服务网关,可<span style="color: black;">经过</span>接入数据面自动获取识别染色规则<span style="color: black;">增多</span>标识及出口流量匹配;针对 Ingress 自建网关或云上托管 API 网关,可在网关手动设置路由规则将流量分流至下游灰度实例,进入灰度实例的流量将自动<span style="color: black;">增多</span>染色标识。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">实例打标及流量路由</span></strong></span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">在创建泳道过程中,会生成泳道实例的染色标识并对泳道内服务下发指定的路由规则。当服务进行灰度发布时,需获取泳道标签对工作负载灰度实例进行染色标记;</span><span style="color: black;">在服务实例<span style="color: black;">起步</span>后,数据面将拦截服务的注册<span style="color: black;">发掘</span><span style="color: black;">行径</span>将泳道元数据信息写入注册中心</span><span style="color: black;">,<span style="color: black;">经过</span>同步任务将注册信息同步至 MSE <span style="color: black;">掌控</span>面,由其将路由及实例寻址信息更新至数据面,<span style="color: black;">加强</span>服务出口路由策略实现规则路由。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">染色透传</span></strong></span></p><span style="color: black;">数据面<span style="color: black;">经过</span>对入口流量中 HTTP &nbsp;header 或 RPC 协议上下文的染色标签进行识别,</span><span style="color: black;">在完成<span style="color: black;">自己</span><span style="color: black;">规律</span>处理后对出口流量<span style="color: black;">弥补</span>染色标识</span><span style="color: black;">,实现流量染色标记在服务调用的完整链路中透传,支持对服务进程内多线程上下文切换的染色标签串联。</span><strong style="color: blue;"><span style="color: black;">火山引擎 MSE 全链路灰度实践</span></strong><strong style="color: blue;"><span style="color: black;">3.1&nbsp;特性说明</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;"><span style="color: black;">微服务引擎 MSE</span></strong></span><span style="color: black;">是火山引擎<span style="color: black;">供给</span>的一款面向微服务全生命周期的一站式微服务<span style="color: black;">处理</span><span style="color: black;">方法</span>。<span style="color: black;">制品</span><span style="color: black;">供给</span>开源<span style="color: black;">加强</span>的 Nacos 注册<span style="color: black;">发掘</span>、配置管理的能力,兼容原生 Spring Cloud 、GRPC及 Service Mesh 架构丰富微服务治理能力,<span style="color: black;">能够</span>助力用户快速、<span style="color: black;">方便</span>地构建微服务应用架构,<span style="color: black;">处理</span>中大型企业的微服务架构转型问题。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3msBpmibJXf51Lq3zG7SOldKic6zBRcEI9feIFSfEAVKicc4KIB2Vh0dPpQ/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">结合字节跳动内部业务<span style="color: black;">累积</span>的<span style="color: black;">各样</span>优秀实践,微服务引擎 MSE 在全链路灰度发布场景支持如下特性:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">支持<span style="color: black;">繁杂</span>业务流量匹配及流量隔离</span></strong><span style="color: black;">。<span style="color: black;">经过</span>泳道流量隔离<span style="color: black;">规律</span>,满足多个泳道设置<span style="color: black;">区别</span>的染色规则及路由隔离,<span style="color: black;">经过</span> fallover 机制<span style="color: black;">供给</span>泳道严格及宽松模式的一键切换,支持多个业务团队并行发布相互解耦,避免彼此干扰,<span style="color: black;">提高</span>发布效率。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">支持异构应用框架无侵入流量治理接入</span></strong><span style="color: black;">。<span style="color: black;">供给</span> java agent 字节码<span style="color: black;">加强</span>及 sidecar 两种<span style="color: black;">无侵入</span>数据面接入方式,面向异构框架<span style="color: black;">供给</span>全链路灰度发布的流量染色、标识及流量路由的服务治理<span style="color: black;">加强</span>能力,降低应用接入推广成本。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">与火山引擎云原生<span style="color: black;">制品</span>生态深度融合,闭环全链路灰度发布的流量调度</span></strong><span style="color: black;">。如联动火山引擎&nbsp;<a style="color: black;">API 网关</a>支持入口流量染色、自动 header 路由匹配及后端服务实例的自动<span style="color: black;">发掘</span>能力。</span></p><strong style="color: blue;"><span style="color: black;">3.2 实践场景</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">Demo 描述</strong>:存在 svc1、svc2、svc3 相互依赖的微服务,服务之间<span style="color: black;">经过</span> Nacos &nbsp;注册中心<span style="color: black;">做为</span>服务寻址,SCG 服务网关<span style="color: black;">做为</span>内部服务流量入口,内部服务<span style="color: black;">经过</span> HTTP 协议调用正常联通<span style="color: black;">状况</span>下打印 service v1 → service v1 <span style="color: black;">→&nbsp;</span>service v1。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;"><strong style="color: blue;">预期效果</strong>:<span style="color: black;">按照</span>灰度流量特征流量 x-canary:true 实现对该特征流量的全链路灰度发布, svc1 、svc2、svc3 均加入泳道列表,当下游服务未上线灰度实例,则将流量自动 fallback 至基线泳道。当存在 x-canary:true &nbsp;流量接入后,打印 service v2<span style="color: black;">→</span> service v2 <span style="color: black;">→&nbsp;</span>service v2。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mO3vtawEpu2vdSjqdqibf2kiaeChmPRgPFvkF6wQqcIxf7SvTPZR7v01A/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p><strong style="color: blue;"><span style="color: black;">3.3 操作流程</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">过程</span>一:前置准备</span></strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">已<span style="color: black;">经过</span>火山引擎 VKE 创建业务集群。</span><span style="color: black;">业务集群用于<span style="color: black;">安排</span> svc1 、svc2、svc3 工作负载;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">已创建治理中心并纳管<span style="color: black;">关联</span>的业务集群。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">过程</span>二:同步注册中心</span></strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">完成导入注册中心并针对命名空间及 Group 创建同步任务,将服务注册信息同步至 MSE 管控面:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3m3WNu5PlYQwgF02icYH36ecRKuuGrqBpyOgl1r4PKBmO6uFYqUP736Iw/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">同步完成后,服务列表可查看<span style="color: black;">已然</span>从 Nacos 同步的服务信息,此时服务尚未接入数据面不具备流量治理能力:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3m1pmNESgxiaBsLXCQkIE90RaLupQX2t0vsLwO0nCHo9qJCDzJiaEeNbtA/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">过程</span>三:设置泳道规则</span></strong></p><span style="color: black;">泳道规则配置关注以下内容:</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">Fallback 策略</span><span style="color: black;">:</span><span style="color: black;">开启 fallback 后,针对泳道内未有染色标识的服务,流量将自动 fallback 至基线版本优先<span style="color: black;">保证</span>业务闭环;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">服务列表:</span><span style="color: black;">与版本发布特性<span style="color: black;">关联</span>的上下游依赖服务;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">流量入口:流量入口支持基于 SCG 的服务网关以及非 MSE 管控体系的自建网关,<span style="color: black;">倘若</span>是自建网关则手动配置路由策略将流量路由至服务的灰度实例,</span><span style="color: black;">进入灰度实例的流量将自动添加对应的流量染色标记</span><span style="color: black;">;</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">染色匹配规则</span><span style="color: black;">:</span><span style="color: black;">在 SCG 服务网关染色入口类型下,支持<span style="color: black;">按照</span> HTTP 请求 header 规则匹配设置染色路由策略。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mDPGuIlgibEcOADUDcXCle5ASzDCpTHribZTCibSia8gu5e0xPQrictrvRwQ/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">过程</span>四:服务治理接入</span></strong></p><span style="color: black;"><span style="color: black;">按照</span>服务接入指引完成内部服务和服务网关的数据面接入,治理能力接入采用无侵入方式,仅需在工作负载配置对应的标签注解<span style="color: black;">就可</span>完成服务接入。</span><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mRuibnFDjiaq5wtjbaM4KzLibv75X1yfgiawREWiaDcoKDicXmR2d4ZFXOurQ/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"><span style="color: black;">java 内部服务 Annotations 和 Lables 注解:</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mr3EbAqaJYjib1lfzcY90OLDoNe5clzFqjBZN0SuicCicxhXhaKIVLQJcA/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"></p><span style="color: black;">spec:</span><span style="color: black;"> <span style="color: black;">template</span>:</span><span style="color: black;">metadata:</span><span style="color: black;"> annotations:</span><span style="color: black;"> sidecar.mesh.io/prestop-timeout: <span style="color: black;">"5000"</span></span><span style="color: black;"> labels:</span><span style="color: black;"> sidecar.mesh.io/data-plane-mode: <span style="color: black;">"java_proxy"</span></span><span style="color: black;"> sidecar.mesh.io/lane: <span style="color: black;">"lane-test"</span></span><span style="color: black;">sidecar.mesh.io/mse-<span style="color: black;">namespace</span>: <span style="color: black;">"mse-demo-public-test"</span></span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">服务网关 Annotations 和 Lables 注解:</span></p><img src="https://mmbiz.qpic.cn/mmbiz_png/FMhibf6tm6dBvRJ8WqPZhpV8vuV1r1Q3mvicn1QpbMcHwnaIDZOFLKY60Luv0iaFhbzUuaT7ghGvaicb9PwZaQ59Nw/640?wx_fmt=png&amp;from=appmsg&amp;tp=webp&amp;wxfrom=5&amp;wx_lazy=1&amp;wx_co=1" style="width: 50%; margin-bottom: 20px;"><span style="color: black;">spec:</span><span style="color: black;"> <span style="color: black;">template</span>:</span><span style="color: black;"> metadata:</span><span style="color: black;"> labels:</span><span style="color: black;"> service.istio.io/gateway-name: <span style="color: black;">"gateway-test"</span></span><span style="color: black;">sidecar.mesh.io/data-plane-mode:<span style="color: black;">"java_proxyless"</span></span><span style="color: black;"> sidecar.mesh.io/mse-<span style="color: black;">namespace</span>: <span style="color: black;">"mse-demo-public-test"</span></span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">过程</span>五:生效泳道</span></strong></p><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">过程</span>六:效果验证</span></strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">基线版本:</span></p><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">灰度版本:</span><span style="color: black;"><span style="color: black;">增多</span>特征流量 header,x-canary:</span><span style="color: black;">true。</span></p><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"><strong style="color: blue;"><span style="color: black;"><span style="color: black;">将来</span>展望</span></strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">随着内外部客户的接入<span style="color: black;">运用</span>及深度体验,<span style="color: black;">将来</span>微服务引擎 MSE 在全链路灰度发布场景探索将聚焦于以下内容:</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">与云上及开源<span style="color: black;">连续</span>发布工具的无缝集成,实现资源发布与流量调度相匹配的渐进式发布。支持泳道流量规则 YAML 模板化配置,结合发布流水线的调度编排实现资源调度适应性的灰度比例分流,</span><span style="color: black;"><strong style="color: blue;"><span style="color: black;">提高</span>资源利用率及发布效率</strong></span><span style="color: black;">。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">与云上观测<span style="color: black;">制品</span>集成,闭环全链路灰度发布的</span><span style="color: black;"><strong style="color: blue;">可观测性建设</strong></span><span style="color: black;">。支持泳道入口与内部服务的灰度流量指标观测及基于单笔请求灰度标识的全链路<span style="color: black;">跟踪</span>,辅助发布变更的故障感知及边界定位,支撑有效、<span style="color: black;">精细</span>的切流管控策略实施。</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">欢迎感兴趣的用户扫码咨询、<span style="color: black;">运用</span>!</span></p><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;">
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">扫码咨询</strong></p><span style="color: black;">- END&nbsp;-</span><strong style="color: blue;"><span style="color: black;">关联</span>链接</strong><span style="color: black;"> 火山引擎: www.volcengine.com</span><span style="color: black;">[</span><span style="color: black;">2] 火山引擎 MSE:www.volcengine.com/product/mse</span><strong style="color: blue;">火山引擎云原生团队</strong>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">火山引擎云原生团队<span style="color: black;">重点</span>负责火山引擎公有云及私有化场景中 PaaS 类<span style="color: black;">制品</span>体系的构建,结合字节跳动<span style="color: black;">数年</span>的云原生技术栈经验和最佳实践沉淀,<span style="color: black;">帮忙</span>企业加速数字化转型和创新。<span style="color: black;">制品</span><span style="color: black;">包含</span>容器服务、镜像仓库、分布式云原生平台、函数服务、服务网格、<span style="color: black;">连续</span>交付、可观测服务等。</span></p><a style="color: black;"><span style="color: black;"><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"></span></a><a style="color: black;"><span style="color: black;"><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"></span></a>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;"><img src="data:image/svg+xml,%3C%3Fxml version=1.0 encoding=UTF-8%3F%3E%3Csvg width=1px height=1px viewBox=0 0 1 1 version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink%3E%3Ctitle%3E%3C/title%3E%3Cg stroke=none stroke-width=1 fill=none fill-rule=evenodd fill-opacity=0%3E%3Cg transform=translate(-249.000000, -126.000000) fill=%23FFFFFF%3E%3Crect x=249 y=126 width=1 height=1%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E" style="width: 50%; margin-bottom: 20px;"></span></a></p>




j8typz 发表于 2024-10-10 18:36:09

一看到楼主的气势,我就觉得楼主同在社区里灌水。

m5k1umn 发表于 2024-10-22 20:33:35

期待与你深入交流,共探知识的无穷魅力。

wrjc1hod 发表于 2024-10-25 10:36:53

同意、说得对、没错、我也是这么想的等。

m5k1umn 发表于 2024-11-10 08:20:20

楼主继续加油啊!外链论坛加油!
页: [1]
查看完整版本: 基于火山引擎微服务引擎 MSE 的全链路灰度落地实践