skills/kubeblocks-reconfigure-parameters/SKILL.md
Modify database configuration parameters for KubeBlocks clusters via OpsRequest. Supports dynamic parameters (applied without restart) and static parameters (require pod restart). Use when the user wants to change, tune, modify, optimize, or adjust database settings, config, or parameters (e.g. max_connections, innodb_buffer_pool_size, shared_buffers). NOT for changing cluster resource limits (see vertical-scaling) or managing database user accounts (see manage-accounts).
npx skillsauth add apecloud/kubeblocks-skills kubeblocks-reconfigure-parametersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
KubeBlocks allows modifying database configuration parameters through the OpsRequest CR with type: Reconfiguring. Parameters are categorized as:
max_connections for MySQL)innodb_buffer_pool_size for MySQL)KubeBlocks automatically determines whether a restart is needed based on the parameter type.
Official docs: https://kubeblocks.io/docs/preview/user_docs/kubeblocks-for-mysql/configuration/configure-cluster-parameters
Before proceeding, verify the cluster is healthy and no other operation is running:
# Cluster must be Running
kubectl get cluster <cluster-name> -n <namespace> -o jsonpath='{.status.phase}'
# No pending OpsRequests
kubectl get opsrequest -n <namespace> -l app.kubernetes.io/instance=<cluster-name> --field-selector=status.phase!=Succeed
If the cluster is not Running or has a pending OpsRequest, wait for it to complete before proceeding.
Check current parameter values via the relevant ConfigMap:
kubectl get configmap -n <namespace> -l app.kubernetes.io/instance=<cluster-name>
- [ ] Step 1: Identify the parameter to change
- [ ] Step 2: Create Reconfiguring OpsRequest
- [ ] Step 3: Verify the change
Check current configuration values:
# List config templates for the cluster
kubectl get configurations -n <ns> -l app.kubernetes.io/instance=<cluster>
For a reference of common parameters per addon, see reference.md.
apiVersion: operations.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: <cluster>-reconfigure
namespace: <ns>
spec:
clusterName: <cluster>
type: Reconfiguring
reconfigures:
- componentName: <component>
parameters:
- key: max_connections
value: "500"
apiVersion: operations.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: <cluster>-reconfigure
namespace: <ns>
spec:
clusterName: <cluster>
type: Reconfiguring
reconfigures:
- componentName: <component>
parameters:
- key: max_connections
value: "500"
- key: innodb_buffer_pool_size
value: "2147483648"
Before applying, validate with dry-run:
kubectl apply -f reconfigure-ops.yaml --dry-run=server
If dry-run reports errors, fix the YAML before proceeding.
Apply it:
kubectl apply -f reconfigure-ops.yaml
kubectl get ops <cluster>-reconfigure -n <ns> -w
Success condition:
.status.phase=Succeed| Typical: 2-8min | If stuck >15min:kubectl describe ops <cluster>-reconfigure -n <ns>
Status progression:
Pending → Running → Succeed (dynamic parameters)Pending → Running → Restarting → Succeed (static parameters, triggers rolling restart)Connect to the database and check:
# MySQL
kubectl exec -it <pod> -n <ns> -- mysql -u root -p -e "SHOW VARIABLES LIKE 'max_connections';"
# PostgreSQL
kubectl exec -it <pod> -n <ns> -- psql -U postgres -c "SHOW max_connections;"
# Redis
kubectl exec -it <pod> -n <ns> -- redis-cli CONFIG GET maxmemory
| Behavior | Dynamic | Static | |----------|---------|--------| | Restart required | No | Yes (rolling restart) | | Downtime | None | Brief per-pod during rolling restart | | Effect | Immediate | After pod restart |
KubeBlocks handles the restart automatically for static parameters. Secondary pods restart first, then a switchover occurs, and the original primary restarts last — minimizing downtime.
OpsRequest fails with validation error:
kubectl get cluster <cluster> -n <ns> -o jsonpath='{.spec.componentSpecs[*].name}'Rolling restart takes too long:
kubectl get pods -n <ns> -l app.kubernetes.io/instance=<cluster> -wFor a list of common tunable parameters per database addon, see reference.md.
For general agent safety conventions (dry-run, status confirmation, production protection), see safety-patterns.md.
devops
Expand persistent volume storage for KubeBlocks database clusters via OpsRequest. Requires the StorageClass to support volume expansion (allowVolumeExpansion=true). Use when the user needs more disk space, wants to increase storage, expand volumes, or resize PVCs. NOT for changing CPU/memory (see vertical-scaling) or adding more replicas (see horizontal-scaling). Note that volume shrinking is not supported by Kubernetes.
data-ai
Scale CPU and memory resources for KubeBlocks database clusters via OpsRequest (vertical scaling). Supports in-place updates when the feature gate is enabled. Use when the user wants to change, increase, decrease, resize, or adjust CPU or memory resources of a database cluster. NOT for adding/removing replicas or shards (see horizontal-scaling) or expanding disk storage (see volume-expansion).
data-ai
Upgrade the KubeBlocks operator itself via Helm. Covers update operator, upgrade to v1.0, update kubeblocks version, and CRD updates. Use when the user wants to upgrade KubeBlocks, update the operator, or upgrade to a new KubeBlocks release. NOT for upgrading database engine versions (see minor-version-upgrade).
development
Diagnostic guide for KubeBlocks-managed database clusters. Use when the user reports troubleshoot, debug, diagnose, not working, error, failed, stuck, CrashLoopBackOff, cluster exception, or similar problems with their database cluster. This skill guides the agent through diagnostic steps — it does NOT perform actions.