Configure Redpanda in Kubernetes

To configure the cluster and the Kubernetes components that the chart deploys, you can customize the values of the Redpanda Helm chart.

Helm does a three-way merge with the following:

  • Your overridden values

  • The values in the existing Helm release

  • The default values in the new Helm release (if you’re upgrading)

Find configuration options

To see what options you can override in the chart, use the helm show values command:

helm repo add redpanda https://charts.redpanda.com
helm repo update
helm show values redpanda/redpanda
bash

This command displays all the values, descriptions, and defaults, which are also documented in the Redpanda Helm Chart Specification.

Configure Redpanda

To customize the values of the Redpanda Helm chart, you can override the defaults in the Redpanda custom resource.

You must add all your overrides to the spec.clusterSpec configuration.

redpanda-cluster.yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec: {}
yaml

For example, to override the storage.persistentVolume.storageClass configuration:

redpanda-cluster.yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    storage:
      persistentVolume:
        storageClass: "<storage-class>"
yaml
kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
bash

The values in your Redpanda custom resource override their counterparts in the Helm chart’s values.yaml file. Any values that are not overridden maintain their defaults.

If you’re upgrading and you already have Redpanda Console installed, set console.enabled to false to stop Helm from trying to deploy it again.

Specify Redpanda CLI flags in the Helm Chart

The Redpanda Helm chart allows you to specify Redpanda CLI flags, such as --smp, --memory, or --reserve-memory, directly rather than having to find the appropriate configuration in the chart’s values.

When you specify CLI flags, those values take precedence over the values defined in the chart’s values.

redpanda-cluster.yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    statefulset:
      additionalRedpandaCmdFlags:
        - <flag>
yaml
kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
bash

Configure Redpanda Console

Redpanda Console is included as a subchart of the Redpanda Helm chart.

You can configure Redpanda Console in the console.config object using the Redpanda Console configuration values.

For example, to enable the admin API for Redpanda Console:

redpanda-cluster.yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    console:
      enabled: true
      console:
        config:
          redpanda:
            adminApi:
              enabled: true
              urls:
              - http://redpanda-0.redpanda.<namespace>.svc.cluster.local.:9644
yaml
kubectl apply -f redpanda-cluster.yaml --namespace <namespace>
bash

If you want to use the separate Redpanda Console Helm chart, disable Redpanda Console in the Redpanda Helm chart with console.enabled=false. To see what options you can override in the Redpanda Console chart, use the helm show values command:

helm repo add redpanda https://charts.redpanda.com
helm repo update
helm show values redpanda/console
bash

For default values and documentation for configuration options, see the values.yaml file.

Differences between helm install and helm upgrade

When managing Redpanda deployments with Helm, it’s important to understand the differences between helm install and helm upgrade, particularly in how they handle cluster configuration overrides.

Use helm install to install or reinstall Redpanda. Use helm upgrade to reconfigure an existing deployment.

Reinstall Redpanda

When reinstalling Redpanda with helm install, cluster configuration overrides specified in the Helm values may not take effect due to PersistentVolumeClaim (PVC) retention.

By default, most PVCs are retained when a Helm release is uninstalled. As a result, when Redpanda is reinstalled, the previously created PVCs are adopted, restoring the state of the previous cluster. This adoption results in the new bootstrap.yaml file being ignored and the post_upgrade job not running. The post_upgrade job is a component in the Helm chart that applies configuration overrides during an upgrade.

To ensure the new installation does not adopt the old PVCs and restore the previous state:

  1. Delete the existing PVCs before reinstalling Redpanda:

    kubectl delete pvc -l app=redpanda --namespace <namespace>
    bash
  2. Execute the helm install command to reinstall Redpanda with a clean state.

Configure an existing cluster

During a helm upgrade, the post_upgrade job is triggered, which applies the latest overrides to the cluster.