Skip to main content

Horizontal scale

  1. Open Deployments.
  2. Open the target deployment.
  3. Select Scale from the deployment header.
  4. Adjust replicas.
  5. For sharded deployments, adjust shard count if needed.
  6. For Sentinel-enabled replicated deployments, adjust Sentinel nodes if needed.
  7. Select Apply Scale.
The UI creates one or more KubeBlocks horizontal scaling OpsRequests through the Admin Server:
  • Component falkordb for standalone or replicated FalkorDB replicas.
  • Component falkordb-sent for Sentinel replicas.
  • Component shard for sharded deployments.

Horizontal scale constraints

  • Standalone minimum: 1 replica.
  • Replication and sharded minimum: 2 replicas.
  • UI replica maximum: 10.
  • Sharded deployments have minimum 3 shards.
  • Sentinel nodes must be odd and at least 3.

Rebalance a sharded deployment

A sharded deployment splits its data into 16,384 hash slots spread across its shards. Changing the shard count moves slots on its own:
  • Each new shard takes its share of slots from the existing shards as soon as it joins.
  • A shard you remove hands its slots to the shards that remain, which leaves them evenly balanced.
Adding shards moves slots only into the new shards, so the existing shards can end up with uneven shares. An interrupted scale-out can also leave the spread wherever it stopped. A rebalance gives every shard an even share of the slots.
1

Open the deployment

Open Deployments, then open the sharded deployment.
2

Start the rebalance

Select Rebalance from the deployment header, then confirm.
3

Follow it

The rebalance appears on the Operations tab as Rebalance. It’s finished when its phase is Succeed.
From the Admin CLI or the API:
The rebalance runs redis-cli --cluster rebalance once, against one of the deployment’s shard pods, over TLS when the deployment uses TLS. It leaves the spread alone when every shard is within 2% of an even share. A shard with no slots, such as one whose scale-out was interrupted, gets its share too. Slots and their keys move between shards while the deployment keeps serving clients, which adds load until the rebalance finishes. While it runs, the deployment’s status.pendingChanges lists it with type: Rebalance. The Admin Server refuses a rebalance in these cases: While a rebalance runs, the Admin Server also refuses to change the shard count, with 409.

Move slots between shards

To decide yourself which shard serves which slots, move them by hand. A sharded deployment has a Slots tab that shows which slots each shard owns, and moves slots to one of them.
1

Open the Slots tab

Open the sharded deployment, then select Slots.
2

Choose the slots and the shards

In Move slots, enter the slots as single slots and ranges separated by commas, such as 0-999,5000. Choose the shard to move them To. Optionally choose the shard they must come From: the move is then refused unless that shard owns every slot that the target doesn’t already own. Below the form, the tab says how many slots will move and from which shards, or why the move would be refused.
3

Move them

Select Move slots, then confirm. The move appears on the Operations tab as Move slots.
From the Admin CLI or the API:
Shards are named shard-<id>, as the Slots and Pods tabs show them. The move resolves each shard to whichever node is its primary when it runs, and leaves alone the slots the target shard already owns. Slots move with their keys while the deployment keeps serving clients. If a move fails part way, it doesn’t retry: repair the open slots with redis-cli --cluster fix before you move slots again.

How the slot map is read

The Admin Server doesn’t connect to the database to read the slot map. To read which shard owns which slots, it runs a short read-only Job in the deployment’s namespace, on the deployment’s own FalkorDB image. The Job asks each pod CLUSTER MYID and reads CLUSTER NODES and CLUSTER INFO, then the Admin Server deletes it. The Job:
  • reads the password from the deployment’s own credentials Secret, so the password never passes through the Admin Server;
  • connects with TLS when the deployment uses it;
  • runs as user 65532, with a read-only root filesystem, no service account token and the chart’s image pull secrets;
  • has 60 seconds to finish and isn’t retried.
A read takes a few seconds. The Admin Server reuses a read for 10 seconds, and GET /api/clusters/{name}/slots?namespace=… returns it.

Checks before a move starts

The Admin Server reads the slot map again before it submits a move, and refuses the move instead of letting it fail part way: While a move runs, the Admin Server refuses a rebalance, another move or a shard-count change, with 409.

Vertical scale CPU and memory

  1. Open the target deployment.
  2. Select Edit.
  3. Choose Resources.
  4. Enter CPU and memory requests and/or limits.
  5. Select Apply Resources.
This creates a KubeBlocks vertical scaling OpsRequest. A rolling restart can occur.

Scale memory automatically

A deployment can scale itself when its memory stays high. The policy is saved on the deployment’s Cluster, and every change goes through the same scaling operations as a manual one, so license quota checks and the audit log apply.
  • Scale up. When the busiest data pod stays above the threshold (memory used / memory limit) for the sustained period, the memory request and limit grow by the step, up to maxMemoryPerPod. Automatic scaling leaves the CPU request and limit as they are.
  • Scale out. On a sharded deployment with scaleOut enabled, once pods have reached maxMemoryPerPod and memory is still above the threshold, shards are added up to maxShards. Slots move on their own; run a rebalance afterwards if you want an even spread.
  • Never scales down.
  • Needs a persistent volume to scale up automatically. A larger memory limit restarts the pods, and a pod without a volume comes back empty. A deployment with persistence turned off can’t be saved in auto mode, and one that already has such a policy is only given a recommendation. Raise its memory limit by hand, or enable persistence first.
  • Adding a shard needs several graphs to spread. A graph is a single key and lives on one shard, so a new shard only relieves a pod by taking its other graphs. Before adding one, automatic scaling reads the graphs of every pod and holds back when a pod over the threshold has a single graph, when one graph holds more than half of its memory, or when the largest graph on a pod is bigger than about two thirds of that pod’s spare memory (moving it needs room for a copy). The status says which, and the answer is to raise maxMemoryPerPod. If the graphs can’t be read, no shard is added.
  • Waits while any operation is running on the deployment, while the deployment isn’t Running, and for a waiting period after the last scaling operation.
  • Recommend mode (the default) records what it would do in the audit log and changes nothing. The status shows the last decision. If a change is refused, for example because the license quota can’t fit it, the refusal is recorded and shown as a recommendation.
With set, each flag changes only the setting it names in the policy the deployment has now; --max-memory-per-pod is needed the first time. The waiting period counts from the end of the last scaling operation, which is also recorded on the deployment, so deleting that operation from the Operations tab doesn’t shorten it. In the UI, open the deployment and select Scaling under Management.
The Scaling tab of falkordb-graph with automatic mode on, an 80 percent threshold, a 16Gi ceiling and shard scale-out up to 8 shards, above a Last check card showing a scale up to 3072Mi at 91 percent memory

A sharded deployment with an automatic policy saved, and the result of the last check.

The same policy is available at GET, PUT and DELETE /api/clusters/{clusterName}/autoscaling. The defaults are a threshold of 80%, 5 minutes sustained, a 30 minute waiting period and a step of 50%.

Expand storage

  1. Open the target deployment.
  2. Select Edit.
  3. Choose Storage.
  4. Enter a larger storage size, for example 50Gi.
  5. Select Expand Storage.
Storage expansion is irreversible and the StorageClass must support volume expansion.

Validate

In the Admin UI, review Operations, Pods, and Metrics.

Failover status

Automatic or manual switchover is not wired to a backend operation in the current Admin UI. The Pods tab currently shows a confirmation dialog and success toast, but it does not submit a KubeBlocks switchover operation. Use your Kubernetes/KubeBlocks procedure for failover until this path is implemented.