Skip to content

Commit

Permalink
feat: smartLimiter and dubbo support
Browse files Browse the repository at this point in the history
Signed-off-by: yutao04 <[email protected]>
  • Loading branch information
trickMin committed Jan 5, 2023
1 parent 738d26a commit a4849fa
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 50 deletions.
6 changes: 3 additions & 3 deletions changelog/RoadMap 2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
* 【治理】支持流量染色
* 【治理】支持WAF防护

### Hango 1.2.0(发布中)
### Hango 1.2.0(已发布)

* 【多协议】支持基于dubbo bridge的dubbo协议转换能力
* 【易用性】安全正则复杂度校验以支持拒绝复杂正则
* 【易用性】支持插件的部分常规输入校验
* 【治理】集成smartlimit,统一集群限流,本地限流实现

### Hango 1.3.0(规划中)
### Hango 1.3.0(发布中)

* 【高可用】支持基于多集群的两地三中心高可用部署
* 【高可用】支持基于Region、Zone、Sub-zone的区域路由优先能力
Expand Down
13 changes: 13 additions & 0 deletions changelog/announcing-v1.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### 描述
本次更新是Hango正式版v1.2.0的发布。基于v1.0.0版本集成了dubbo bridge、基于SmartLimiter的自适应本地限流等功能

### 新功能

