Skip to content

Commit d0a419b

Browse files
authored
chore(doc, chart): add traffic-qos.md, update chart version to v0.3.1, (#376)
update example Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com> Signed-off-by: xuanyuan300 <xuanyuan300@gmail.com>
1 parent 2184ac1 commit d0a419b

17 files changed

Lines changed: 496 additions & 5 deletions

File tree

charts/pisa-controller/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ version: 0.2.0
3737
# incremented each time you make changes to the application. Versions are not expected to
3838
# follow Semantic Versioning. They should reflect the version the application is using.
3939
# It is recommended to use it with quotes.
40-
appVersion: "0.2.0"
40+
appVersion: "0.3.1"
4141

4242
dependencies:
4343
- name: common
4444
repository: https://charts.bitnami.com/bitnami
4545
tags:
4646
- bitnami-common
47-
version: 1.x.x
47+
version: 1.x.x

charts/pisa-controller/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ image:
2828
repository: pisanixio/controller
2929
pullPolicy: Always
3030
# Overrides the image tag whose default is the chart appVersion.
31-
tag: "v0.3.0"
31+
tag: "v0.3.1"
3232
imagePullSecrets: [ ]
3333

3434
## @param proxyImage.repository 需要注入的 pisa-proxy 的镜像名
3535
## @param proxyImage.tag 需要注入的 pisa-proxy 镜像tag
3636
proxyImage:
3737
repository: pisanixio/proxy
38-
tag: "v0.3.0"
38+
tag: "v0.3.1"
3939

4040
## @param resources.limits pisa-controller 资源限制数值
4141
## @param resources.requests.cpu pisa-controller 资源申请cpu核数

docs/docs/Features/traffic-qos.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
sidebar_position: 8
3+
---
4+
5+
# Pisa-Daemon
6+
7+
Pisa-Daemon 是用 rust 实现的数据面,主要通过主机内核的各种能力来实现资源管理。
8+
目前的主要功能是:
9+
* 运行时流量管理
10+
借助 eBPF 技术为数据库访问流量提供 QoS 保证,以减少流量之间的互相干扰。
11+
12+
Pisa-Daemon 即可以部署在 kubernetes 中以 daemonset 的方式部署,也可以单独部署。
13+
14+
# 现状
15+
当前 Pisa-Damon 实现了 Service 级别的 QoS,Service 来自 VirtualDatabase 中的定义。
16+
17+
主要实现技术是 ebpf + tc。
18+
19+
# 配置
20+
21+
* 在 kubernetes 中部署,需要依赖 `QoSClaim` CRD, Spec 配置项如下:
22+
23+
| 属性 | 值类型 | 是否依赖 | 默认值 | 含义 |
24+
|-----|-------|---------|-------|-----|
25+
|trafficQoS | [object](#trafficQoS-配置) ||| traffic qos |
26+
27+
28+
## trafficQoS 配置
29+
| 属性 | 值类型 | 是否依赖 | 默认值 | 含义 |
30+
|-----|-------|---------|-------|-----|
31+
|name | string||| qos 名称 |
32+
|qos_group| [object](#qos_group-配置)||| 具体带宽限制 |
33+
34+
### qos_group 配置
35+
| 属性 | 值类型 | 是否依赖 | 默认值 | 含义 |
36+
|-----|-------|---------|-------|-----|
37+
|rate | string||| 带宽最大值|
38+
|ceil | string||| 如果带宽有剩余,带宽可以达到的最大值 |
39+
40+
rate 和 ceil 的单位可以是
41+
42+
bit, kbit, mbit, gbit,tbit 表示 bit/s。
43+
44+
bps,kbps, mbps, gbps, tbps 表示 bps/s。
45+
46+
47+
注意点:
48+
49+
* 配置了 QoSClaim 后,需要在 VirtualDatabase 中配置 `qosClaim` 以生效。
50+
* trafficQos 的 name 名称要包含在 VirtualDatabase 的 Serivice 中。
51+
52+
示例:
53+
``` yaml
54+
apiVersion: core.database-mesh.io/v1alpha1
55+
kind: QoSCliam
56+
metadata:
57+
name: test
58+
namespace: default
59+
spec:
60+
trafficQoS:
61+
name: svc1
62+
qos_group:
63+
rate: 1mps
64+
ceil: 2mps
65+
```
66+
67+
* 单独部署配置如下:
68+
69+
``` toml
70+
[global]
71+
egress_device = "cali16adef18cfd"
72+
bridge_device = "tunl0"
73+
74+
[[app]]
75+
name = "test1"
76+
77+
[[app.service]]
78+
name = "test"
79+
[[app.service.endpoints]]
80+
ip = "192.168.136.29"
81+
port = 5201
82+
83+
[app.service.qos_group]
84+
rate = "5mbps"
85+
ceil = "5mbps"
86+
```
File renamed without changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
##
2+
## Copyright 2022 SphereEx Authors
3+
##
4+
## Licensed under the Apache License, Version 2.0 (the "License");
5+
## you may not use this file except in compliance with the License.
6+
## You may obtain a copy of the License at
7+
##
8+
## http://www.apache.org/licenses/LICENSE-2.0
9+
##
10+
## Unless required by applicable law or agreed to in writing, software
11+
## distributed under the License is distributed on an "AS IS" BASIS,
12+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
## See the License for the specific language governing permissions and
14+
## limitations under the License.
15+
##
16+
17+
apiVersion: core.database-mesh.io/v1alpha1
18+
kind: DatabaseEndpoint
19+
metadata:
20+
labels:
21+
source: test
22+
name: ds001
23+
namespace: default
24+
spec:
25+
database:
26+
MySQL:
27+
db: test
28+
host: mysql1.default
29+
password: root
30+
port: 3306
31+
user: root
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
##
2+
## Copyright 2022 SphereEx Authors
3+
##
4+
## Licensed under the Apache License, Version 2.0 (the "License");
5+
## you may not use this file except in compliance with the License.
6+
## You may obtain a copy of the License at
7+
##
8+
## http://www.apache.org/licenses/LICENSE-2.0
9+
##
10+
## Unless required by applicable law or agreed to in writing, software
11+
## distributed under the License is distributed on an "AS IS" BASIS,
12+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
## See the License for the specific language governing permissions and
14+
## limitations under the License.
15+
##
16+
17+
apiVersion: core.database-mesh.io/v1alpha1
18+
kind: DatabaseEndpoint
19+
metadata:
20+
labels:
21+
source: test
22+
name: ds002
23+
namespace: default
24+
spec:
25+
database:
26+
MySQL:
27+
db: test
28+
host: mysql2.default
29+
password: root
30+
port: 3306
31+
user: root
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
##
2+
## Copyright 2022 SphereEx Authors
3+
##
4+
## Licensed under the Apache License, Version 2.0 (the "License");
5+
## you may not use this file except in compliance with the License.
6+
## You may obtain a copy of the License at
7+
##
8+
## http://www.apache.org/licenses/LICENSE-2.0
9+
##
10+
## Unless required by applicable law or agreed to in writing, software
11+
## distributed under the License is distributed on an "AS IS" BASIS,
12+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
## See the License for the specific language governing permissions and
14+
## limitations under the License.
15+
##
16+
17+
apiVersion: core.database-mesh.io/v1alpha1
18+
kind: DataShard
19+
metadata:
20+
name: test
21+
namespace: default
22+
labels:
23+
source: test
24+
spec:
25+
rules:
26+
- tableName: "t_order"
27+
databaseStrategy:
28+
databaseShardingAlgorithmName: "mod"
29+
databaseShardingColumn: "id"
30+
actualDatanodes:
31+
valueSource:
32+
nodes:
33+
- value: "ds001"
34+
- value: "ds002"
35+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
##
2+
## Copyright 2022 SphereEx Authors
3+
##
4+
## Licensed under the Apache License, Version 2.0 (the "License");
5+
## you may not use this file except in compliance with the License.
6+
## You may obtain a copy of the License at
7+
##
8+
## http://www.apache.org/licenses/LICENSE-2.0
9+
##
10+
## Unless required by applicable law or agreed to in writing, software
11+
## distributed under the License is distributed on an "AS IS" BASIS,
12+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
## See the License for the specific language governing permissions and
14+
## limitations under the License.
15+
##
16+
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
metadata:
20+
labels:
21+
app: mysql1
22+
name: mysql1
23+
namespace: default
24+
spec:
25+
progressDeadlineSeconds: 600
26+
replicas: 1
27+
revisionHistoryLimit: 10
28+
selector:
29+
matchLabels:
30+
app: mysql1
31+
strategy:
32+
type: Recreate
33+
template:
34+
metadata:
35+
labels:
36+
app: mysql1
37+
spec:
38+
containers:
39+
- env:
40+
- name: MYSQL_ROOT_PASSWORD
41+
value: root
42+
image: mysql:5.7
43+
imagePullPolicy: IfNotPresent
44+
name: mysql
45+
ports:
46+
- containerPort: 3306
47+
protocol: TCP
48+
resources: {}
49+
terminationMessagePath: /dev/termination-log
50+
terminationMessagePolicy: File
51+
dnsPolicy: ClusterFirst
52+
restartPolicy: Always
53+
schedulerName: default-scheduler
54+
securityContext: {}
55+
terminationGracePeriodSeconds: 30
56+
---
57+
apiVersion: v1
58+
kind: Service
59+
metadata:
60+
name: mysql1
61+
namespace: default
62+
spec:
63+
ports:
64+
- port: 3306
65+
protocol: TCP
66+
targetPort: 3306
67+
selector:
68+
app: mysql1
69+
sessionAffinity: None
70+
type: ClusterIP
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
##
2+
## Copyright 2022 SphereEx Authors
3+
##
4+
## Licensed under the Apache License, Version 2.0 (the "License");
5+
## you may not use this file except in compliance with the License.
6+
## You may obtain a copy of the License at
7+
##
8+
## http://www.apache.org/licenses/LICENSE-2.0
9+
##
10+
## Unless required by applicable law or agreed to in writing, software
11+
## distributed under the License is distributed on an "AS IS" BASIS,
12+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
## See the License for the specific language governing permissions and
14+
## limitations under the License.
15+
##
16+
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
metadata:
20+
labels:
21+
app: mysql2
22+
name: mysql2
23+
namespace: default
24+
spec:
25+
progressDeadlineSeconds: 600
26+
replicas: 1
27+
revisionHistoryLimit: 10
28+
selector:
29+
matchLabels:
30+
app: mysql2
31+
strategy:
32+
type: Recreate
33+
template:
34+
metadata:
35+
labels:
36+
app: mysql2
37+
spec:
38+
containers:
39+
- env:
40+
- name: MYSQL_ROOT_PASSWORD
41+
value: root
42+
image: mysql:5.7
43+
imagePullPolicy: IfNotPresent
44+
name: mysql
45+
ports:
46+
- containerPort: 3306
47+
protocol: TCP
48+
resources: {}
49+
terminationMessagePath: /dev/termination-log
50+
terminationMessagePolicy: File
51+
dnsPolicy: ClusterFirst
52+
restartPolicy: Always
53+
schedulerName: default-scheduler
54+
securityContext: {}
55+
terminationGracePeriodSeconds: 30
56+
---
57+
apiVersion: v1
58+
kind: Service
59+
metadata:
60+
name: mysql2
61+
namespace: default
62+
spec:
63+
ports:
64+
- port: 3306
65+
protocol: TCP
66+
targetPort: 3306
67+
selector:
68+
app: mysql2
69+
sessionAffinity: None
70+
type: ClusterIP
File renamed without changes.

0 commit comments

Comments
 (0)