KubeBlocks supports dynamic reconfiguration of ClickHouse server parameters. Changes are applied without restarting pods for parameters that support live reload.
kubectl v1.21+ installed and configured with cluster accessdemo namespace: kubectl create ns demoThe following example updates clickhouse.profiles.web.max_bytes_to_read, which limits the maximum bytes read per query for the web profile:
kubectl apply -f - <<EOF
apiVersion: operations.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: ch-reconfiguring
namespace: demo
spec:
clusterName: clickhouse-cluster
type: Reconfiguring
reconfigures:
- componentName: clickhouse
parameters:
- key: clickhouse.profiles.web.max_bytes_to_read
value: "200000000000"
EOF
Monitor progress:
kubectl get opsrequest ch-reconfiguring -n demo -w
NAME TYPE CLUSTER STATUS PROGRESS AGE
ch-reconfiguring Reconfiguring clickhouse-cluster Succeed -/- 10s
Verify the parameter was applied:
CH_POD=$(kubectl get pods -n demo -l app.kubernetes.io/instance=clickhouse-cluster \
-o jsonpath='{.items[0].metadata.name}')
kubectl exec -n demo $CH_POD -c clickhouse -- \
clickhouse-client --user admin --password password123 \
--query "SELECT name, value FROM system.settings WHERE name = 'max_bytes_to_read'"
max_bytes_to_read 200000000000
The following parameters cannot be changed via OpsRequest (they require a cluster rebuild):
clickhouse.http_portclickhouse.https_portclickhouse.tcp_portclickhouse.interserver_http_portclickhouse.listen_hostclickhouse.macrosclickhouse.loggerkubectl delete opsrequest ch-reconfiguring -n demo --ignore-not-found