-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
2184ac1
commit d0a419b
Showing
17 changed files
with
496 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
sidebar_position: 8 | ||
--- | ||
|
||
# Pisa-Daemon | ||
|
||
Pisa-Daemon 是用 rust 实现的数据面,主要通过主机内核的各种能力来实现资源管理。 | ||
目前的主要功能是: | ||
* 运行时流量管理 | ||
借助 eBPF 技术为数据库访问流量提供 QoS 保证,以减少流量之间的互相干扰。 | ||
|
||
Pisa-Daemon 即可以部署在 kubernetes 中以 daemonset 的方式部署,也可以单独部署。 | ||
|
||
# 现状 | ||
当前 Pisa-Damon 实现了 Service 级别的 QoS,Service 来自 VirtualDatabase 中的定义。 | ||
|
||
主要实现技术是 ebpf + tc。 | ||
|
||
# 配置 | ||
|
||
* 在 kubernetes 中部署,需要依赖 `QoSClaim` CRD, Spec 配置项如下: | ||
|
||
| 属性 | 值类型 | 是否依赖 | 默认值 | 含义 | | ||
|-----|-------|---------|-------|-----| | ||
|trafficQoS | [object](#trafficQoS-配置) | 是 | 无 | traffic qos | | ||
|
||
|
||
## trafficQoS 配置 | ||
| 属性 | 值类型 | 是否依赖 | 默认值 | 含义 | | ||
|-----|-------|---------|-------|-----| | ||
|name | string| 是 | 无 | qos 名称 | | ||
|qos_group| [object](#qos_group-配置)| 否 | 无 | 具体带宽限制 | | ||
|
||
### qos_group 配置 | ||
| 属性 | 值类型 | 是否依赖 | 默认值 | 含义 | | ||
|-----|-------|---------|-------|-----| | ||
|rate | string| 否 | 无 | 带宽最大值| | ||
|ceil | string| 否 | 无 | 如果带宽有剩余,带宽可以达到的最大值 | | ||
|
||
rate 和 ceil 的单位可以是 | ||
|
||
bit, kbit, mbit, gbit,tbit 表示 bit/s。 | ||
|
||
bps,kbps, mbps, gbps, tbps 表示 bps/s。 | ||
|
||
|
||
注意点: | ||
|
||
* 配置了 QoSClaim 后,需要在 VirtualDatabase 中配置 `qosClaim` 以生效。 | ||
* trafficQos 的 name 名称要包含在 VirtualDatabase 的 Serivice 中。 | ||
|
||
示例: | ||
``` yaml | ||
apiVersion: core.database-mesh.io/v1alpha1 | ||
kind: QoSCliam | ||
metadata: | ||
name: test | ||
namespace: default | ||
spec: | ||
trafficQoS: | ||
name: svc1 | ||
qos_group: | ||
rate: 1mps | ||
ceil: 2mps | ||
``` | ||
* 单独部署配置如下: | ||
``` toml | ||
[global] | ||
egress_device = "cali16adef18cfd" | ||
bridge_device = "tunl0" | ||
|
||
[[app]] | ||
name = "test1" | ||
|
||
[[app.service]] | ||
name = "test" | ||
[[app.service.endpoints]] | ||
ip = "192.168.136.29" | ||
port = 5201 | ||
|
||
[app.service.qos_group] | ||
rate = "5mbps" | ||
ceil = "5mbps" | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## | ||
## Copyright 2022 SphereEx Authors | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
|
||
apiVersion: core.database-mesh.io/v1alpha1 | ||
kind: DatabaseEndpoint | ||
metadata: | ||
labels: | ||
source: test | ||
name: ds001 | ||
namespace: default | ||
spec: | ||
database: | ||
MySQL: | ||
db: test | ||
host: mysql1.default | ||
password: root | ||
port: 3306 | ||
user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## | ||
## Copyright 2022 SphereEx Authors | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
|
||
apiVersion: core.database-mesh.io/v1alpha1 | ||
kind: DatabaseEndpoint | ||
metadata: | ||
labels: | ||
source: test | ||
name: ds002 | ||
namespace: default | ||
spec: | ||
database: | ||
MySQL: | ||
db: test | ||
host: mysql2.default | ||
password: root | ||
port: 3306 | ||
user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## | ||
## Copyright 2022 SphereEx Authors | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
|
||
apiVersion: core.database-mesh.io/v1alpha1 | ||
kind: DataShard | ||
metadata: | ||
name: test | ||
namespace: default | ||
labels: | ||
source: test | ||
spec: | ||
rules: | ||
- tableName: "t_order" | ||
databaseStrategy: | ||
databaseShardingAlgorithmName: "mod" | ||
databaseShardingColumn: "id" | ||
actualDatanodes: | ||
valueSource: | ||
nodes: | ||
- value: "ds001" | ||
- value: "ds002" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
## | ||
## Copyright 2022 SphereEx Authors | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: mysql1 | ||
name: mysql1 | ||
namespace: default | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: 1 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
app: mysql1 | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: mysql1 | ||
spec: | ||
containers: | ||
- env: | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: root | ||
image: mysql:5.7 | ||
imagePullPolicy: IfNotPresent | ||
name: mysql | ||
ports: | ||
- containerPort: 3306 | ||
protocol: TCP | ||
resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
securityContext: {} | ||
terminationGracePeriodSeconds: 30 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql1 | ||
namespace: default | ||
spec: | ||
ports: | ||
- port: 3306 | ||
protocol: TCP | ||
targetPort: 3306 | ||
selector: | ||
app: mysql1 | ||
sessionAffinity: None | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
## | ||
## Copyright 2022 SphereEx Authors | ||
## | ||
## Licensed under the Apache License, Version 2.0 (the "License"); | ||
## you may not use this file except in compliance with the License. | ||
## You may obtain a copy of the License at | ||
## | ||
## http://www.apache.org/licenses/LICENSE-2.0 | ||
## | ||
## Unless required by applicable law or agreed to in writing, software | ||
## distributed under the License is distributed on an "AS IS" BASIS, | ||
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
## See the License for the specific language governing permissions and | ||
## limitations under the License. | ||
## | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: mysql2 | ||
name: mysql2 | ||
namespace: default | ||
spec: | ||
progressDeadlineSeconds: 600 | ||
replicas: 1 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
app: mysql2 | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: mysql2 | ||
spec: | ||
containers: | ||
- env: | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: root | ||
image: mysql:5.7 | ||
imagePullPolicy: IfNotPresent | ||
name: mysql | ||
ports: | ||
- containerPort: 3306 | ||
protocol: TCP | ||
resources: {} | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
securityContext: {} | ||
terminationGracePeriodSeconds: 30 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql2 | ||
namespace: default | ||
spec: | ||
ports: | ||
- port: 3306 | ||
protocol: TCP | ||
targetPort: 3306 | ||
selector: | ||
app: mysql2 | ||
sessionAffinity: None | ||
type: ClusterIP |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.