Helm deployment documentation written for Apache/Shenyu.
[English] [简体中文]
Apache/ShenYu is an asynchronous, high-performance, cross-language, responsive API gateway.
helm repo add shenyu https://apache.github.io/shenyu-helm-chart helm repo update
Before reading this document, you need to read Deployment prerequisites to complete the environment preparation before deploying ShenYu.
31095
for admin and 31195
for bootstrap.Running the following command will install admin and bootstrap under shenyu namespace and create namespace.
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace
Modify and copy the following command and execute.
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace \ --set dataSource.active=mysql \ --set dataSource.mysql.ip=127.0.0.1 \ --set dataSource.mysql.port=3306 \ --set dataSource.mysql.username=root \ --set dataSource.mysql.password=123456
Modify the following command and copy it to execute.
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace \ --set dataSource.active=pg \ --set dataSource.pg.ip=127.0.0.1 \ --set dataSource.pg.port=5432 \ --set dataSource.pg.username=postgres \ --set dataSource.pg.password=123456
helm show values shenyu/shenyu > values.yaml
0.2.0
: helm show values shenyu/shenyu --version=0.2.0 > values.yaml
helm install
command with the format -f values.yaml
. For example: helm install shenyu shenyu/shenyu -n=shenyu --create-namespace -f values.yaml
-set bootstrap.enabled=false
to the end of the helm install command--set admin.enabled=false
to the end of the helm install commandhelm search repo shenyu -l
You will get output similar to
NAME CHART VERSION APP VERSION DESCRIPTION shenyu/shenyu 0.2.0 2.5.0 Helm Chart for deploying Apache ShenYu in Kubernetes ... ...
where APP_VERSION
is the version of ShenYu and CHART_VERSION
is the version of Helm Chart.
Select the corresponding Chart version according to the version of ShenYu you want to install, and add the -version=CHART_VERSION
parameter at the end of the command. For example
helm install shenyu shenyu/shenyu -n=shenyu --version=0.2.0 --create-namespace
admin.jvmOpts
and bootstrap.jvmOpts
admin.resources
and bootstrap.resources
.e.g.
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace \ --set admin.javaOpts="-Xms256m -Xmx512m" \ --set admin.resources.requests.memory=512Mi \ --set admin.resources.limits.memory=1Gi \ --set admin.resources.requests.cpu=500m \ --set admin.resources.limits.cpu=1 \
configuration item | type | default | description |
---|---|---|---|
replicas | int | 1 | Number of replicas |
version | string | "2.5.0" | shenyu version, it is not recommended to modify, please install the corresponding version directly |
configuration item | type | default | description |
---|---|---|---|
admin.nodePort | int | 31095 | NodePort port |
admin.javaOpts | string | see here | JVM parameters |
admin.resources | dict | omit | K8s resource quota |
configuration item | type | default | description |
---|---|---|---|
bootstrap.nodePort | int | 31195 | NodePort Port |
bootstrap.javaOpts | string | see here | JVM parameters |
bootstrap.resources | dict | {} | K8s resource quota |
Translated with www.DeepL.com/Translator (free version) |
configuration-item | type | default | description |
---|---|---|---|
dataSource.active | string | "h2" | Database to use, supports h2 , mysql , pg |
dataSource.initEnabled | bool | true | Initialize the database, only h2 is available |
configuration item | type | default | description |
---|---|---|---|
dataSource.h2.username | string | "sa" | username |
dataSource.h2.password | string | "sa" | password |
Configuration Item | Type | Default | Description |
---|---|---|---|
dataSource.mysql.ip | string | "" | IP |
dataSource.mysql.port | int | 3306 | port |
dataSource.mysql.username | string | "root" | Username |
dataSource.mysql.password | string | "" | Password |
dataSource.mysql.driverClass | string | "com.mysql.cj.jdbc.Driver" | mysql driver class name |
dataSource.mysql.connectorVersion | string | "8.0.23" | connector version(maven connector list) |
configuration-item | type | default | description |
---|---|---|---|
dataSource.pg.ip | string | "" | IP |
dataSource.pg.port | int | 5432 | port |
dataSource.pg.username | string | "postgres" | username |
dataSource.pg.password | string | "postgres" | password |
dataSource.pg.driverClass | string | "org.postgresql.Driver" | PostgreSQL driver class name |
dataSource.pg.connectorVersion | string | "42.2.18" | connector version (maven connector list) |
configuration-item | type | default | description |
---|---|---|---|
applicationConfig.bootstrap | string | slightly | bootstrap configuration, bootstrap configuration description |
applicationConfig.admin | string | omit | admin configuration, admin configuration description |
[English] [简体中文]
Apache/ShenYu 是一个异步的,高性能的,跨语言的,响应式的 API 网关。
helm repo add shenyu https://apache.github.io/shenyu-helm-chart helm repo update
在阅读本文档前,你需要先阅读部署先决条件来完成部署 ShenYu 前的环境准备工作。
31095
, bootstrap 为 31195
。运行以下命令,会在 shenyu namespace 下安装 admin 与 bootstrap ,并创建命名空间。
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace
修改以下命令并复制,执行:
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace \ --set dataSource.active=mysql \ --set dataSource.mysql.ip=127.0.0.1 \ --set dataSource.mysql.port=3306 \ --set dataSource.mysql.username=root \ --set dataSource.mysql.password=123456
修改以下命令并复制,执行:
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace \ --set dataSource.active=pg \ --set dataSource.pg.ip=127.0.0.1 \ --set dataSource.pg.port=5432 \ --set dataSource.pg.username=postgres \ --set dataSource.pg.password=123456
helm show values shenyu/shenyu > values.yaml
0.2.0
: helm show values shenyu/shenyu --version=0.2.0 > values.yaml
-f values.yaml
的格式执行 helm install
命令。 如:helm install shenyu shenyu/shenyu -n=shenyu --create-namespace -f values.yaml
--set bootstrap.enabled=false
--set admin.enabled=false
helm search repo shenyu -l
你会得到类似的输出:
NAME CHART VERSION APP VERSION DESCRIPTION shenyu/shenyu 0.2.0 2.5.0 Helm Chart for deploying Apache ShenYu in Kubernetes ... ...
其中 APP_VERSION
是 ShenYu 的版本,CHART_VERSION
是 Helm Chart 的版本。
根据要安装的 ShenYu 版本来选择对应的 Chart 版本,在命令末尾加上 --version=CHART_VERSION
参数即可。例如:
helm install shenyu shenyu/shenyu -n=shenyu --version=0.2.0 --create-namespace
admin.javaOpts
和 bootstrap.javaOpts
来配置 JVM 参数admin.resources
和 bootstrap.resources
来配置 Kubernetes 资源配额。例:
helm install shenyu shenyu/shenyu -n=shenyu --create-namespace \ --set admin.javaOpts="-Xms256m -Xmx512m" \ --set admin.resources.requests.memory=512Mi \ --set admin.resources.limits.memory=1Gi \ --set admin.resources.requests.cpu=500m \ --set admin.resources.limits.cpu=1 \
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
replicas | int | 1 | 副本数量 |
version | string | "2.5.0" | shenyu 版本,不建议修改,请直接安装对应版本 |
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
admin.nodePort | int | 31095 | NodePort 端口 |
admin.javaOpts | string | 详见这里 | JVM 参数 |
admin.resources | dict | 略 | K8s 资源配额 |
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
bootstrap.nodePort | int | 31195 | NodePort 端口 |
bootstrap.javaOpts | string | 详见这里 | JVM 参数 |
bootstrap.resources | dict | {} | K8s 资源配额 |
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
dataSource.active | string | "h2" | 使用的数据库,支持 h2 , mysql , pg |
dataSource.initEnabled | bool | true | 初始化数据库,仅 h2 有效 |
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
dataSource.h2.username | string | "sa" | 用户名 |
dataSource.h2.password | string | "sa" | 密码 |
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
dataSource.mysql.ip | string | "" | IP |
dataSource.mysql.port | int | 3306 | 端口 |
dataSource.mysql.username | string | "root" | 用户名 |
dataSource.mysql.password | string | "" | 密码 |
dataSource.mysql.driverClass | string | "com.mysql.cj.jdbc.Driver" | mysql driver class 名字 |
dataSource.mysql.connectorVersion | string | "8.0.23" | connector 版本(maven connector 列表) |
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
dataSource.pg.ip | string | "" | IP |
dataSource.pg.port | int | 5432 | 端口 |
dataSource.pg.username | string | "postgres" | 用户名 |
dataSource.pg.password | string | "" | 密码 |
dataSource.pg.driverClass | string | "org.postgresql.Driver" | PostgreSQL driver class 名字 |
dataSource.pg.connectorVersion | string | "42.2.18" | connector 版本(maven connector 列表) |
配置项 | 类型 | 默认值 | 描述 |
---|---|---|---|
applicationConfig.bootstrap | string | 略 | bootstrap 配置,bootstrap 配置说明 |
applicationConfig.admin | string | 略 | admin 配置,admin 配置说明 |