Skip to content

Commit fa0435e

Browse files
committed
feat(dist): add kong note of gateway
1 parent e76b3f4 commit fa0435e

File tree

8 files changed

+88
-1
lines changed

8 files changed

+88
-1
lines changed

dist/gateway/kong/1.route.md

Whitespace-only changes.

dist/gateway/kong/2.service.md

Whitespace-only changes.

dist/gateway/kong/3.upstream.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[toc]
2+
3+
## upstream(上有服务)
4+
5+
1. 将流量转发到的多个 target 的集合, target 可以是域名/ip+port
6+
2. 功能
7+
8+
- **负载均衡**: `基于 DNS 的负载均衡` || `Ring-balancer(环形均衡器)`
9+
- 健康检查: 主动检查 || 被动检查, 将流量转发至其它健康的 target
10+
- 熔断: 根据健康检查的状态, 对客户端请求进行熔断, 防止后端级联服务雪崩
11+
12+
## 负载均衡: [hash 一致性算法](https://mp.weixin.qq.com/s/76R-JD5zWzixrBQb6WYjXQ)
13+
14+
1. 轮询、加权轮询、随机选择
15+
16+
### DNS 负载均衡
17+
18+
### 环形均衡器: Ring-balancer
19+
20+
## 健康检查
21+
22+
1. 主动检查
23+
2. 被动检查
24+
25+
## target
26+
27+
---
28+
29+
## reference
30+
31+
1. https://www.jianshu.com/p/b44400618c69

dist/gateway/kong/4.target.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[3.upstream link](./3.upstream.md)

dist/gateway/kong/5.consumer.md

Whitespace-only changes.

dist/gateway/kong/6.plugins.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
[toc]
2+
3+
## plugins(kong/openresty/nginx 的精魂所在)
4+
5+
1. Kong 开源版本提供 8 个类型 共 28 个插件
6+
7+
- **身份认证类**: 只有认证后才能使用 consumer 概念
8+
- 安全防护类
9+
- **流量控制类**
10+
- 云平台插件类
11+
- 分析监控类
12+
- 转换请求类型类
13+
- **日志记录类**
14+
- 其他插件类
15+
16+
2. 常见的插件应用
17+
18+
- Ip restriction: 黑白名单
19+
20+
1. 可以配置一个区段, 也可以是特定的 IP 地址
21+
2. 可以针对所有的消费方, 也可以是特定的某个消费方
22+
3. 可以针对所有的 API, 也可以针对特定的 API 接口
23+
4. 黑白名单能同时配置并生效(docker 内可能会是 172.22.0.1)
24+
25+
- Oauth2: 需要 api 本身就是 https 且设置 only_https=true
26+
27+
1. Authorization code: 授权码模式
28+
2. Implicit Grant: 隐式模式
29+
3. Resource Owner Password Credentials: 密码模式
30+
4. Client Credentials: 客户端模式
31+
32+
- **Jwt**
33+
- Rate limiting: 限流请求
34+
- request termination
35+
36+
1. 使用指定的状态代码和消息终止传入请求
37+
2. 允许暂时阻止 API 或 Consumer, 但不能触发阈值自动熔断: 实际意义不大
38+
3. 可用于发版部署的时候率先熔断服务
39+
40+
- File-log
41+
42+
1. 将请求和响应数据附加到磁盘上的日志文件
43+
2. 指定路径为文件全路径不是目录路径
44+
45+
- http-log: 将请求和响应日志发送到 HTTP 服务器
46+
- Prometheus: 监控, 公开与 Kong 和代理上游服务相关的指标
47+
- Canary: 灰度发布
48+
49+
---
50+
51+
## reference
52+
53+
1. https://docs.konghq.com/hub/

dist/gateway/01.kong.md renamed to dist/gateway/kong/readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[toc]
22

3-
## intros
3+
## intros/overview
4+
5+
![avatar](/static/image/dist/gateway/kong-flow.png)
46

57
## deploy
68

303 KB
Loading

0 commit comments

Comments
 (0)