From bfaf51a2365c6620b9e84210d85a5035c907c686 Mon Sep 17 00:00:00 2001 From: sdojjy Date: Sat, 20 Apr 2019 16:42:16 +0800 Subject: [PATCH 1/3] Support plugin start argument for tidb instance --- charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl | 4 ++++ charts/tidb-cluster/values.yaml | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl b/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl index dc644199ea..0f20d5382c 100644 --- a/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl +++ b/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl @@ -40,6 +40,10 @@ then ARGS="${ARGS} --log-slow-query=${SLOW_LOG_FILE:-}" fi +{{- if .Values.tidb.plugin.enable | default false }} +ARGS="${ARGS} --plugin-dir {{ .Values.tidb.plugin.directory }} --plugin-load {{ .Values.tidb.plugin.list }} " +{{- end }} + echo "start tidb-server ..." echo "/tidb-server ${ARGS}" exec /tidb-server ${ARGS} diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 0ad116d01f..6b25ac31e2 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -192,6 +192,15 @@ tidb: cpu: 20m memory: 5Mi + # tidb plugin configuration + plugin: + # enable pulgin or not + enable: false + # the start argument to specify the folder containing + directory: /pulugins + # the start argument to specify the plugin id (name "-" version) that needs to be loaded, e.g. 'conn_limit-1'. + list: whitelist-1 + # mysqlClient is used to set password for TiDB # it must has Python MySQL client installed mysqlClient: From fde43eece37ec745015940bb4a0aa39fe12730c4 Mon Sep 17 00:00:00 2001 From: sdojjy Date: Sat, 20 Apr 2019 17:24:21 +0800 Subject: [PATCH 2/3] fix typo --- charts/tidb-cluster/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 6b25ac31e2..3be4a982bc 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -194,10 +194,10 @@ tidb: # tidb plugin configuration plugin: - # enable pulgin or not + # enable plugin or not enable: false # the start argument to specify the folder containing - directory: /pulugins + directory: /plugins # the start argument to specify the plugin id (name "-" version) that needs to be loaded, e.g. 'conn_limit-1'. list: whitelist-1 From 719f625ad5f72409aca59fce346a024645571631 Mon Sep 17 00:00:00 2001 From: sdojjy Date: Sat, 20 Apr 2019 18:20:50 +0800 Subject: [PATCH 3/3] change plugin.list from string to array --- charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl | 2 +- charts/tidb-cluster/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl b/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl index 0f20d5382c..4379159a7c 100644 --- a/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl +++ b/charts/tidb-cluster/templates/scripts/_start_tidb.sh.tpl @@ -41,7 +41,7 @@ then fi {{- if .Values.tidb.plugin.enable | default false }} -ARGS="${ARGS} --plugin-dir {{ .Values.tidb.plugin.directory }} --plugin-load {{ .Values.tidb.plugin.list }} " +ARGS="${ARGS} --plugin-dir {{ .Values.tidb.plugin.directory }} --plugin-load {{ .Values.tidb.plugin.list | join "," }} " {{- end }} echo "start tidb-server ..." diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 3be4a982bc..6d264f0986 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -199,7 +199,7 @@ tidb: # the start argument to specify the folder containing directory: /plugins # the start argument to specify the plugin id (name "-" version) that needs to be loaded, e.g. 'conn_limit-1'. - list: whitelist-1 + list: ["whitelist-1"] # mysqlClient is used to set password for TiDB # it must has Python MySQL client installed