当前位置:网站首页>OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
2022-07-07 00:07:00 【InfoQ】
OpenSergo 是什么

- 业内对服务治理的能力和边界没有明确的认识,每个企业所定义的服务治理概念不一致,造成很高的理解和沟通成本。
- 开源微服务框架众多,对于服务治理缺乏一些标准化的约定。例如,Spring Cloud 中定义的微服务接口和 Dubbo 中定义的接口就没有办法互通,通过 Dubbo 和 Istio 管理的微服务也没有办法进行统一治理。开发者无法通过统一的配置方式来对不同框架、不同语言的服务进行统一治理管控。
- 缺少真正面向业务、能够减轻认知负担的抽象和标准。开发者真正想要的可能是简单的、指定服务间的调用关系和配置规则。但现在对于业务开发者来说,不仅需要了解不同微服务框架的部署架构,也要了解不同服务治理方式的概念和能力区别,认知成本很大。


- OpenSergo spec:统一的服务协议与 CRD 标准定义
- OpenSergo 多语言 SDK:提供统一的标准 CRD 对接模块,供各个框架组件对接 OpenSergo spec
- OpenSergo 数据面:即对接 OpenSergo spec 的框架组件,均可通过 OpenSergo 标准方式进行统一治理
- OpenSergo 控制面:提供统一的控制台来进行服务元信息查询以及流量路由、流量控制等治理规则配置。
OpenSergo 标准介绍
流量路由
- Workload 标签规则 (WorkloadLabelRule):将某一组 workload(如 Kubernetes Deployment, Statefulset 或者一组 pod,或某个 JVM 进程,甚至是一组 DB 实例)打上对应的标签
- 流量标签规则 (TrafficLabelRule):将具有某些属性特征的流量,打上对应的标签
- 按照 Workload 标签和流量标签来做匹配路由,将带有指定标签的流量路由到匹配的 workload 中

apiVersion: traffic.opensergo.io/v1alpha1
kind: WorkloadLabelRule
metadata:
name: gray-sts-label-rule
spec:
workloadLabels: ['gray']
selector:
app: my-app-gray
database: 'foo_db'
apiVersion: traffic.opensergo.io/v1alpha1
kind: TrafficLabelRule
metadata:
name: my-traffic-label-rule
labels:
app: my-app
spec:
selector:
app: my-app
trafficLabel: gray
match:
- condition: "==" # 匹配表达式
type: header # 匹配属性类型
key: 'X-User-Id' # 参数名
value: 12345 # 参数值
- condition: "=="
value: "/index"
type: path
流控降级与容错
- Target: 针对什么样的请求
- Strategy: 容错或控制策略,如流控、熔断、并发控制、自适应过载保护、离群实例摘除等
- FallbackAction: 触发后的 fallback 行为,如返回某个错误或状态码

apiVersion: fault-tolerance.opensergo.io/v1alpha1
kind: RateLimitStrategy
metadata:
name: rate-limit-foo
spec:
metricType: RequestAmount
limitMode: Global
threshold: 10
statDuration: "1s"
---
apiVersion: fault-tolerance.opensergo.io/v1alpha1
kind: HttpRequestFallbackAction
metadata:
name: fallback-foo
spec:
behavior: ReturnProvidedResponse
behaviorDesc:
# 触发策略控制后,HTTP 请求返回 429 状态码,同时携带指定的内容和 header.
responseStatusCode: 429
responseContentBody: "Blocked by Sentinel"
responseAdditionalHeaders:
- key: X-Sentinel-Limit
value: "foo"
---
apiVersion: fault-tolerance.opensergo.io/v1alpha1
kind: FaultToleranceRule
metadata:
name: my-rule
namespace: prod
labels:
app: my-app # 规则配置生效的应用名
spec:
targets:
- targetResourceName: '/foo'
strategies:
- name: rate-limit-foo
fallbackAction: fallback-foo
社区规划

欢迎加入

边栏推荐
- Nodejs get client IP
- async / await
- App clear data source code tracking
- Initial experience of annotation
- The 2022 China low / no code Market Research and model selection evaluation report was released
- Lombok plug-in
- Getting started with DES encryption
- 5. Data access - entityframework integration
- Introduction to distributed transactions
- Make web content editable
猜你喜欢

随机生成session_id
![[paper reading] semi supervised left atrium segmentation with mutual consistency training](/img/d6/e6db0d76e81e49a83a30f8c1832f09.png)
[paper reading] semi supervised left atrium segmentation with mutual consistency training

Jhok-zbl1 leakage relay
![Reading the paper [sensor enlarged egocentric video captioning with dynamic modal attention]](/img/db/feb719e2715c7b9c669957995e1d83.png)
Reading the paper [sensor enlarged egocentric video captioning with dynamic modal attention]

5. Data access - entityframework integration

AI face editor makes Lena smile

分布式事务解决方案之TCC

EMMC打印cqhci: timeout for tag 10提示分析与解决

Différenciation et introduction des services groupés, distribués et microservices

Dynamic memory management
随机推荐
Five core elements of architecture design
Leakage relay jelr-250fg
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
Web architecture design process
Design, configuration and points for attention of network unicast (one server, multiple clients) simulation using OPNET
MySQL-CentOS7通过YUM安装MySQL
分布式事务解决方案之TCC
分布式全局ID生成方案
Zero sequence aperture of leakage relay jolx-gs62 Φ one hundred
消息队列:消息积压如何处理?
AI人脸编辑让Lena微笑
[论文阅读] A Multi-branch Hybrid Transformer Network for Corneal Endothelial Cell Segmentation
什么是依赖注入(DI)
[paper reading] semi supervised left atrium segmentation with mutual consistency training
不同网段之间实现GDB远程调试功能
[JS component] custom select
高级程序员必知必会,一文详解MySQL主从同步原理,推荐收藏
AI face editor makes Lena smile
4. Object mapping Mapster
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server