当前位置:网站首页>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
社区规划
欢迎加入
边栏推荐
- Getting started with DES encryption
- An example of multi module collaboration based on NCF
- Jhok-zbl1 leakage relay
- The 2022 China low / no code Market Research and model selection evaluation report was released
- 毕业之后才知道的——知网查重原理以及降重举例
- Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding
- "Multimodal" concept
- Go language context explanation
- Initial experience of annotation
- [JS component] custom select
猜你喜欢
Initial experience of annotation
Dj-zbs2 leakage relay
I didn't know it until I graduated -- the principle of HowNet duplication check and examples of weight reduction
什么是依赖注入(DI)
分布式事务解决方案之TCC
The year of the tiger is coming. Come and make a wish. I heard that the wish will come true
毕业之后才知道的——知网查重原理以及降重举例
Distributed global ID generation scheme
Pinduoduo product details interface, pinduoduo product basic information, pinduoduo product attribute interface
Leakage relay jelr-250fg
随机推荐
In memory, I moved from CSDN to blog park!
async / await
随机生成session_id
SQL query: subtract the previous row from the next row and make corresponding calculations
ssm框架的简单案例
Message queue: how to deal with message backlog?
SAP ABAP BDC(批量数据通信)-018
nodejs获取客户端ip
Polynomial locus of order 5
上海字节面试问题及薪资福利
Codeforces Round #416 (Div. 2) D. Vladik and Favorite Game
Preliminary practice of niuke.com (9)
判断文件是否为DICOM文件
《HarmonyOS实战—入门到开发,浅析原子化服务》
Message queue: how to handle repeated messages?
消息队列:重复消息如何处理?
What are the common message queues?
Dj-zbs2 leakage relay
MySQL-CentOS7通过YUM安装MySQL
Message queuing: how to ensure that messages are not lost