- [支持dubbo服务发现](https://github.com/hango-io/api-plane/pull/13)

- [支持SmartLimiter的本地限流](https://github.com/hango-io/hango-gateway/pull/47)


### 工程增强

- [增加部分插件校验](https://github.com/hango-io/hango-gateway/pull/47)
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ data:
cfg: |
{"bundle":{"modules":[{"name":"plugin","kind":"plugin"},{"name":"limiter","kind":"limiter"},{"name":"meshregistry","kind":"meshregistry"}]},"enable":true,"global":{"service":"","istioNamespace":"hango-system","slimeNamespace":"hango-system","istioRev":"","configRev":"mesh-reg","configSources":[{"address":"ss://"}],"log":{"klogLevel":5,"logLevel":"info"},"misc":{"pathRedirect":"/ready->/meshregistry/ready,/pc->/meshregistry/pc,/nc->/meshregistry/nc,/zk->/meshregistry/zk,/zks->/meshregistry/zks,/xdsCache->/meshregistry/xdsCache","xdsSourceEnableIncPush":"true"}},"name":"bundle"}
cfg_limiter: |
{"enable":true,"general":{"disableAdaptive":true,"disableGlobalRateLimit":true,"disableInsertGlobalRateLimit":true},"kind":"limiter","mode":"BundleItem","name":"limiter"}
{"enable":true,"general":{"disableInsertLocalRateLimit":true,"disableAdaptive":true,"disableGlobalRateLimit":true,"disableInsertGlobalRateLimit":true},"kind":"limiter","mode":"BundleItem","name":"limiter"}
cfg_plugin: |
{"enable":true,"kind":"plugin","mode":"BundleItem","name":"plugin"}
cfg_meshregistry: |
{"name":"meshregistry","kind":"meshregistry","enable":true,"mode":"BundleItem","general":{"LEGACY":{"MeshConfigFile":"","RevCrds":"","Mcp":{},"K8SSource":{"Enabled":false},"EurekaSource":{"Enabled":{{ .Values.registry.eureka.enable }},"Address":[{{ .Values.registry.eureka.address }}],"RefreshPeriod":"{{ .Values.registry.eureka.refresh_period }}","GatewayModel":true},"NacosSource":{"Enabled":{{ .Values.registry.nacos.enable }},"Address":[{{ .Values.registry.nacos.address }}],"GatewayModel":true,"Group":"{{ .Values.registry.nacos.service_group }}"}}}}
{"name":"meshregistry","kind":"meshregistry","enable":true,"mode":"BundleItem","general":{"LEGACY":{"MeshConfigFile":"","RevCrds":"","Mcp":{},"K8SSource":{"Enabled":false},"EurekaSource":{"Enabled":{{ .Values.registry.eureka.enable }},"Address":[{{ .Values.registry.eureka.address }}],"RefreshPeriod":"{{ .Values.registry.eureka.refresh_period }}","GatewayModel":true},"NacosSource":{"Enabled":{{ .Values.registry.nacos.enable }},"Address":[{{ .Values.registry.nacos.address }}],"GatewayModel":true,"Group":"{{ .Values.registry.nacos.service_group }}"},"ZookeeperSource":{"Enabled":{{ .Values.registry.zk.enable }},"WaitTime":{{ .Values.registry.zk.refresh_period }},"GatewayModel":true,"Address":[{{ .Values.registry.zk.address }}]}}}}
kind: ConfigMap
metadata:
name: slime-hango
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- name: NCE_PORT
value: "10880"
- name: NCE_JAVA_OPTS
value: "-DistioNamespace={{ .Values.namespace }} -DistioName=istiod -DstartInformer=false -DresourceNamespace={{ .Values.namespace }} "
value: "-DistioNamespace={{ .Values.namespace }} -DistioName=istiod -DstartInformer=false -DresourceNamespace={{ .Values.namespace }} -DmeshRegistryName=slime-hango"
image: "{{.Values.images.hango_apiplane_image}}"
name: tomcat
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,26 +160,24 @@ data:
"name": "local-limiting"
},
"layouts": [
{
"key": "IsSafe",
"alias": "是否线程独立",
"type": "switch",
"help": "默认使用锁机制保证安全;如果打开该字段,代表线程独立。限流规则上限为rate*proxy worker"
},
{
"key": "limit_by_list",
"alias": "限流标识列表",
"alias": "限制规则列表",
"type": "array",
"layouts": [
{
"key": "headers",
"alias": "限流headers",
"alias": "请求头匹配",
"type": "array",
"layouts": [
{
"key": "headerKey",
"alias": "限流header",
"type": "input"
"alias": "请求头名称",
"type": "input",
"rules": [
"Required",
"MaxLength(200)"
]
},
{
"key": "match_type",
Expand All @@ -195,16 +193,18 @@ data:
"text": "正则表达式",
"value": "safe_regex_match"
}
],
"rules": [
"Required"
]
},
{
"key": "value",
"type": "input",
"alias": "取值",
"invisible": {
"present_match": ["this", "match_type"],
"present_match_invert": ["this", "match_type"]
}
"rules": [
"Required"
]
}
]
},
Expand All @@ -214,7 +214,7 @@ data:
"type": "number",
"rules": [
"Number",
"MinNumber(0)"
"MinNumber(1)"
]
},
{
Expand All @@ -223,7 +223,7 @@ data:
"type": "number",
"rules": [
"Number",
"MinNumber(0)"
"MinNumber(1)"
]
},
{
Expand All @@ -232,7 +232,7 @@ data:
"type": "number",
"rules": [
"Number",
"MinNumber(0)"
"MinNumber(1)"
]
},
{
Expand All @@ -241,7 +241,7 @@ data:
"type": "number",
"rules": [
"Number",
"MinNumber(0)"
"MinNumber(1)"
]
}
]
Expand Down Expand Up @@ -654,6 +654,9 @@ data:
"alias": "请求头名称",
"type": "input"
},
"rules": [
"MaxLength(200)"
],
{
"key": "match_type",
"alias": "匹配方式",
Expand Down Expand Up @@ -749,6 +752,9 @@ data:
"alias": "响应头名称",
"type": "input"
},
"rules": [
"MaxLength(200)"
],
{
"key": "match_type",
"alias": "匹配方式",
Expand Down Expand Up @@ -807,7 +813,7 @@ data:
"Required",
"Number",
"MinNumber(0)",
"MaxNumber(99999999)"
"MaxNumber(86400000)"
]
},
{
Expand All @@ -822,7 +828,10 @@ data:
"help": "支持输入具体的响应码及X..,如2..代表2XX响应码",
"type": "input",
"rules": [
"Required"
"Required",
"Number",
"MinNumber(200)",
"MaxNumber(599)"
]
},
{
Expand All @@ -833,7 +842,7 @@ data:
"Required",
"Number",
"MinNumber(0)",
"MaxNumber(99999999)"
"MaxNumber(86400000)"
]
}
]
Expand Down Expand Up @@ -866,13 +875,19 @@ data:
"key": "queryString",
"alias": "自定义查询参数",
"help": "自定义查询参数参与key计算",
"type": "multi_input"
"type": "multi_input",
"rules": [
"MaxLength(200)"
]
},
{
"key": "headers",
"alias": "自定义请求头",
"type": "multi_input",
"help": "自定义请求头参与key计算"
"help": "自定义请求头参与key计算",
"rules": [
"MaxLength(200)"
]
}
]
}
Expand Down Expand Up @@ -1083,7 +1098,8 @@ data:
"this.operation": "delete"
},
"rules": [
"Required"
"Required",
"MaxLength(200)"
]
}
]
Expand Down Expand Up @@ -1158,12 +1174,12 @@ data:
"alias": "最小请求次数",
"help": "与错误百分比阈值搭配生效,仅在统计窗口内,最小请求次数与错误百分比阈值同时满足时触发熔断",
"type": "input",
"placeholder": "范围 [1, 4294967295] 之间",
"placeholder": "范围 [1, 1000000] 之间",
"rules": [
"Required",
"Number",
"MinNumber(1)",
"MaxNumber(4294967295)"
"MaxNumber(1000000)"
]
}
]
Expand Down Expand Up @@ -1194,13 +1210,13 @@ data:
{
"key": "consecutiveSlowRequests",
"alias": "连续慢响应次数",
"help": "与响应时间阈值,范围 [1, 4294967295] 之间,与慢响应时间阈值搭配生效,当连续有",
"help": "与响应时间阈值,范围 [1, 10000] 之间,与慢响应时间阈值搭配生效,当连续有",
"type": "input",
"rules": [
"Required",
"Number",
"MinNumber(1)",
"MaxNumber(4294967295)"
"MaxNumber(10000)"
]
}
]
Expand All @@ -1210,25 +1226,25 @@ data:
"alias": "统计窗口",
"help": "统计窗口,单位s,默认10s,最大值为120s",
"type": "input",
"placeholder": "单位s,范围(0.0,120.0)",
"placeholder": "单位s,范围[1, 120]",
"rules": [
"Required",
"FloatNumber(5)",
"MaxFloatNumber(119.999)",
"MinFloatNumber(0.00001)"
"Number",
"MinNumber(1)",
"MaxNumber(120)"
]
},
{
"key": "breakDuration",
"alias": "惩罚时间",
"help": "当触发熔断时的惩罚时间,单位s,在该时间内不再请求后端服务而之间返回熔断后的定制响应",
"type": "input",
"placeholder": "单位s,范围 (0.0, 10000]",
"placeholder": "单位s,范围 [1, 7200]",
"rules": [
"Required",
"FloatNumber(5)",
"MaxFloatNumber(10000.0)",
"MinFloatNumber(0.00001)"
"Number",
"MinNumber(1)",
"MaxNumber(7200)"
]
},
{
Expand Down Expand Up @@ -1259,15 +1275,17 @@ data:
"type": "input",
"alias": "响应头名称",
"rules": [
"Required"
"Required",
"MaxLength(200)"
]
},
{
"key": "value",
"type": "input",
"alias": "响应头值",
"rules": [
"Required"
"Required",
"MaxLength(200)"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ spec:
name: proxy.filters.http.iprestriction
port: 80
- enable: true
inline:
settings:
stat_prefix: http_local_rate_limiter
listenerType: Gateway
name: proxy.filters.http.locallimit
name: envoy.filters.http.local_ratelimit
port: 80
- enable: true
listenerType: Gateway
Expand Down
17 changes: 12 additions & 5 deletions install/helm/hango-gateway/charts/hango-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ data_dir: /data
cluster_dns_domain: cluster.local

images:
hango_apiplane_image: docker.io/hangoio/api-plane:1.1.0
hango_portal_image: docker.io/hangoio/hango-portal:1.1.0
hango_apiplane_image: docker.io/hangoio/api-plane:1.2.0
hango_portal_image: docker.io/hangoio/hango-portal:1.2.0
hango_ui_image: docker.io/hangoio/hango-ui:v1.0.3-1e003c49
istiod_image: docker.io/hangoio/istiod:hango-1.0.0-rc1
istiod_image: docker.io/hangoio/pilot:hango-1.2.0-rc1
slime_image: docker.io/slimeio/slime-bundle-hango:hango-ee2bff9_linux_amd64
hango_proxy_image: hangoio/envoy-proxy:v1.1.0-46f6660-amd64
hango_proxy_image: hangoio/envoy-proxy:v1.2.1-215c540-amd64


namespace: hango-system
Expand Down Expand Up @@ -43,4 +43,11 @@ registry:
## 刷新eureka服务缓存的时间周期,默认15s,格式为: [正整数]s
refresh_period: 15s
## 注册中心实例地址;格式:整体以英文单引号包裹,单个地址以英文双引号包裹,多个地址用英文逗号分隔
address: '"http://127.0.0.1:8761/eureka"'
address: '"http://127.0.0.1:8761/eureka"'
zk:
## zookeeper注册中心功能开关(true 或 false)
enable: false
## 刷新zookeeper服务缓存的时间周期,默认15s,格式为: [正整数]s
refresh_period: 15s
## 注册中心实例地址;格式:整体以英文单引号包裹,单个地址以英文双引号包裹,多个地址用英文逗号分隔
address: '"zookeeper.apigw-demo.svc.cluster.local:2181"'

0 comments on commit a4849fa

Please sign in to comment.