当前位置:网站首页>Zadig 面向开发者的自测联调子环境技术方案详解
Zadig 面向开发者的自测联调子环境技术方案详解
2022-06-28 21:46:00 【InfoQ】
- 创建/销毁环境
- 复制环境
- 托管环境
- 自测模式(自 v1.11.0 版本推出)
服务形态

A -> B -> Cx-env=dev1A' -> B -> C'x-env=dev2A -> B'' -> C''
模型

- 一个 K8s 集群,可以有多套自测环境
- 每个项目,可以有多套自测环境
- 每个自测环境中,拥有一个基准环境和 n 个子环境 (n≥0)
- 每个自测环境中,所有服务全部在一个 K8s 集群,不能跨集群部署
- 每个自测环境中,子环境仅能和基准环境交互,请求链至多经过一个子环境
- 每个自测环境中,不支持子环境间请求交互
- 服务在一个环境中,至多有一个版本
- 任意时刻,基准环境拥有全量服务
- 同步请求的服务间通过 K8s Service 访问
- 同步请求的请求链通过 tracing 信息串接
- 子环境中可操作 (新增/删除/更新) 的服务是基准环境服务的子集
- 基准环境、子环境、直接访问者需要在同一个 Mesh 中
实现原理
- 链路上各个组件和服务能够根据请求流量特征进行动态路由
- 需要识别出不同的灰度流量
- 需要对流量进行灰度标识
- 需要对服务下的所有节点进行分组,能够区分服务版本
- 所有流量都经过流量管理组件 --- 根据流量特征进行动态路由
- 可在流量管理组件层面配置路由规则 --- 可控灰度标
- 经过流量管理组件的流量保持特殊标记 --- 灰度标可全链路传递
- 流量管理组件能够根据流量标记,选择出对应的服务实例 --- 由业务无关组件执行 动态路由/服务发现
- 不同版本的服务可部署在不同的环境中 -- 区分服务版本
- 所有 (南北/东西) 流量均经过网关
- 部分东西流量不经过网关
- 可以基于 http header 等动态路由流量
- 基于 K8s Service 做服务发现
- proxy 支持 header propagation
- 暂不支持 SMI TrafficSplit v1alpha3/v1alpha4,即不支持基于 http header 等做动态路由,issue 参见link
- 暂不支持 header propagation,issue 参见link
技术实现
流量管理
- VirtualService
- EnvoyFilter

- DestinationRule 也是 Istio 中常用的资源,在 VirtualSerivce 路由生效后,控制流量实际导入的服务
- 但通过 Zadig 自测模式的模型可知,一个环境仅会部署服务至多一个版本,可通过环境区分服务版本,故无需借助 DestinationRule 来区分一个环境中同一类服务的不同版本
灰度标传递
- 应用自身对于入请求引发的出请求,主动传递对应的灰度标
- 集成了 tracing 能力的应用,会通过 tracing sdk 等通过 trace id 等串联请求,Istio 可在服务接收到请求时记录 trace id 和灰度标的关系,然后服务发出请求时根据 trace id 自动增加灰度标
- 对于 Java 语言,可通过 Java Agent 劫持程序运行时流量,根据入请求引发的出请求,自动添加灰度标

- 当请求进入服务时,Envoy 会请求 Cache 服务记录 trace id 和 灰度标 的对应关系
- 当请求流出服务时,Envoy 会根据请求中的 trace id,查询 Cache 服务获取 灰度标,配置在出请求
用户操作实现

核心代码
- K8s 项目:
- 后端:https://github.com/koderover/zadig/pull/1214
- 前端:https://github.com/koderover/zadig-portal/pull/660
- Helm 项目:
- 后端:https://github.com/koderover/zadig/pull/1425
- 前端:https://github.com/koderover/zadig-portal/pull/791
展望
边栏推荐
- Ctrip will push the "3+2" working mode: 3 days a week on duty and 2 days of free choice of office space. Do you envy it?
- PHP login problem
- be careful! The PMP emergency postponement exam is due today!
- 17 `bs object Node name h3 Parent ` parents get parent node ancestor node
- [software test] 2022 national unified college enrollment examination
- Native implementation Net 5.0+ custom log
- LxC shared USB device
- CORBA Architecture Guide (Common Object Request Broker Architecture)
- [width first search note] BFS output shortest path
- [webapi] return dynamic list dynamic
猜你喜欢

Multinomial distribution (a discrete distribution)

安全 创新 实践|海泰方圆受邀参加“数字时代的网信创新与价值共创”技术交流研讨会

【激活函数】

如何制作精美的图片
![[golang] leetcode intermediate subset & Word Search](/img/3a/f63892160c25196335a633424c6d99.jpg)
[golang] leetcode intermediate subset & Word Search

华为云的AI深潜之旅

IPv6 comprehensive experiment

If you are a C developer, look at these three explicit programming techniques

科技巨头成立元宇宙标准论坛,走向开放还是建立围城?

硬件开发笔记(七): 硬件开发基本流程,制作一个USB转RS232的模块(六):创建0603封装并关联原理图元器件
随机推荐
Deploy grafana to realize graphical monitoring
小样本利器2.文本对抗+半监督 FGSM & VAT & FGM代码实现
HTTP Caching Protocol practice
Why use the rust language?
Wechat applet realizes left sliding deletion
Go cryptobin common encryption and decryption Libraries
BOE was brilliant for the Winter Olympics, but revealed another Chinese technology enterprise dominating the world
Safety innovation practice | Haitai Fangyuan was invited to participate in the technical exchange Seminar on "network information innovation and value co creation in the digital age"
ansible生产环境使用场景(七):批量部署elk客户端
Competition rules for the "network security" event of the secondary vocational group in the skills competition of Guangxi Vocational Colleges in 2022
Is the VIP securities account of qiniu school really safe and regular? How do I say this?
go-cryptobin 常用加密解密库
【HackTheBox】 meow
Dart的类扩展、可选类型扩展
QStringLiteral(str)
Alist+raidrive gives the computer a complete 8billion GB hard disk drive
Axure custom components
Sword finger offer:[day 2 linked list (simple)] --- > print the linked list from end to end
Rule engine development experience sharing - reddit
Study on luminiprobe non fluorescent azide -- 3-azido propanol