Skip to content

Commit

Permalink
add conn poll config
Browse files Browse the repository at this point in the history
Signed-off-by: cleverhu <[email protected]>
  • Loading branch information
cleverhu committed Sep 14, 2022
1 parent 295726d commit 2ae2578
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
2 changes: 1 addition & 1 deletion clusterpedia/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions clusterpedia/templates/internalstorage-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
38 changes: 25 additions & 13 deletions clusterpedia/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2ae2578

Please sign in to comment.