Skip to main content
Version: Preview

Configure cluster parameters

The KubeBlocks configuration function provides a set of consistent default configuration generation strategies for all the databases running on KubeBlocks and also provides a unified parameter configuration interface to facilitate managing parameter configuration, searching the parameter user guide, and validating parameter effectiveness.

From v0.6.0, KubeBlocks supports kbcli cluster configure and kbcli cluster edit-config to configure parameters. The difference is that KubeBlocks configures parameters automatically with kbcli cluster configure but kbcli cluster edit-config provides a visualized way for you to edit parameters directly.

KubeBlocks supports configuring cluster parameters by editing its configuration file.

  1. Get the configuration file of this cluster.

    kubectl edit configurations.apps.kubeblocks.io mycluster-mongodb -n demo
  2. Configure parameters according to your needs. The example below adds the spec.configFileParams part to configure systemLog.verbosity.

    spec:
    clusterRef: mycluster
    componentName: mongodb
    configItemDetails:
    - configFileParams:
    mongodb.cnf:
    parameters:
    systemLog.verbosity: "1"
    configSpec:
    constraintRef: mongodb-config-constraints
    name: mongodb-configuration
    namespace: kb-system
    templateRef: mongodb5.0-config-template
    volumeName: mongodb-config
    name: mongodb-config
    - configSpec:
    defaultMode: 292
  3. Connect to this cluster to verify whether the configuration takes effect as expected.

    kubectl exec -ti -n demo mycluster-mongodb-0 -- bash

    root@mycluster-mongodb-0:/# cat etc/mongodb/mongodb.conf |grep verbosity
    >
    verbosity: 1
note

Just in case you cannot find the configuration file of your cluster, you can switch to the kbcli tab to view the current configuration file of a cluster.