Scale Redpanda in Kubernetes
Scaling a Redpanda cluster involves increasing its resources and/or the number of nodes to handle more data, traffic, and users. You can scale a Redpanda cluster both vertically and horizontally, depending on your requirements.
Vertical Scaling
Vertical (also known as scaling up/down) scaling means increasing the resources, such as CPU cores, memory, and storage, of existing brokers in the cluster.
To scale vertically, see Manage Pod Resources in Kubernetes.
| You cannot decrease the number of CPU cores in a running cluster. |
Horizontal Scaling
Horizontal scaling (also known as scaling out/in) means adding more brokers to the cluster, thereby distributing the load and data across different worker nodes.
-
If you’re scaling out, make sure that you have one additional worker node for each Redpanda broker that you want to add.
-
Update the number of replicas in the Helm chart:
-
Helm + Operator
-
Helm
redpanda-cluster.yamlapiVersion: cluster.redpanda.com/v1alpha1 kind: Redpanda metadata: name: redpanda spec: chartRef: {} clusterSpec: statefulset: replicas: <number-of-replicas>kubectl apply -f redpanda-cluster.yaml --namespace <namespace>-
--values
-
--set
replicas.yamlstatefulset: replicas: <number-of-replicas>helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \ --values replicas.yaml --reuse-valueshelm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \ --set statefulset.replicas=<number-of-replicas> -
-
Verify that your Redpanda cluster has the desired number of replicas:
kubectl get statefulsets --namespace <namespace>