Skip to main content
Version: release-0.9

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 also supports configuring a cluster by editing the configuration file or applying an OpsRequest.

KubeBlocks supports configuring cluster parameters by editing its configuration file.

  1. Get the configuration file of this cluster.

    kubectl get configurations.apps.kubeblocks.io -n demo

    kubectl edit configurations.apps.kubeblocks.io mycluster-kafka-combine -n demo
  2. Configure parameters according to your needs. The example below adds the spec.configFileParams part to configure log.cleanup.policy.

    spec:
    clusterRef: mycluster
    componentName: kafka
    configItemDetails:
    - configFileParams:
    server.properties:
    parameters:
    log.cleanup.policy: "compact"
    configSpec:
    constraintRef: kafka-cc
    name: kafka-configuration-tpl
    namespace: kb-system
    templateRef: kafka-configuration-tpl
    volumeName: kafka-config
    name: kafka-configuration-tpl
  3. Connect to this cluster to verify whether the configuration takes effect as expected.

    kbcli cluster describe-config mycluster -n demo --show-detail | grep log.cleanup.policy
    >
    log.cleanup.policy = compact
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.