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.

  1. If you’re scaling out:

    • Ensure that you have one additional worker node for each Redpanda broker that you want to add.

    • If you use local PersistentVolumes (PV), ensure that your additional worker nodes have a PV available.

  2. Update the number of replicas in the Helm chart:

    • Helm + Operator

    • Helm

    redpanda-cluster.yaml
    apiVersion: 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.yaml
    statefulset:
      replicas: <number-of-replicas>
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --values replicas.yaml --reuse-values
    helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
      --set statefulset.replicas=<number-of-replicas>
  3. Verify that your Redpanda cluster has the desired number of replicas:

    kubectl get statefulsets --namespace <namespace>