[type:feat]: auto download MySQL connector and update configurations (#13)
* feat: update application.yaml and auto resolve mysql connector
Signed-off-by: Bird <aflybird0@gmail.com>
* doc: update README
Signed-off-by: Bird <aflybird0@gmail.com>
* chore: update maintainers info and .gitignore
Signed-off-by: Bird <aflybird0@gmail.com>
* doc: update README
Signed-off-by: Bird <aflybird0@gmail.com>
* chore: update README and remove logback.xml
Signed-off-by: Bird <aflybird0@gmail.com>
* feat: use `helm show values` to get values.yaml
Signed-off-by: Bird <aflybird0@gmail.com>
* feat: update name and path of application.yml
Signed-off-by: Bird <aflybird0@gmail.com>
* chore: update comments according to erdengk's review
Signed-off-by: Bird <aflybird0@gmail.com>
* fix: mysql driver class name error
Signed-off-by: Bird <aflybird0@gmail.com>
* fix: mount path overwrite
Signed-off-by: Bird <aflybird0@gmail.com>
* fix: missing application-mysql.yaml and mysql-connector name error
Signed-off-by: Bird <aflybird0@gmail.com>
* fix: admin port error
Signed-off-by: Bird <aflybird0@gmail.com>
Signed-off-by: Bird <aflybird0@gmail.com>
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 30f2631..fbd1148 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -1,6 +1,7 @@
name: Lint and Test Charts
on:
+ push:
pull_request:
jobs:
@@ -19,6 +20,13 @@
with:
version: v3.8.2
+ - name: Update Helm Dependency
+ run: |
+ helm repo add bitnami https://charts.bitnami.com/bitnami
+ cd charts/shenyu
+ helm dependency update
+ cd ../..
+
- name: Set up chart-testing
uses: ./.github/actions/chart-testing-action
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 29949d9..2e51274 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -26,6 +26,13 @@
with:
version: v3.8.1
+ - name: Update Helm Dependency
+ run: |
+ helm repo add bitnami https://charts.bitnami.com/bitnami
+ cd charts/shenyu
+ helm dependency update
+ cd ../..
+
- name: Run chart-releaser
uses: ./.github/actions/chart-releaser-action
env:
diff --git a/.gitignore b/.gitignore
index 0df3248..2269e06 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+# helm pkg
+*.tgz
+
# maven ignore
target/
*.class
diff --git a/charts/shenyu/Chart.yaml b/charts/shenyu/Chart.yaml
index fe725f3..7e66a95 100644
--- a/charts/shenyu/Chart.yaml
+++ b/charts/shenyu/Chart.yaml
@@ -2,10 +2,15 @@
name: shenyu
description: Helm Chart for deploying Apache ShenYu in Kubernetes
type: application
-version: 0.1.1
-appVersion: "2.4.3"
+version: 0.2.0
+appVersion: "2.5.0"
icon: https://shenyu.apache.org/img/logo.png
maintainers:
- name: erdengk
+ email: wannengdek@gmail.com
- name: aFlyBird0
email: aflybird0@gmail.com
+dependencies:
+ - name: common
+ version: 1.x.x
+ repository: https://charts.bitnami.com/bitnami
diff --git a/charts/shenyu/README.md b/charts/shenyu/README.md
index ea58d44..75abc3e 100644
--- a/charts/shenyu/README.md
+++ b/charts/shenyu/README.md
@@ -15,8 +15,6 @@
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
-todo: complete English version
-
---
## 使用Helm安装ShenYu
@@ -32,9 +30,16 @@
```
## 安装
-* helm 安装方式目前支持 h2 与 MySQL 两种数据库。默认使用 h2。
-* 默认同时安装 admin 与 bootstrap。
-* 使用 NodePort 暴露服务,admin 默认端口为 31095, bootstrap 为 31195。
+
+### 部署先决条件
+
+在阅读本文档前,你需要先阅读[部署先决条件](https://shenyu.apache.org/zh/docs/deployment/deployment-before)来完成部署 ShenYu 前的环境准备工作。
+
+### 说明
+
+* **安装应用**:默认同时安装 admin 与 bootstrap。
+* **服务暴露**:使用 NodePort 暴露服务,admin 默认端口为 31095, bootstrap 为 31195。
+* **数据库**:目前支持 h2 与 MySQL 两种数据库。默认使用 h2。
### h2 作为数据库
@@ -46,76 +51,34 @@
### MySQL 作为数据库
-MySQL 安装方式需要提前安装好 MySQ,并提前创建好 pv 以存放 connector。详见 [部署先决条件](https://shenyu.apache.org/zh/docs/deployment/deployment-before/)。
-
-#### 1. 提前创建 pv
-
-可复制以下 yaml,至少**替换以下两处内容**:
-
-* `YOUR_K8S_NODE_NAME`:存放 MySQL connector 的 K8s 节点名称
-* `YOUR_PATH_TO_STORE_MYSQL_CONNECTOR`:# 指定节点上的目录, 该目录下面需要包含 mysql-connector.jar
-
-```shell
-apiVersion: v1
-kind: PersistentVolume
-metadata:
- name: shenyu-pv
-spec:
- capacity:
- storage: 1Gi
- volumeMode: Filesystem
- accessModes:
- - ReadWriteOnce
- persistentVolumeReclaimPolicy: Delete
- storageClassName: shenyu-local-storage
- local:
- path: YOUR_PATH_TO_STORE_MYSQL_CONNECTOR
- nodeAffinity:
- required:
- nodeSelectorTerms:
- - matchExpressions:
- - key: kubernetes.io/hostname
- operator: In
- values:
- - YOUR_K8S_NODE_NAME
----
-apiVersion: storage.k8s.io/v1
-kind: StorageClass
-metadata:
- name: shenyu-local-storage
-provisioner: kubernetes.io/no-provisioner
-volumeBindingMode: WaitForFirstConsumer
-```
-
-修改并保存为 `shenyu-store.yaml`, 然后执行:
-
-```shell
-kubectl apply -f shenyu-store.yaml -n=shenyu
-```
-
-#### 2. 安装
-
修改以下命令并复制,执行:
-其中,storageClass 和上面的 yaml 创建的 StorageClass 的 name 对应。
-
```shell
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 \
- --set dataSource.mysql.storageClass=shenyu-local-storage
```
## Q&A
-### 1. 如果只安装 admin 或 bootstrap
+### 1. 需要大量修改配置信息,如修改 application.yaml ,如何安装
+
+1. 下载完整 values.yaml
+* 最新 chart 版本:`helm show values shenyu/shenyu > values.yaml`
+* 特定 chart 版本, 如 `0.2.0`: `helm show values shenyu/shenyu --version=0.2.0 > values.yaml`
+2. 修改 values.yaml 文件
+3. 更改相应配置,使用 `-f values.yaml` 的格式执行 `helm install` 命令。
+如:`helm install shenyu shenyu/shenyu -n=shenyu --create-namespace -f values.yaml`
+
+### 2. 如何只安装 admin 或 bootstrap
* 只安装 admin: 在 helm 安装命令末尾加上 `--set bootstrap.enabled=false`
* 只安装 bootstrap: 在 helm 安装命令末尾加上 `--set admin.enabled=false`
-### 2. 如何安装旧版本 ShenYu
+### 3. 如何安装旧版本 ShenYu
```shell
helm search repo shenyu -l
@@ -125,15 +88,59 @@
```shell
NAME CHART VERSION APP VERSION DESCRIPTION
-shenyu/shenyu 2.4.3 2.4.3 Helm Chart for deploying Apache ShenYu in Kuber...
+shenyu/shenyu 0.2.0 2.5.0 Helm Chart for deploying Apache ShenYu in Kubernetes
...
...
```
-其中 APP_VERSION 是 ShenYu 的版本,CHART_VERSION 是 helm chart 的版本。
+其中 `APP_VERSION` 是 ShenYu 的版本,`CHART_VERSION` 是 Helm Chart 的版本。
根据要安装的 ShenYu 版本来选择对应的 Chart 版本,在命令末尾加上 `--version=CHART_VERSION` 参数即可。例如:
```shell
-helm install shenyu shenyu/shenyu -n=shenyu --version=2.4.3 --create-namespace
+helm install shenyu shenyu/shenyu -n=shenyu --version=0.2.0 --create-namespace
```
+
+## Values 配置说明
+
+### 全局配置
+| 配置项 | 类型 | 默认值 | 描述 |
+|--------------------|--------|-----------------------------|---------------------------------------|
+| replicas | int | `1` | 副本数量 |
+| version | string | `"2.5.0"` | shenyu 版本,不建议修改,请直接安装对应版本 |
+| admin.enabled | bool | `true` | 是否安装 shenyu-admin |
+| admin.image | string | `"apache/shenyu-admin"` | shenyu-admin 镜像 |
+| admin.nodePort | int | `31095` | shenyu-admin NodePort 端口 |
+| bootstrap.enabled | bool | `true` | 是否安装 shenyu-bootstrap |
+| bootstrap.image | string | `"apache/shenyu-bootstrap"` | shenyu-bootstrap 镜像 |
+| bootstrap.nodePort | int | `31195` | shenyu-bootstrap NodePort 端口 |
+
+### 数据库配置
+
+#### 数据库总配置
+| 配置项 | 类型 | 默认值 | 描述 |
+|------------------------|--------|--------|-------------------------------|
+| dataSource.active | string | `"h2"` | 使用的数据库,支持 `h2`, `mysql` |
+| dataSource.initEnabled | bool | `true` | 初始化数据库,仅 `h2` 有效 |
+
+#### h2
+| 配置项 | 类型 | 默认值 | 描述 |
+|------------------------|--------|--------|-------|
+| dataSource.h2.username | string | `"sa"` | 用户名 |
+| dataSource.h2.password | string | `"sa"` | 密码 |
+
+#### MySQL
+| 配置项 | 类型 | 默认值 | 描述 |
+|-----------------------------------|--------|------------------------------|---------------------------------------------------------------------------------------------------|
+| dataSource.mysql.ip | string | `""` | IP |
+| dataSource.mysql.port | int | `3306` | 端口 |
+| dataSource.mysql.username | string | `"root"` | 用户名 |
+| dataSource.mysql.password | string | `""` | 密码 |
+| dataSource.mysql.connectorVersion | string | `"8.0.23"` | connector 版本([maven connector 列表](https://repo1.maven.org/maven2/mysql/mysql-connector-java/)) |
+| dataSource.mysql.driverClass | string | `"com.mysql.cj.jdbc.Driver"` | mysql driver class 名字 |
+
+### application.yml 配置
+| 配置项 | 类型 | 默认值 | 描述 |
+|-----------------------------|--------|-------|--------------------------------------------------------------------------------------------------------------------------|
+| applicationConfig.bootstrap | string | 略 | bootstrap 配置,[bootstrap 配置说明](https://shenyu.apache.org/zh/docs/user-guide/property-config/gateway-property-config) |
+| applicationConfig.admin | string | 略 | admin 配置,[admin 配置说明](https://shenyu.apache.org/zh/docs/user-guide/property-config/admin-property-config) |
diff --git a/charts/shenyu/templates/ConfigMap.yaml b/charts/shenyu/templates/ConfigMap.yaml
index be8cb4e..480e9e4 100644
--- a/charts/shenyu/templates/ConfigMap.yaml
+++ b/charts/shenyu/templates/ConfigMap.yaml
@@ -2,63 +2,19 @@
kind: ConfigMap
metadata:
namespace: {{.Release.Namespace}}
- name: {{ template "shenyu.fullname" . }}-configmap
+ name: {{ template "common.names.fullname" . }}-configmap
labels:
- "app.kubernetes.io/name": '{{ template "shenyu.name" . }}'
+ "app.kubernetes.io/name": '{{ template "common.names.name" . }}'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-configmap"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
data:
- application-local.yml: |
- server:
- port: 9195
- address: 0.0.0.0
- spring:
- profiles:
- active: {{ .Values.dataSource.active }}
- main:
- allow-bean-definition-overriding: true
- application:
- name: shenyu-bootstrap
- management:
- health:
- defaults:
- enabled: false
- shenyu:
- local:
- enabled: true
- file:
- enabled: true
- cross:
- enabled: true
- dubbo:
- parameter: multi
- sync:
- websocket:
- urls: ws://{{ template "shenyu.fullname" . }}-admin.shenyu.svc.cluster.local:9095/websocket
- exclude:
- enabled: false
- paths:
- - /favicon.ico
- extPlugin:
- enabled: true
- threads: 1
- scheduleTime: 300
- scheduleDelay: 30
- scheduler:
- enabled: false
- type: fixed
- threads: 16
- logging:
- level:
- root: info
- org.springframework.boot: info
- org.apache.ibatis: info
- org.apache.shenyu.bonuspoint: info
- org.apache.shenyu.lottery: info
- org.apache.shenyu: info
+ application-bootstrap.yml: |-
+ {{- include "common.tplvalues.render" (dict "value" .Values.applicationConfig.bootstrap "context" $) | nindent 4 }}
+ application-admin.yml: |-
+ {{- include "common.tplvalues.render" (dict "value" .Values.applicationConfig.admin "context" $) | nindent 4 }}
{{- if eq .Values.dataSource.active "h2" }}
- application-h2.yml: |
+ application-h2.yml: |-
shenyu:
database:
dialect: h2
@@ -72,15 +28,15 @@
driver-class-name: org.h2.Driver
{{- end }}
{{- if eq .Values.dataSource.active "mysql" }}
- application-mysql.yml: |
+ application-mysql.yml: |-
shenyu:
database:
dialect: mysql
init_enable: {{ .Values.dataSource.initEnabled }}
spring:
datasource:
- url: jdbc:mysql://{{ template "shenyu.fullname" . }}-mysql.shenyu.svc.cluster.local:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false
+ url: jdbc:mysql://{{ template "common.names.fullname" . }}-mysql.shenyu.svc.cluster.local:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull
username: {{ .Values.dataSource.mysql.username }}
- password: {{ .Values.dataSource.mysql.password }}
+ password: {{ required "`dataSource.mysql.password` is required" .Values.dataSource.mysql.password }}
driver-class-name: {{ .Values.dataSource.mysql.driverClass }}
{{- end }}
diff --git a/charts/shenyu/templates/_helpers.tpl b/charts/shenyu/templates/_helpers.tpl
index 28c199d..e69de29 100644
--- a/charts/shenyu/templates/_helpers.tpl
+++ b/charts/shenyu/templates/_helpers.tpl
@@ -1,13 +0,0 @@
-{{- define "shenyu.name" -}}
-{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-
-
-{{- define "shenyu.fullname" -}}
-{{- $name := .Chart.Name -}}
-{{- if contains $name .Release.Name -}}
-{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
-{{- else -}}
-{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
-{{- end -}}
-{{- end -}}
diff --git a/charts/shenyu/templates/shenyu-admin-deployment.yaml b/charts/shenyu/templates/shenyu-admin-deployment.yaml
index 87d7a4c..7baf5bd 100644
--- a/charts/shenyu/templates/shenyu-admin-deployment.yaml
+++ b/charts/shenyu/templates/shenyu-admin-deployment.yaml
@@ -3,9 +3,9 @@
kind: Deployment
metadata:
namespace: {{ .Release.Namespace }}
- name: {{ template "shenyu.fullname" . }}-admin
+ name: {{ template "common.names.fullname" . }}-admin
labels:
- "app.kubernetes.io/name": '{{ template "shenyu.name" . }}-admin'
+ "app.kubernetes.io/name": '{{ template "common.names.name" . }}-admin'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-admin"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
@@ -18,11 +18,25 @@
template:
metadata:
labels:
- "app.kubernetes.io/name": '{{ template "shenyu.name" . }}-admin'
+ "app.kubernetes.io/name": '{{ template "common.names.name" . }}-admin'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-admin"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
spec:
+ {{- if eq .Values.dataSource.active "mysql"}}
+ {{- $mysqlConnectorVersion := (required "once `dataSource.active` is set to mysql, `dataSource.mysql.connectorVersion` should not be empty" .Values.dataSource.mysql.connectorVersion)}}
+ initContainers:
+ - name: download-mysql-jar
+ image: busybox:1.35.0
+ command: [ "sh","-c","wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/{{$mysqlConnectorVersion}}/mysql-connector-java-{{$mysqlConnectorVersion}}.jar;
+ wget https://repo1.maven.org/maven2/mysql/mysql-connector-java/{{$mysqlConnectorVersion}}/mysql-connector-java-{{.Values.dataSource.mysql.connectorVersion}}.jar.md5;
+ if [ $(md5sum mysql-connector-java-{{$mysqlConnectorVersion}}.jar | cut -d ' ' -f1) = $(cat mysql-connector-java-{{$mysqlConnectorVersion}}.jar.md5) ];
+ then echo success;
+ else echo failed;exit 1;fi;mv /mysql-connector-java-{{$mysqlConnectorVersion}}.jar /opt/shenyu-admin/ext-lib/mysql-connector.jar" ]
+ volumeMounts:
+ - name: mysql-connector-volume
+ mountPath: /opt/shenyu-admin/ext-lib
+ {{- end }}
containers:
- name: shenyu-admin
image: {{ .Values.admin.image }}:{{ required "A valid .Values.version entry required!" .Values.version }}
@@ -32,30 +46,28 @@
env:
- name: 'TZ'
value: 'Asia/Beijing'
- {{- if eq .Values.dataSource.active "h2" }}
volumeMounts:
- name: shenyu-admin-config
- mountPath: /opt/shenyu-admin/config/application-h2.yml
- subPath: application-h2.yml
- {{- end}}
+ mountPath: /opt/shenyu-admin/conf/application.yml
+ subPath: application.yml
{{- if eq .Values.dataSource.active "mysql" }}
- volumeMounts:
+ - name: mysql-connector-volume
+ mountPath: /opt/shenyu-admin/ext-lib
- name: shenyu-admin-config
- mountPath: /opt/shenyu-admin/config/application-mysql.yml
+ mountPath: /opt/shenyu-admin/conf/application-mysql.yml
subPath: application-mysql.yml
- - mountPath: /opt/shenyu-admin/ext-lib
- name: mysql-connector-volume
{{- end}}
volumes:
{{- if eq .Values.dataSource.active "mysql" }}
- name: mysql-connector-volume
- persistentVolumeClaim:
- claimName: {{ template "shenyu.fullname" . }}-pvc
+ emptyDir: { }
{{- end }}
- name: shenyu-admin-config
configMap:
- name: {{ template "shenyu.fullname" . }}-configmap
+ name: {{ template "common.names.fullname" . }}-configmap
items:
+ - key: application-admin.yml
+ path: application.yml
{{- if eq .Values.dataSource.active "mysql" }}
- key: application-mysql.yml
path: application-mysql.yml
diff --git a/charts/shenyu/templates/shenyu-admin-svc.yaml b/charts/shenyu/templates/shenyu-admin-svc.yaml
index ea311b0..1338484 100644
--- a/charts/shenyu/templates/shenyu-admin-svc.yaml
+++ b/charts/shenyu/templates/shenyu-admin-svc.yaml
@@ -4,9 +4,9 @@
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
- name: {{ template "shenyu.fullname" . }}-admin
+ name: {{ template "common.names.fullname" . }}-admin
labels:
- "app.kubernetes.io/name": '{{ template "shenyu.name" . }}-admin'
+ "app.kubernetes.io/name": '{{ template "common.names.name" . }}-admin'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-admin"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
diff --git a/charts/shenyu/templates/shenyu-bootstrap-deployment.yaml b/charts/shenyu/templates/shenyu-bootstrap-deployment.yaml
index a5664bf..201da32 100644
--- a/charts/shenyu/templates/shenyu-bootstrap-deployment.yaml
+++ b/charts/shenyu/templates/shenyu-bootstrap-deployment.yaml
@@ -4,9 +4,9 @@
kind: Deployment
metadata:
namespace: {{ .Release.Namespace }}
- name: {{ template "shenyu.fullname" . }}-bootstrap
+ name: {{ template "common.names.fullname" . }}-bootstrap
labels:
- "app.kubernetes.io/name": '{{ template "shenyu.name" . }}-bootstrap'
+ "app.kubernetes.io/name": '{{ template "common.names.name" . }}-bootstrap'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-bootstrap"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
@@ -19,7 +19,7 @@
template:
metadata:
labels:
- "app.kubernetes.io/name": '{{ template "shenyu.name" . }}-bootstrap'
+ "app.kubernetes.io/name": '{{ template "common.names.name" . }}-bootstrap'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-bootstrap"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
@@ -27,10 +27,10 @@
volumes:
- name: shenyu-bootstrap-config
configMap:
- name: {{ template "shenyu.fullname" . }}-configmap
+ name: {{ template "common.names.fullname" . }}-configmap
items:
- - key: application-local.yml
- path: application-local.yml
+ - key: application-bootstrap.yml
+ path: application.yml
containers:
- name: shenyu-bootstrap
image: {{ .Values.bootstrap.image }}:{{ required "A valid .Values.version entry required!" .Values.version }}
@@ -41,6 +41,6 @@
value: Asia/Beijing
volumeMounts:
- name: shenyu-bootstrap-config
- mountPath: /opt/shenyu-bootstrap/conf/application-local.yml
- subPath: application-local.yml
+ mountPath: /opt/shenyu-bootstrap/conf/application.yml
+ subPath: application.yml
{{- end -}}
diff --git a/charts/shenyu/templates/shenyu-bootstrap-svc.yaml b/charts/shenyu/templates/shenyu-bootstrap-svc.yaml
index eecb17c..0c0e976 100644
--- a/charts/shenyu/templates/shenyu-bootstrap-svc.yaml
+++ b/charts/shenyu/templates/shenyu-bootstrap-svc.yaml
@@ -4,9 +4,9 @@
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
- name: {{ template "shenyu.fullname" . }}-bootstrap
+ name: {{ template "common.names.fullname" . }}-bootstrap
labels:
- "app.kubernetes.io/name": '{{ template "shenyu.name" .}}-bootstrap'
+ "app.kubernetes.io/name": '{{ template "common.names.name" .}}-bootstrap'
"app.kubernetes.io/managed-by": "{{ .Release.Service }}"
"app.kubernetes.io/component": "shenyu-bootstrap"
"app.kubernetes.io/instance": "{{ .Release.Name }}"
diff --git a/charts/shenyu/templates/shenyu-endpoint.yaml b/charts/shenyu/templates/shenyu-endpoint.yaml
index 46712d9..b262d57 100644
--- a/charts/shenyu/templates/shenyu-endpoint.yaml
+++ b/charts/shenyu/templates/shenyu-endpoint.yaml
@@ -3,7 +3,7 @@
kind: Service
apiVersion: v1
metadata:
- name: {{ template "shenyu.fullname" . }}-mysql
+ name: {{ template "common.names.fullname" . }}-mysql
namespace: {{ .Release.Namespace }}
spec:
ports:
@@ -14,7 +14,7 @@
kind: Endpoints
apiVersion: v1
metadata:
- name: {{ template "shenyu.fullname" . }}-mysql
+ name: {{ template "common.names.fullname" . }}-mysql
namespace: {{ .Release.Namespace }}
subsets:
- addresses:
diff --git a/charts/shenyu/templates/shenyu-store.yaml b/charts/shenyu/templates/shenyu-store.yaml
deleted file mode 100644
index ea77314..0000000
--- a/charts/shenyu/templates/shenyu-store.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-{{- if .Values.admin.enabled -}}
-{{- if eq .Values.dataSource.active "mysql" -}}
----
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
- name: {{ template "shenyu.fullname" . }}-pvc
- namespace: {{ .Release.Namespace }}
-spec:
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: 1Gi
- storageClassName: {{ required ".Values.dataSource.mysql.storageClass is required" .Values.dataSource.mysql.storageClass}}
----
-{{- end -}}
-{{- end -}}
diff --git a/charts/shenyu/values.yaml b/charts/shenyu/values.yaml
index f410d2b..8300eea 100644
--- a/charts/shenyu/values.yaml
+++ b/charts/shenyu/values.yaml
@@ -1,13 +1,24 @@
-version: 2.4.3
+#################################################
+# global configs #
+#################################################
+# it's not recommended to change this version
+version: 2.5.0
replicas: 1
admin:
enabled: true
image: apache/shenyu-admin
+ # if you want to change "admin service port", please edit here
nodePort: 31095
bootstrap:
enabled: true
image: apache/shenyu-bootstrap
+ # if you want to change "bootstrap service port", please edit here
nodePort: 31195
+
+#################################################
+# datasource config of shenyu-admin #
+#################################################
+
dataSource:
# options: [h2, mysql]
active: h2
@@ -21,9 +32,380 @@
port: 3306
username: root
password:
- # the existing storage class which stores mysql-connector.jar
- storageClass:
# mysql driver class name
# mysql5 : com.mysql.jdbc.Driver
# mysql6-8 : com.mysql.cj.jdbc.Driver
- driverClass: com.mysql.cj.Driver
+ driverClass: com.mysql.cj.jdbc.Driver
+ connectorVersion: 8.0.23
+
+#################################################
+# application.yml of admin and bootstrap #
+#################################################
+
+applicationConfig:
+ bootstrap:
+ server:
+ # Do not change this port, it is used by the Kubernetes service
+ port: 9195
+ address: 0.0.0.0
+
+ spring:
+ main:
+ allow-bean-definition-overriding: true
+ allow-circular-references: true
+ application:
+ name: shenyu-bootstrap
+ codec:
+ max-in-memory-size: 2MB
+ cloud:
+ discovery:
+ enabled: false
+ nacos:
+ discovery:
+ # Spring Cloud Alibaba Dubbo use this.
+ server-addr: 127.0.0.1:8848
+ enabled: false
+ namespace: ShenyuRegisterCenter
+
+ # if you want use ribbon please config every server.
+ # springCloud-test:
+ # ribbon:
+ # NIWSServerListClassName: com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList
+
+ eureka:
+ client:
+ enabled: false
+ serviceUrl:
+ defaultZone: http://localhost:8761/eureka/
+ instance:
+ prefer-ip-address: true
+
+ # security:
+ # oauth2:
+ # client:
+ # registration:
+ # <your client-registration-id>:
+ # client-id: <your client-id>
+ # client-secret: <your client-secret>
+ # provider:
+ # <your client-registration-id>:
+ # authorization-uri: <your authorization-uri>
+ # token-uri: <your access-token-uri>
+ # user-info-uri: <your user-info-uri>
+ # jwk-set-uri: <your jwk-set-uri>
+
+ management:
+ health:
+ defaults:
+ enabled: false
+
+ shenyu:
+ matchCache:
+ enabled: false
+ # 256MB
+ maxFreeMemory: 256
+ netty:
+ http:
+ # set to false, user can custom the netty tcp server config.
+ webServerFactoryEnabled: true
+ selectCount: 1
+ workerCount: 4
+ accessLog: false
+ serverSocketChannel:
+ soRcvBuf: 87380
+ soBackLog: 128
+ soReuseAddr: false
+ connectTimeoutMillis: 10000
+ writeBufferHighWaterMark: 65536
+ writeBufferLowWaterMark: 32768
+ writeSpinCount: 16
+ autoRead: false
+ allocType: "pooled"
+ messageSizeEstimator: 8
+ singleEventExecutorPerGroup: true
+ socketChannel:
+ soKeepAlive: false
+ soReuseAddr: false
+ soLinger: -1
+ tcpNoDelay: true
+ soRcvBuf: 87380
+ soSndBuf: 16384
+ ipTos: 0
+ allowHalfClosure: false
+ connectTimeoutMillis: 10000
+ writeBufferHighWaterMark: 65536
+ writeBufferLowWaterMark: 32768
+ writeSpinCount: 16
+ autoRead: false
+ allocType: "pooled"
+ messageSizeEstimator: 8
+ singleEventExecutorPerGroup: true
+ # httpclient:
+ # strategy: webClient
+ # connectTimeout: 45000
+ # responseTimeout: 3000
+ # readerIdleTime: 3000
+ # writerIdleTime: 3000
+ # allIdleTime: 3000
+ # readTimeout: 3000
+ # writeTimeout: 3000
+ # wiretap: false
+ # keepAlive: false
+ # maxInMemorySize: 1 #1mb
+ # pool:
+ # type: ELASTIC
+ # name: proxy
+ # maxConnections: 16
+ # acquireTimeout: 45000
+ # maxIdleTime: 3000
+ # proxy:
+ # host:
+ # port:
+ # username:
+ # password:
+ # nonProxyHostsPattern:
+ # ssl:
+ # useInsecureTrustManager: true
+ # keyStoreType: PKCS12
+ # keyStorePath: classpath:keystore.p12
+ # keyStorePassword: 123456
+ # keyStoreProvider:
+ # keyPassword: 123456
+ # trustedX509Certificates:
+ # handshakeTimeout:
+ # closeNotifyFlushTimeout:
+ # closeNotifyReadTimeout:
+ # defaultConfigurationType:
+ # threadPool:
+ # prefix: shenyu
+ # selectCount: 1
+ # workerCount: 8
+ # daemon: true
+ instance:
+ enabled: false
+ # zookeeper, etcd, consul
+ registerType: zookeeper
+ # http://localhost:2379 #localhost:8848
+ serverLists: localhost:2181
+ props:
+ cross:
+ enabled: true
+ allowedHeaders:
+ allowedMethods: "*"
+ # the same of Access-Control-Allow-Origin: "*"
+ allowedAnyOrigin: true
+ # allowedOrigin:
+ # format : schema://prefix spacer domain
+ # Access-Control-Allow-Origin: "http://a.apache.org,http://b.apache.org"
+ # spacer: "."
+ # domain: apache.org
+ # prefixes:
+ # - a # a.apache.org
+ # - b # b.apache.org
+ # origins:
+ # - c.apache.org
+ # - d.apache.org
+ # - http://e.apache.org
+ # originRegex: ^http(|s)://(.*\.|)abc.com$
+ allowedExpose: ""
+ maxAge: "18000"
+ allowCredentials: true
+
+ switchConfig:
+ local: true
+ file:
+ enabled: true
+ maxSize: 10
+ sync:
+ websocket:
+ urls: ws://{{ template "common.names.fullname" . }}-admin.shenyu.svc.cluster.local:9095/websocket
+ allowOrigin: ws://{{ template "common.names.fullname" . }}-bootstrap.shenyu.svc.cluster.local:9195
+ # zookeeper:
+ # url: localhost:2181
+ # sessionTimeout: 5000
+ # connectionTimeout: 2000
+ # http:
+ # url: http://{{ template "common.names.fullname" . }}-admin.shenyu.svc.cluster.local:9095
+ # username:
+ # password:
+ # nacos:
+ # url: localhost:8848
+ # namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
+ # username:
+ # password:
+ # acm:
+ # enabled: false
+ # endpoint: acm.aliyun.com
+ # namespace:
+ # accessKey:
+ # secretKey:
+ # etcd:
+ # url: http://localhost:2379
+ # consul:
+ # url: http://localhost:8500
+ # waitTime: 1000
+ # watchDelay: 1000
+ exclude:
+ enabled: false
+ paths:
+ - /favicon.ico
+ fallback:
+ enabled: false
+ paths:
+ - /fallback/hystrix
+ - /fallback/resilience4j
+ health:
+ enabled: false
+ paths:
+ - /actuator/health
+ - /health_check
+ extPlugin:
+ path:
+ enabled: true
+ threads: 1
+ scheduleTime: 300
+ scheduleDelay: 30
+ scheduler:
+ enabled: false
+ type: fixed
+ threads: 16
+ upstreamCheck:
+ enabled: false
+ timeout: 3000
+ healthyThreshold: 1
+ unhealthyThreshold: 1
+ interval: 5000
+ printEnabled: true
+ printInterval: 60000
+ ribbon:
+ serverListRefreshInterval: 10000
+ metrics:
+ enabled: false
+ name: prometheus
+ host: 127.0.0.1
+ port: 8090
+ jmxConfig:
+ props:
+ jvm_enabled: true
+ # plugins:
+ # rate-limiter.enabled: false
+ local:
+ enabled: false
+ sha512Key: "BA3253876AED6BC22D4A6FF53D8406C6AD864195ED144AB5C87621B6C233B548BAEAE6956DF346EC8C17F5EA10F35EE3CBC514797ED7DDD3145464E2A0BAB413"
+ # sharedPool:
+ # enable: true
+ # prefix: "shenyu-shared"
+ # corePoolSize: 200
+ # maximumPoolSize: 2000
+ # keepAliveTime: 60000
+ # # 1GB
+ # maxWorkQueueMemory: 1073741824
+ # # 256MB
+ # maxFreeMemory: 268435456
+
+ logging:
+ level:
+ root: info
+ org.springframework.boot: info
+ org.apache.ibatis: info
+ org.apache.shenyu.bonuspoint: info
+ org.apache.shenyu.lottery: info
+ org.apache.shenyu: info
+ admin:
+ server:
+ # Do not change this port, it is used by the Kubernetes service
+ port: 9095
+ address: 0.0.0.0
+
+ spring:
+ profiles:
+ active: "{{ .Values.dataSource.active }}"
+ thymeleaf:
+ cache: true
+ encoding: utf-8
+ enabled: true
+ prefix: classpath:/static/
+ suffix: .html
+ mvc:
+ pathmatch:
+ matching-strategy: ant_path_matcher
+
+ mybatis:
+ config-location: classpath:/mybatis/mybatis-config.xml
+ mapper-locations: classpath:/mappers/*.xml
+
+ shenyu:
+ register:
+ # http #zookeeper #etcd #nacos #consul
+ registerType: http
+ # localhost:2181 #http://localhost:2379 #localhost:8848
+ serverLists:
+ props:
+ sessionTimeout: 5000
+ connectionTimeout: 2000
+ checked: true
+ zombieCheckTimes: 5
+ scheduledTime: 10
+ nacosNameSpace: ShenyuRegisterCenter
+ sync:
+ websocket:
+ enabled: true
+ messageMaxSize: 10240
+ allowOrigins: ws://{{ template "common.names.fullname" . }}-admin.shenyu.svc.cluster.local:9095;{{ template "common.names.fullname" . }}-bootstrap.shenyu.svc.cluster.local:9195;
+ # zookeeper:
+ # url: localhost:2181
+ # sessionTimeout: 5000
+ # connectionTimeout: 2000
+ # http:
+ # enabled: true
+ # nacos:
+ # url: localhost:8848
+ # namespace: 1c10d748-af86-43b9-8265-75f487d20c6c
+ # username:
+ # password:
+ # acm:
+ # enabled: false
+ # endpoint: acm.aliyun.com
+ # namespace:
+ # accessKey:
+ # secretKey:
+ # etcd:
+ # url: http://localhost:2379
+ # consul:
+ # url: http://localhost:8500
+ ldap:
+ enabled: false
+ url: ldap://xxxx:xxx
+ bind-dn: cn=xxx,dc=xxx,dc=xxx
+ password: xxxx
+ base-dn: ou=xxx,dc=xxx,dc=xxx
+ object-class: person
+ login-field: cn
+ jwt:
+ expired-seconds: 86400000
+ shiro:
+ white-list:
+ - /
+ - /favicon.*
+ - /static/**
+ - /index**
+ - /platform/login
+ - /websocket
+ - /error
+ - /actuator/health
+ - /swagger-ui.html
+ - /webjars/**
+ - /swagger-resources/**
+ - /v2/api-docs
+ - /csrf
+ swagger:
+ enable: true
+
+ logging:
+ level:
+ root: info
+ org.springframework.boot: info
+ org.apache.ibatis: info
+ org.apache.shenyu.bonuspoint: info
+ org.apache.shenyu.lottery: info
+ org.apache.shenyu: info