This is an automated email from the ASF dual-hosted git repository.
zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 38248ed05cd update according new module (#19634)
38248ed05cd is described below
commit 38248ed05cdc94bf0fe436762ffd4c675290bb4a
Author: Mike0601 <[email protected]>
AuthorDate: Thu Jul 28 16:17:58 2022 +0800
update according new module (#19634)
* Refactor document
Remove concepts document
* refactor
* update feature sharding
* update according new module
* update according to new module
* update according to new module
* update according to new module
* modify according to new module
* update according new module
* update
* update
* update according new module
* update according to new module
* update
* update
---
.../scaling-integration-test/_index.cn.md | 113 +++++-----
.../scaling-integration-test/_index.en.md | 113 +++++-----
.../shardingsphere-proxy/startup/helm.cn.md | 250 +++++++++++++++------
.../shardingsphere-proxy/startup/helm.en.md | 249 ++++++++++++++------
4 files changed, 483 insertions(+), 242 deletions(-)
diff --git
a/docs/document/content/test-manual/scaling-integration-test/_index.cn.md
b/docs/document/content/test-manual/scaling-integration-test/_index.cn.md
index a7ce74ef0e3..e78ec271788 100644
--- a/docs/document/content/test-manual/scaling-integration-test/_index.cn.md
+++ b/docs/document/content/test-manual/scaling-integration-test/_index.cn.md
@@ -6,91 +6,88 @@ weight = 4
## 测试目的
-验证 Scaling 自身功能和依赖模块的正确性。
+验证数据迁移以及依赖模块功能的正确性。
## 测试环境
-环境准备方式分为 Native 和 Docker
+目前支持 Native 和 Docker 两种环境。
-- Native 环境:用于本地调试,可以使用 IDE 的 debug 模式进行调试。
-- Docker 环境:环境由 Maven 运行,适用于云编译环境和测试 ShardingSphere-Proxy 的场景,如:GitHub Action。
+1. Native 环境直接运行在开发者提供的测试环境中,需要用户自己启动 ShardingSphere-Proxy 和对应的数据库实例,适于调试场景;
+1. Docker 环境由 Maven 运行,适用于云编译环境和测试 ShardingSphere-Proxy 的场景,如:GitHub Action。
-当前默认采用 Docker 环境,涉及到的 ShardingSphere-Proxy,Zookeeper,数据库实例 (MySQL,
PostgreSQL),都通过 Docker 自动启动。
-
-数据库类型目前支持 MySQL、PostgreSQL、openGauss。
+目前支持的数据库类型:MySQL、PostgreSQL、openGauss。
## 使用指南
-模块路径:`shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling`
-
-测试的 Class 分布如下:
-
-核心用例:
-- MySQLGeneralScalingIT: 覆盖的测试场景最多,包括部分表迁移,表字段最多样等。
-- PostgreSQLGeneralScalingIT: 类似,只不过数据库类型是 PostgreSQL/openGauss,包含自定义 schema
迁移场景。
-
-主键用例:
-
-- TextPrimaryKeyScalingIT: 支持主键为文本类型的表迁移。
-
-
-### 配置文件
-
-目录:`resources/env/`
-- /common: 存放 Scaling 过程中用到的 DistSQL。
-- /{SQL-TYPE}: 存放数据库级别的配置文件。
-- /scenario: 存放测试的场景的配置文件,主要是 SQL,不同数据库可能写法不一样。
-- it-env.properties:存放对应的配置信息。
-
-### 运行测试引擎
-
-所有的属性值都可以通过 Maven 命令行 `-D` 的方式动态注入。
-
-`${image-name}` 表示合法 Docker image 名称,比如:mysql:5.7, 多个的话用逗号隔开。
-`-Dscaling.it.docker.postgresql.version=${image-name}` 表示需要测试的 PostgreSQL 版本。
-`-Dscaling.it.docker.mysql.version=${image-name}` 表示需要测试的 MySQL 版本。
+模块路径
`shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling`
。
+
+### 环境配置
+`${DOCKER-IMAGE}` 表示 docker 镜像名称,如 `mysql:8` 。 `${DATABASE-TYPE}` 表示数据库类型。
+目录:`src/test/resources/env`
+- `it-env.properties`:集成测试启动参数。
+- `${DATABASE-TYPE}/server.yaml`:数据库对应的 ShardingSphere-Proxy 配置文件。
+- `${DATABASE-TYPE}/initdb.sql`:数据库初始化 SQL。
+- `${DATABASE-TYPE}/*.cnf,*.conf`:以 cnf 或者 conf 结尾的文件,是数据库的配置文件,用于 Docker 挂载。
+- `common/command.xml`:测试中用到的DistSQL。
+- `scenario/`:存放测试场景中的 SQL。
+
+### 测试用例
+目前所有的测试用例,都直接继承自 `BaseExtraSQLITCase`,间接继承了 `BaseITCase`。
+- `BaseITCase`:提供了通用方法给子类
+- `BaseExtraSQLITCase`:提供了建表、CRUD 语句执行方法
+
+用例示例:MySQLGeneralScalingIT。
+覆盖的功能点如下:
+- 库级别迁移(所有表)
+- 表级别迁移(任意多个表)
+- 迁移数据一致性校验
+- 数据迁移过程中支持停写
+- 数据迁移过程中支持重启
+- 数据迁移支持整型主键
+- 数据迁移支持字符串主键
+- 使用非管理员账号进行数据迁移
+
+### 运行测试用例
+`it-env.properties` 所有属性值都可以通过 Maven 命令行 `-D` 的方式传入,优先级高于配置文件。
#### Native 环境启动
-Native 环境要求本地自行启动 ShardingSphere-Proxy(以及其自身依赖的 Cluster,比如 Zookeeper)和数据库,同时要求
ShardingSphere-Proxy 的端口是 3307,修改 it-env.properties 文件中的属性
`scaling.it.env.type=native`
-数据库的端口可以在 it-env.properties 中配置,如果是默认端口可以不配置。
-
-启动方式如下:找到需要测试的 Case,比如 MySQLGeneralScalingIT,在启动之前配置对应的 VM Option,新增如下配置。
-
+使用者在本地提前启动 ShardingSphere-Proxy 以及依赖的配置中心(如 ZooKeeper)和数据库。
+要求 ShardingSphere-Proxy 的端口是 3307。
+以 MySQL 为例,`it-env.properties` 可以配置如下:
```
--Dscaling.it.env.type=native -Dscaling.it.docker.mysql.version=${image-name}
+scaling.it.env.type=NATIVE
+scaling.it.native.database=mysql
+scaling.it.native.mysql.username=root
+scaling.it.native.mysql.password=root
+scaling.it.native.mysql.port=3306
```
-在 IDE 下使用 Junit 的方式启动即可。
+找到对应的用例,在 IDE 下使用 Junit 的方式启动即可。
-#### Docker 环境启动
+#### Docker环境启动
第一步:打包镜像
-```bash
+```
./mvnw -B clean install -am -pl
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling
-Pit.env.docker -DskipTests
```
-运行以上命令会构建出一个用于集成测试的 Docker 镜像 `apache/shardingsphere-proxy-test:latest`。
-如果仅修改了测试代码,可以复用已有的测试镜像,无须重新构建。
+运行以上命令会构建出一个用于集成测试的 Docker 镜像
apache/shardingsphere-proxy-test:latest,该镜像设置了远程调试的端口,默认是3308。
如果仅修改了测试代码,可以复用已有的测试镜像,无须重新构建。
-**Docker 环境配置为 ShardingSphere-Proxy 提供了远程调试端口,默认是 3308。**
-可以在 ShardingSphereProxyDockerContainer 中自行修改。
+Docker 模式下,如果需要对 Docker 镜像启动参数进行调整,可以对修改 ShardingSphereProxyDockerContainer
文件中的相关配置。
-#### 运行用例
+ShardingSphere-Proxy 输出的日志带有 :Scaling-Proxy 前缀。
-和 Native 一样,只需要改一个参数。
+使用 Maven 的方式运行用例。以 MySQL 为例:
```
--Dscaling.it.env.type=docker
-```
-
-可以和 Native 一样使用 IDE 的方式运行用例,或者使用 Maven 的方式运行用例。
-
-```bash
./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml
-Dscaling.it.env.type=DOCKER -Dscaling.it.docker.mysql.version=${image-name}
```
-#### 注意事项
+也可以使用 IDE 的方式运行用例。`it-env.properties` 可以配置如下:
-Scaling 集成测试中的命令基本都是只连接 ShardingSphere-Proxy 中执行的,所以如果运行失败,多数情况是需要对
ShardingSphere-Proxy 进行 Debug,日志中带有 `:Scaling-Proxy` 前缀的,都是从
ShardingSphere-Proxy 容器中输出的日志。
+```
+scaling.it.env.type=DOCKER
+scaling.it.docker.mysql.version=mysql:5.7
+```
\ No newline at end of file
diff --git
a/docs/document/content/test-manual/scaling-integration-test/_index.en.md
b/docs/document/content/test-manual/scaling-integration-test/_index.en.md
index 04af4b7af22..22c3c94765a 100644
--- a/docs/document/content/test-manual/scaling-integration-test/_index.en.md
+++ b/docs/document/content/test-manual/scaling-integration-test/_index.en.md
@@ -4,92 +4,93 @@ title = "Scaling Integration Test"
weight = 4
+++
-## Objective
+## Objectives
-Verify the correctness of Scaling's own functionality and dependent modules.
+Verify the functional correctness of data migration and dependency modules.
-## Environment
+## Test environment
-There are two types of environment preparation: Native and Docker
+Currently, Native and Docker environments are supported.
+1. The Native environment runs directly in the test environment provided by
the developer, and users need to start ShardingSphere-Proxy and the
corresponding database instance by themselves, which is suitable for debugging
scenarios.
+2. The Docker environment is run by Maven, which is suitable for cloud
compilation environment and ShardingSphere-Proxy testing scenarios, such as
GitHub Action.
-- Native Environment: For local debugging, you can use the IDE's debug mode
for debugging
-- Docker Environment: Environment run by Maven for cloud compiled environments
and testing ShardingSphere-Proxy scenarios, e.g. GitHub Action
+Currently, you can use MySQL, PostgreSQL and openGuass databases.
-The current default Docker environment, involving ShardingSphere-Proxy,
Zookeeper, database instances (MySQL, PostgreSQL), are automatically started
via Docker.
+## User guide
-Database type currently supports MySQL, PostgreSQL, openGauss
+Module path:
`shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling`.
-## Guide
+### Environment setup
-Module path:
`shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling`
+`${DOCKER-IMAGE}` refers to the name of a Docker mirror, such as `mysql:8`.
`${DATABASE-TYPE}` refers to database types.
+Directory: `src/test/resources/env`
+- `it-env.properties`: the startup parameters of integration testing.
+- `${DATABASE-TYPE}/server.yaml`: ShardingSphere-Proxy configuration file
corresponding to the database.
+- `${DATABASE-TYPE}/initdb.sql`: The database initializes SQL.
+- `${DATABASE-TYPE}/*.cnf,*.conf`: Files ending with cnf or conf are database
configuration files for Docker mount.
+- `common/command.xml`: The DistSQL used in the test.
+- `scenario/`: Store SQL in the test scenarios.
-The Class distribution of the test is as follows.
+### Test case
-Core Case:
-- MySQLGeneralScalingIT: Covered the most test scenarios, including part of
the table migration, most variety of table fields, etc.
-- PostgreSQLGeneralScalingIT: Similar, except that the database type is
PostgreSQL/openGauss and includes custom schema migration scenarios.
+Currently, all the test cases are directly inherited from `BaseExtraSQLITCase`
and indirectly inherited from `BaseITCase`.
+- `BaseITCase`: Provide generic methods for sub-class.
+- `BaseExtraSQLITCase`: Provide table creation and CRUD statement execution
methods.
-Primary Key Case:
+Test case example: MySQLGeneralScalingIT.
+Functions included:
+- Database-level migration (all tables).
+- Table-level migration (any number).
+- Verify migration data consistency.
+- Stop writing is supported during data migration.
+- Support restart during data migration.
+- Support integer primary keys during data migration.
+- Support string primary keys during data migration.
+- A non-administrator account can be used to migrate data.
-- TextPrimaryKeyScalingIT: Support migration of tables with primary key of
text type(e.g. UUID).
+### Running the test case
-### Configuration File
+All property values of `it-env.properties` can be introduced by the Maven
command line `-D`, and its priority is higher than that of the configuration
file.
-Catalog:`resources/env/`
-- /common: The Dist SQL used in the Scaling process.
-- /{SQL-TYPE}: database-level configuration files.
-- /scenario: The configuration file for the test scenario, mainly SQL, may be
written differently for different databases.
-- it-env.properties: Stores the corresponding configuration information.
-
-### Run Test Cases
-
-All property values can be dynamically injected by means of the Maven command
line `-D`.
-
-`${image-name}` Indicates a legal docker image name, e.g., mysql:5.7,
separated by commas if multiple.
-`-Dscaling.it.docker.postgresql.version=${image-name}` Indicates the version
of PostgreSQL that needs to be tested.
-`-Dscaling.it.docker.mysql.version=${image-name}` Indicates the version of
MySQL that needs to be tested.
-
-#### Native Environment Startup
-
-Native environments require that ShardingSphere-Proxy (and its own dependent
Cluster, such as Zookeeper) and the database be started locally, and that
ShardingSphere-Proxy's port be 3307, modify the properties in the
it-env.properties file ` scaling.it.env.type=native`
-The database port can be configured in it-env.properties, or not if it is the
default port.
-
-The startup method is as follows: Find the Case you need to test, such as
MySQLGeneralScalingIT, and configure the corresponding VM Option before
startup, add the following configuration.
+#### Native environment setup
+The user starts ShardingSphere-Proxy locally in advance, along with dependent
configuration centers (such as ZooKeeper) and databases.
+The port required for ShardingSphere-Proxy is 3307.
+Take MySQL as an example, `it-env.properties` can be configured as follows:
```
--Dscaling.it.env.type=native -Dscaling.it.docker.mysql.version=${image-name}
+scaling.it.env.type=NATIVE
+scaling.it.native.database=mysql
+scaling.it.native.mysql.username=root
+scaling.it.native.mysql.password=root
+scaling.it.native.mysql.port=3306
```
-Just start it under the IDE using the Junit.
+Find the appropriate test case and start it with Junit under the IDE.
-#### Docker Environment Startup
+#### Docker environment setup
-Step 1: Packaging Image
+Step 1: Package mirror.
-```bash
+```
./mvnw -B clean install -am -pl
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling
-Pit.env.docker -DskipTests
```
-Running the above command will build a Docker image
`apache/shardingsphere-proxy-test:latest` for integration testing.
-If you have only modified the test code, you can reuse the existing test image
without rebuilding it.
+Running the above command will build a Docker mirror
apache/shardingsphere-proxy-test:latest used for integration testing.
+The mirror sets the port for remote debugging and the default port is 3308. If
only the test code is modified, you can reuse the existing test mirror without
rebuilding it.
-**Docker environment configuration provides remote debugging port for
ShardingSphere-Proxy, the default is 3308.**
-You can change it yourself in ShardingSphereProxyDockerContainer.
+If you need to adjust Docker mirror startup parameters, you can modify the
configuration of the ShardingSphereProxyDockerContainer file.
-#### Running Case
+The output log of ShardingSphere-Proxy has the prefix Scaling-Proxy.
-As with Native, only one parameter needs to be changed.
+Use Maven to run the test cases. Take MySQL as an example:
```
--Dscaling.it.env.type=docker
-```
-
-You can run the use case using the same IDE as Native, or you can run it using
maven.
-
-```shell
./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/pom.xml
-Dscaling.it.env.type=DOCKER -Dscaling.it.docker.mysql.version=${image-name}
```
-#### Attentions
+You can also use IDE to run test cases. `it-env.properties` can be configured
as follows:
-The commands in the Scaling integration test are basically executed in the
ShardingSphere-Proxy, so if they fail, most of them require a debug of the
ShardingSphere-Proxy, and the logs prefixed with `:Scaling-Proxy` are output
from the ShardingSphere-Proxy container.
+```
+scaling.it.env.type=DOCKER
+scaling.it.docker.mysql.version=mysql:5.7
+```
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.cn.md
b/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.cn.md
index fecd29cc2f6..3d542284bba 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.cn.md
@@ -3,77 +3,58 @@ title = "使用 Helm"
weight = 3
+++
-使用 [Helm](https://helm.sh/) 在 Kubernetes 集群中引导 ShardingSphere-Proxy 实例进行安装。
+## 背景信息
-## 快速入门
+使用 [Helm](https://helm.sh/) 在 Kubernetes 集群中引导 ShardingSphere-Proxy 实例进行安装。
-注意️:以下安装方式将使用默认的 server.yaml 配置启动 ShardingSphere-Proxy
+## 前提条件
-```shell
-helm repo add shardingsphere https://shardingsphere.apache.org/charts
-helm install shardingsphere-proxy shardingsphere/apache-shardingsphere-proxy
-```
+- kubernetes 1.18+
+- kubectl
+- helm 3.3.0+
+- 可以动态申请 PV(Persistent Volumes) 的 StorageClass 用于持久化数据。(可选)
## 操作步骤
-### 必要条件
-
-1. kubernetes 1.18+
-1. kubectl
-1. helm 3.2.0+
-
-可以动态申请 PV(Persistent Volumes) 的 StorageClass(可选)。
-
-### 安装
+### 在线安装
-#### 在线安装
-
-将 ShardingSphere-Proxy 添加到 Helm 本地仓库:
+1. 将 ShardingSphere-Proxy 添加到 Helm 本地仓库:
```shell
helm repo add shardingsphere https://shardingsphere.apache.org/charts
```
-以 ShardingSphere-Proxy 命名安装 charts:
-注意️:以下安装方式将使用默认的 server.yaml 配置启动 ShardingSphere-Proxy
+1. 以 ShardingSphere-Proxy 命名安装 charts:
```shell
-helm install shardingsphere-proxy shardingsphere/apache-shardingsphere-proxy
+helm install shardingsphere-proxy shardingsphere/shardingsphere-proxy
```
-如需修改配置,请执行以下操作:
-
-```shell
-helm pull shardingsphere/apache-shardingsphere-proxy
-tar -zxvf apache-shardingsphere-proxy-1.1.0-chart.tgz
-# 修改 apache-shardingsphere-proxy/values.yaml 中 serverConfig 部分
-helm install shardingsphere-proxy apache-shardingsphere-proxy
-```
+### 源码安装
-#### 源码安装
+1. 执行下述命令以执行默认配置进行安装。
```shell
-cd apache-shardingsphere-proxy/charts/governance
-helm dependency build
-cd ../..
-helm dependency build
-cd ..
-helm install shardingsphere-proxy apache-shardingsphere-proxy
+cd shardingsphere-proxy/charts/governance
+ helm dependency build
+ cd ../..
+ helm dependency build
+ cd ..
+ helm install shardingsphere-proxy shardingsphere-proxy
```
-执行上述命令以执行默认配置进行安装。
-其他的配置详见下方的配置列表。
-执行 `helm list` 获取所有安装的 release。
+1. 其他的配置详见下方的配置列表。
+1. 执行 helm list 获取所有安装的 release。
### 卸载
+1. 默认删除所有发布记录,增加 `--keep-history` 参数保留发布记录。
+
```shell
helm uninstall shardingsphere-proxy
```
-默认删除所有发布记录,增加 `--keep-history` 参数保留发布记录。
-
-## 配置项
+## 参数解释
### 治理节点配置项
@@ -111,25 +92,164 @@ helm uninstall shardingsphere-proxy
| `compute.service.port` | ShardingSphere-Proxy 暴露端口 |
`3307` |
| `compute.mysqlConnector.version` | MySQL 驱动版本 |
`5.1.49` |
| `compute.startPort` | ShardingSphere-Proxy 启动端口 |
`3307` |
-
-### 计算节点 ShardingSphere-Proxy Server 配置 权限配置项
-
-| 配置项 | 描述
| 值
|
-| -------------------------------------------------- |
---------------------------------------------------------------------------------------------
| -------------------------- |
-| `compute.serverConfig.authority.privilege.type` | 存储节点数据授权的权限提供者类型,缺省值为
ALL_PERMITTED |
`ALL_PRIVILEGES_PERMITTED` |
-| `compute.serverConfig.authority.users[0].password` | 用于登录计算节点的密码
| `root`
|
-| `compute.serverConfig.authority.users[0].user` | 用于登录计算节点的用户名,授权主机。格式:
<username>@<hostname> hostname 为 % 或空字符串表示不限制授权主机 | `root@%` |
-
-### 计算节点 ShardingSphere-Proxy Server 配置 模式配置项
-
-| 配置项 | 描述
| 值
|
-| ------------------------------------------------------------------------- |
---------------------------------- |
--------------------------------------------------------------------- |
-| `compute.serverConfig.mode.type` |
运行模式类型。 现阶段仅支持 Cluster 模式 | `Cluster`
|
-| `compute.serverConfig.mode.repository.props.namespace` |
注册中心命名空间 | `governance_ds`
|
-| `compute.serverConfig.mode.repository.props.server-lists` |
注册中心连接地址 | `{{ printf "%s-zookeeper.%s:2181" .Release.Name
.Release.Namespace }}` |
-| `compute.serverConfig.mode.repository.props.maxRetries` |
客户端连接最大重试次数 | `3`
|
-| `compute.serverConfig.mode.repository.props.operationTimeoutMilliseconds` |
客户端操作超时的毫秒数 | `5000`
|
-| `compute.serverConfig.mode.repository.props.retryIntervalMilliseconds` |
重试间隔毫秒数 | `500`
|
-| `compute.serverConfig.mode.repository.props.timeToLiveSeconds` |
临时数据失效的秒数 | `60`
|
-| `compute.serverConfig.mode.repository.type` |
持久化仓库类型。 现阶段仅支持 ZooKeeper | `ZooKeeper`
|
-| `compute.serverConfig.mode.overwrite` |
是否使用本地配置覆盖持久化配置 | `true`
|
+| `compute.serverConfig` | ShardingSphere-Proxy 模式配置文件 |
`""` |
+
+## 配置示例
+
+```PlainText
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+## @section Governance-Node parameters
+## @param governance.enabled Switch to enable or disable the governance helm
chart
+##
+governance:
+ enabled: true
+ ## @section Governance-Node ZooKeeper parameters
+ zookeeper:
+ ## @param governance.zookeeper.enabled Switch to enable or disable the
ZooKeeper helm chart
+ ##
+ enabled: true
+ ## @param governance.zookeeper.replicaCount Number of ZooKeeper nodes
+ ##
+ replicaCount: 1
+ ## ZooKeeper Persistence parameters
+ ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
+ ## @param governance.zookeeper.persistence.enabled Enable persistence on
ZooKeeper using PVC(s)
+ ## @param governance.zookeeper.persistence.storageClass Persistent Volume
storage class
+ ## @param governance.zookeeper.persistence.accessModes Persistent Volume
access modes
+ ## @param governance.zookeeper.persistence.size Persistent Volume size
+ ##
+ persistence:
+ enabled: false
+ storageClass: ""
+ accessModes:
+ - ReadWriteOnce
+ size: 8Gi
+ ## ZooKeeper's resource requests and limits
+ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
+ ## @param governance.zookeeper.resources.limits The resources limits for
the ZooKeeper containers
+ ## @param governance.zookeeper.resources.requests.memory The requested
memory for the ZooKeeper containers
+ ## @param governance.zookeeper.resources.requests.cpu The requested cpu
for the ZooKeeper containers
+ ##
+ resources:
+ limits: {}
+ requests:
+ memory: 256Mi
+ cpu: 250m
+
+## @section Compute-Node parameters
+##
+compute:
+ ## @section Compute-Node ShardingSphere-Proxy parameters
+ ## ref: https://kubernetes.io/docs/concepts/containers/images/
+ ## @param compute.image.repository Image name of ShardingSphere-Proxy.
+ ## @param compute.image.pullPolicy The policy for pulling
ShardingSphere-Proxy image
+ ## @param compute.image.tag ShardingSphere-Proxy image tag
+ ##
+ image:
+ repository: "apache/shardingsphere-proxy"
+ pullPolicy: IfNotPresent
+ ## Overrides the image tag whose default is the chart appVersion.
+ ##
+ tag: "5.1.2"
+ ## @param compute.imagePullSecrets Specify docker-registry secret names as
an array
+ ## e.g:
+ ## imagePullSecrets:
+ ## - name: myRegistryKeySecretName
+ ##
+ imagePullSecrets: []
+ ## ShardingSphere-Proxy resource requests and limits
+ ## ref:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ ## @param compute.resources.limits The resources limits for the
ShardingSphere-Proxy containers
+ ## @param compute.resources.requests.memory The requested memory for the
ShardingSphere-Proxy containers
+ ## @param compute.resources.requests.cpu The requested cpu for the
ShardingSphere-Proxy containers
+ ##
+ resources:
+ limits: {}
+ requests:
+ memory: 2Gi
+ cpu: 200m
+ ## ShardingSphere-Proxy Deployment Configuration
+ ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
+ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/
+ ## @param compute.replicas Number of cluster replicas
+ ##
+ replicas: 3
+ ## @param compute.service.type ShardingSphere-Proxy network mode
+ ## @param compute.service.port ShardingSphere-Proxy expose port
+ ##
+ service:
+ type: ClusterIP
+ port: 3307
+ ## MySQL connector Configuration
+ ## ref:
https://shardingsphere.apache.org/document/current/en/quick-start/shardingsphere-proxy-quick-start/
+ ## @param compute.mysqlConnector.version MySQL connector version
+ ##
+ mysqlConnector:
+ version: "5.1.49"
+ ## @param compute.startPort ShardingSphere-Proxy start port
+ ## ShardingSphere-Proxy start port
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/startup/docker/
+ ##
+ startPort: 3307
+ ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration parameters
+ ## NOTE: If you use the sub-charts to deploy Zookeeper, the server-lists
field must be "{{ printf \"%s-zookeeper.%s:2181\" .Release.Name
.Release.Namespace }}",
+ ## otherwise please fill in the correct zookeeper address
+ ## The server.yaml is auto-generated based on this parameter.
+ ## If it is empty, the server.yaml is also empty.
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/yaml-config/mode/
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/builtin-algorithm/metadata-repository/
+ ##
+ serverConfig:
+ ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration
authority parameters
+ ## NOTE: It is used to set up initial user to login compute node, and
authority data of storage node.
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/yaml-config/authentication/
+ ## @param compute.serverConfig.authority.privilege.type authority provider
for storage node, the default value is ALL_PERMITTED
+ ## @param compute.serverConfig.authority.users[0].password Password for
compute node.
+ ## @param compute.serverConfig.authority.users[0].user Username,authorized
host for compute node. Format: <username>@<hostname> hostname is % or empty
string means do not care about authorized host
+ ##
+ authority:
+ privilege:
+ type: ALL_PRIVILEGES_PERMITTED
+ users:
+ - password: root
+ user: root@%
+ ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration mode
Configuration parameters
+ ## @param compute.serverConfig.mode.type Type of mode configuration. Now
only support Cluster mode
+ ## @param compute.serverConfig.mode.repository.props.namespace Namespace
of registry center
+ ## @param compute.serverConfig.mode.repository.props.server-lists Server
lists of registry center
+ ## @param compute.serverConfig.mode.repository.props.maxRetries Max
retries of client connection
+ ## @param
compute.serverConfig.mode.repository.props.operationTimeoutMilliseconds
Milliseconds of operation timeout
+ ## @param
compute.serverConfig.mode.repository.props.retryIntervalMilliseconds
Milliseconds of retry interval
+ ## @param compute.serverConfig.mode.repository.props.timeToLiveSeconds
Seconds of ephemeral data live
+ ## @param compute.serverConfig.mode.repository.type Type of persist
repository. Now only support ZooKeeper
+ ## @param compute.serverConfig.mode.overwrite Whether overwrite persistent
configuration with local configuration
+ ##
+ mode:
+ type: Cluster
+ repository:
+ type: ZooKeeper
+ props:
+ maxRetries: 3
+ namespace: governance_ds
+ operationTimeoutMilliseconds: 5000
+ retryIntervalMilliseconds: 500
+ server-lists: "{{ printf \"%s-zookeeper.%s:2181\" .Release.Name
.Release.Namespace }}"
+ timeToLiveSeconds: 60
+ overwrite: true
+```
\ No newline at end of file
diff --git
a/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.en.md
b/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.en.md
index 5ad23028d3a..bb4a5631258 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/startup/helm.en.md
@@ -3,30 +3,21 @@ title = "Use Helm"
weight = 3
+++
-Use [Helm](https://helm.sh/) to provide guidance for the installation of
ShardingSphere-Proxy instance in Kubernetes cluster.
+## Background
-## Quick Start
+Use [Helm](https://helm.sh/) to provide guidance for the installation of
ShardingSphere-Proxy instance in a Kubernetes cluster.
-Attention: The following installation method will start ShardingSphere-Proxy
with the default server.yaml configuration
+## Requirements
-```shell
-helm repo add shardingsphere https://shardingsphere.apache.org/charts
-helm install shardingsphere-proxy shardingsphere/apache-shardingsphere-proxy
-```
-
-## Step By Step
-
-### Requirements
-
-1. Kubernetes 1.18+
-1. kubectl
-1. Helm 3.2.0+
-
-Use StorageClass to allow dynamic provisioning of Persistent Volumes (PV) for
data persistent (optional).
+* Kubernetes 1.18+
+* kubectl
+* Helm 3.2.0+
+* StorageClass of PV (Persistent Volumes) can be dynamically applied for
persistent data (Optional)
+.
-### Install
+## Procedure
-#### Online installation
+### Online installation
1. Add ShardingSphere-Proxy to the local helm repo:
@@ -34,45 +25,36 @@ Use StorageClass to allow dynamic provisioning of
Persistent Volumes (PV) for da
helm repo add shardingsphere https://shardingsphere.apache.org/charts
```
-2. Install ShardingSphere-Proxy charts:
-Attention: The following installation method will start ShardingSphere-Proxy
with the default server.yaml configuration
+1. Install ShardingSphere-Proxy charts:
```shell
-helm install shardingsphere-proxy shardingsphere/apache-shardingsphere-proxy
+helm install shardingsphere-proxy shardingsphere/shardingsphere-proxy
```
-To modify the configuration:
+### Source installation
-```shell
-helm pull shardingsphere/apache-shardingsphere-proxy
-tar -zxvf apache-shardingsphere-proxy-1.1.0-chart.tgz
-# Modify the serverConfig section in apache-shardingsphere-proxy/values.yaml
-helm install shardingsphere-proxy apache-shardingsphere-proxy
-```
-
-#### Source installation
+1. Charts will be installed with default configuration if the following
commands are executed:
```shell
-cd apache-shardingsphere-proxy/charts/governance
+cd shardingsphere-proxy/charts/governance
+helm dependency build
+cd ../..
helm dependency build
-cd ../..
-helm dependency build
-cd ..
-helm install shardingsphere-proxy apache-shardingsphere-proxy
+cd ..
+helm install shardingsphere-proxy shardingsphere-proxy
```
+1. Please refer to the configuration items description below for more details:
-Charts will be installed with default configuration if above commands executed.
-Please refer configuration items description below to get more details.
-Execute `helm list` to acquire all installed releases.
+1. Execute `helm list` to acquire all installed releases.
### Uninstall
+1. Delete all release records by default, add `--keep-history` to keep them.
+
```shell
helm uninstall shardingsphere-proxy
```
-Delete all release records by default, add `--keep-history` to keep them.
-
## Parameters
### Governance-Node parameters
@@ -111,25 +93,166 @@ Delete all release records by default, add
`--keep-history` to keep them.
| `compute.service.port` | ShardingSphere-Proxy expose port
| `3307` |
| `compute.mysqlConnector.version` | MySQL connector version
| `5.1.49` |
| `compute.startPort` | ShardingSphere-Proxy start port
| `3307` |
-
-### Compute-Node ShardingSphere-Proxy ServerConfiguration authority parameters
-
-| Name | Description
| Value |
-| -------------------------------------------------- |
----------------------------------------------------------------------------------------------------------------------------------------------
| -------------------------- |
-| `compute.serverConfig.authority.privilege.type` | authority provider for
storage node, the default value is ALL_PERMITTED
| `ALL_PRIVILEGES_PERMITTED` |
-| `compute.serverConfig.authority.users[0].password` | Password for compute
node.
| `root` |
-| `compute.serverConfig.authority.users[0].user` | Username,authorized
host for compute node. Format: <username>@<hostname> hostname is % or empty
string means do not care about authorized host | `root@%` |
-
-### Compute-Node ShardingSphere-Proxy ServerConfiguration mode Configuration
parameters
-
-| Name |
Description | Value
|
-| ------------------------------------------------------------------------- |
------------------------------------------------------------------- |
---------------------------------------------------------------------- |
-| `compute.serverConfig.mode.type` |
Type of mode configuration. Now only support Cluster mode | `Cluster`
|
-| `compute.serverConfig.mode.repository.props.namespace` |
Namespace of registry center |
`governance_ds` |
-| `compute.serverConfig.mode.repository.props.server-lists` |
Server lists of registry center | `{{
printf "%s-zookeeper.%s:2181" .Release.Name .Release.Namespace }}` |
-| `compute.serverConfig.mode.repository.props.maxRetries` |
Max retries of client connection | `3`
|
-| `compute.serverConfig.mode.repository.props.operationTimeoutMilliseconds` |
Milliseconds of operation timeout | `5000`
|
-| `compute.serverConfig.mode.repository.props.retryIntervalMilliseconds` |
Milliseconds of retry interval | `500`
|
-| `compute.serverConfig.mode.repository.props.timeToLiveSeconds` |
Seconds of ephemeral data live | `60`
|
-| `compute.serverConfig.mode.repository.type` |
Type of persist repository. Now only support ZooKeeper |
`ZooKeeper` |
-| `compute.serverConfig.mode.overwrite` |
Whether overwrite persistent configuration with local configuration | `true`
|
+| `compute.serverConfig` | Server Configuration file for
ShardingSphere-Proxy | `""` |
+
+## Sample
+
+values.yaml
+
+```PlainText
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+
+## @section Governance-Node parameters
+## @param governance.enabled Switch to enable or disable the governance helm
chart
+##
+governance:
+ enabled: true
+ ## @section Governance-Node ZooKeeper parameters
+ zookeeper:
+ ## @param governance.zookeeper.enabled Switch to enable or disable the
ZooKeeper helm chart
+ ##
+ enabled: true
+ ## @param governance.zookeeper.replicaCount Number of ZooKeeper nodes
+ ##
+ replicaCount: 1
+ ## ZooKeeper Persistence parameters
+ ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
+ ## @param governance.zookeeper.persistence.enabled Enable persistence on
ZooKeeper using PVC(s)
+ ## @param governance.zookeeper.persistence.storageClass Persistent Volume
storage class
+ ## @param governance.zookeeper.persistence.accessModes Persistent Volume
access modes
+ ## @param governance.zookeeper.persistence.size Persistent Volume size
+ ##
+ persistence:
+ enabled: false
+ storageClass: ""
+ accessModes:
+ - ReadWriteOnce
+ size: 8Gi
+ ## ZooKeeper's resource requests and limits
+ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
+ ## @param governance.zookeeper.resources.limits The resources limits for
the ZooKeeper containers
+ ## @param governance.zookeeper.resources.requests.memory The requested
memory for the ZooKeeper containers
+ ## @param governance.zookeeper.resources.requests.cpu The requested cpu
for the ZooKeeper containers
+ ##
+ resources:
+ limits: {}
+ requests:
+ memory: 256Mi
+ cpu: 250m
+
+## @section Compute-Node parameters
+##
+compute:
+ ## @section Compute-Node ShardingSphere-Proxy parameters
+ ## ref: https://kubernetes.io/docs/concepts/containers/images/
+ ## @param compute.image.repository Image name of ShardingSphere-Proxy.
+ ## @param compute.image.pullPolicy The policy for pulling
ShardingSphere-Proxy image
+ ## @param compute.image.tag ShardingSphere-Proxy image tag
+ ##
+ image:
+ repository: "apache/shardingsphere-proxy"
+ pullPolicy: IfNotPresent
+ ## Overrides the image tag whose default is the chart appVersion.
+ ##
+ tag: "5.1.2"
+ ## @param compute.imagePullSecrets Specify docker-registry secret names as
an array
+ ## e.g:
+ ## imagePullSecrets:
+ ## - name: myRegistryKeySecretName
+ ##
+ imagePullSecrets: []
+ ## ShardingSphere-Proxy resource requests and limits
+ ## ref:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
+ ## @param compute.resources.limits The resources limits for the
ShardingSphere-Proxy containers
+ ## @param compute.resources.requests.memory The requested memory for the
ShardingSphere-Proxy containers
+ ## @param compute.resources.requests.cpu The requested cpu for the
ShardingSphere-Proxy containers
+ ##
+ resources:
+ limits: {}
+ requests:
+ memory: 2Gi
+ cpu: 200m
+ ## ShardingSphere-Proxy Deployment Configuration
+ ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
+ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/
+ ## @param compute.replicas Number of cluster replicas
+ ##
+ replicas: 3
+ ## @param compute.service.type ShardingSphere-Proxy network mode
+ ## @param compute.service.port ShardingSphere-Proxy expose port
+ ##
+ service:
+ type: ClusterIP
+ port: 3307
+ ## MySQL connector Configuration
+ ## ref:
https://shardingsphere.apache.org/document/current/en/quick-start/shardingsphere-proxy-quick-start/
+ ## @param compute.mysqlConnector.version MySQL connector version
+ ##
+ mysqlConnector:
+ version: "5.1.49"
+ ## @param compute.startPort ShardingSphere-Proxy start port
+ ## ShardingSphere-Proxy start port
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/startup/docker/
+ ##
+ startPort: 3307
+ ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration parameters
+ ## NOTE: If you use the sub-charts to deploy Zookeeper, the server-lists
field must be "{{ printf \"%s-zookeeper.%s:2181\" .Release.Name
.Release.Namespace }}",
+ ## otherwise please fill in the correct zookeeper address
+ ## The server.yaml is auto-generated based on this parameter.
+ ## If it is empty, the server.yaml is also empty.
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/yaml-config/mode/
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-jdbc/builtin-algorithm/metadata-repository/
+ ##
+ serverConfig:
+ ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration
authority parameters
+ ## NOTE: It is used to set up initial user to login compute node, and
authority data of storage node.
+ ## ref:
https://shardingsphere.apache.org/document/current/en/user-manual/shardingsphere-proxy/yaml-config/authentication/
+ ## @param compute.serverConfig.authority.privilege.type authority provider
for storage node, the default value is ALL_PERMITTED
+ ## @param compute.serverConfig.authority.users[0].password Password for
compute node.
+ ## @param compute.serverConfig.authority.users[0].user Username,authorized
host for compute node. Format: <username>@<hostname> hostname is % or empty
string means do not care about authorized host
+ ##
+ authority:
+ privilege:
+ type: ALL_PRIVILEGES_PERMITTED
+ users:
+ - password: root
+ user: root@%
+ ## @section Compute-Node ShardingSphere-Proxy ServerConfiguration mode
Configuration parameters
+ ## @param compute.serverConfig.mode.type Type of mode configuration. Now
only support Cluster mode
+ ## @param compute.serverConfig.mode.repository.props.namespace Namespace
of registry center
+ ## @param compute.serverConfig.mode.repository.props.server-lists Server
lists of registry center
+ ## @param compute.serverConfig.mode.repository.props.maxRetries Max
retries of client connection
+ ## @param
compute.serverConfig.mode.repository.props.operationTimeoutMilliseconds
Milliseconds of operation timeout
+ ## @param
compute.serverConfig.mode.repository.props.retryIntervalMilliseconds
Milliseconds of retry interval
+ ## @param compute.serverConfig.mode.repository.props.timeToLiveSeconds
Seconds of ephemeral data live
+ ## @param compute.serverConfig.mode.repository.type Type of persist
repository. Now only support ZooKeeper
+ ## @param compute.serverConfig.mode.overwrite Whether overwrite persistent
configuration with local configuration
+ ##
+ mode:
+ type: Cluster
+ repository:
+ type: ZooKeeper
+ props:
+ maxRetries: 3
+ namespace: governance_ds
+ operationTimeoutMilliseconds: 5000
+ retryIntervalMilliseconds: 500
+ server-lists: "{{ printf \"%s-zookeeper.%s:2181\" .Release.Name
.Release.Namespace }}"
+ timeToLiveSeconds: 60
+ overwrite: true
+```
\ No newline at end of file