From 2ae25785690cb50b345646fa3d78d7d4fe4e89a5 Mon Sep 17 00:00:00 2001 From: cleverhu Date: Mon, 29 Aug 2022 19:35:04 +0800 Subject: [PATCH] add conn poll config Signed-off-by: cleverhu --- clusterpedia/Chart.yaml | 2 +- .../templates/internalstorage-configmap.yaml | 16 +++++--- clusterpedia/values.yaml | 38 ++++++++++++------- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/clusterpedia/Chart.yaml b/clusterpedia/Chart.yaml index cce5c2b..7daff79 100644 --- a/clusterpedia/Chart.yaml +++ b/clusterpedia/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.2 +version: 0.0.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/clusterpedia/templates/internalstorage-configmap.yaml b/clusterpedia/templates/internalstorage-configmap.yaml index 24b34b5..2b28223 100644 --- a/clusterpedia/templates/internalstorage-configmap.yaml +++ b/clusterpedia/templates/internalstorage-configmap.yaml @@ -11,10 +11,14 @@ data: port: {{ include "clusterpedia.storage.port" . }} user: {{ include "clusterpedia.storage.user" . }} database: {{ include "clusterpedia.storage.database" . }} - {{- if .Values.log.enabled }} + {{ if .Values.storageConfig.log.enabled }} log: - stdout: {{ .Values.log.stdout }} - level: {{ .Values.log.level | default "Warn" | quote }} - slowThreshold: {{ .Values.log.slowThreshold }} - ignoreRecordNotFoundError: {{ .Values.log.ignoreRecordNotFoundError }} - {{- end -}} + stdout: {{ .Values.storageConfig.log.stdout }} + level: {{ .Values.storageConfig.log.level | default "Warn" | quote }} + slowThreshold: {{ .Values.storageConfig.log.slowThreshold }} + ignoreRecordNotFoundError: {{ .Values.storageConfig.log.ignoreRecordNotFoundError }} + {{ end }} + connPool: + maxIdleConns: {{ .Values.storageConfig.connPool.maxIdleConns | int }} + maxOpenConns: {{ .Values.storageConfig.connPool.maxOpenConns | int }} + connMaxLifetime: {{ .Values.storageConfig.connPool.connMaxLifetime }} diff --git a/clusterpedia/values.yaml b/clusterpedia/values.yaml index b086a38..8956e8e 100644 --- a/clusterpedia/values.yaml +++ b/clusterpedia/values.yaml @@ -42,19 +42,31 @@ commonAnnotations: {} ## if defined, will create the pv on the node. persistenceMatchNode: "" -## @param config of clusterpedia log -log: - ## @param enabled indicates whether enable log - enabled: false - ## @param stdout indicates whether it is standard output - stdout: false - ## @param level indicates the level of log - ## Level must be one of [Silent, Error, Warn, Info], Default is 'Warn' - level: Warn - ## @param slowThreshold default 200ms - slowThreshold: 100ms - ## @param ignoreRecordNotFoundError indicates whether ignore error type `NotFound` - ignoreRecordNotFoundError: false +## @param storageConfig StorageConfig for the apiserver and clustersynchro manger +## +storageConfig: + ## @param storageConfig.log Config of clusterpedia log + log: + ## @param storageConfig.log.enabled indicates whether enable log + enabled: false + ## @param storageConfig.log.stdout indicates whether it is standard output + stdout: false + ## @param level indicates the level of log + ## Level must be one of [Silent, Error, Warn, Info], Default is 'Warn' + level: Warn + ## @param storageConfig.log.slowThreshold default 200ms + slowThreshold: 100ms + ## @param storageConfig.log.ignoreRecordNotFoundError indicates whether ignore error type `NotFound` + ignoreRecordNotFoundError: false + ## @param storageConfig.connPool the connPoll config of storage + connPool: + ## @param storageConfig.connPool.maxIdleConns sets the maximum number of connections in the idle + ## connection pool + maxIdleConns: 5 + ## @param storageConfig.connPool.maxOpenConns sets the maximum number of open connections to the database + maxOpenConns: 40 + ## @param storageConfig.connPool.connMaxLifetime sets the maximum amount of time a connection may be reused + connMaxLifetime: 60m ## @param external define the auth param of external database ## if set the storageInstallMode to "external", the param must be set.