Initialize Cluster slot distribution
By default, the Operator allocates all 16,384 Cluster hash slots across the
configured shards. For a new Cluster, spec.replicas.shardsConfig can provide an
explicit initial slot plan.
This field is creation-only in the 2.0.0 implementation. The controller consumes
it only while the child Cluster has no initialized shard status. Changing
shardsConfig on an existing instance is not a supported redistribution
procedure; use shard scaling for operator-managed rebalancing.
Constraints
- Use this field only with
spec.arch: cluster. - The number of
shardsConfigentries must equalspec.replicas.shards. - At least three entries are required.
- Slot values must be integers from 0 through 16383, expressed as individual values or inclusive ranges separated by commas.
- The union of all entries must cover every slot exactly once. Gaps and overlaps are rejected by the validating webhook.
spec.replicas.replicasOfShardremains the total member count for each shard.
Create a Cluster with an explicit plan
The following manifest divides the slot space among three shards:
When the resource already exists, server-side dry-run exercises update behavior, not the create-only slot-plan validation. Validate the manifest before the first creation in a namespace where the name does not exist:
Verify the allocation
Wait for Ready, then compare the high-level node status with the server view:
Do not edit the operator-owned child Cluster.status.shards to repair a plan.
For a rejected create, correct the manifest and apply it again. For an already
initialized Cluster with an incorrect business layout, plan a supported shard
scaling operation or create a replacement instance and migrate data.
CLUSTER SHARDS is the preferred topology view for these supported server
lines. See its official command
reference and the Valkey Cluster
specification.