Configure Debug Bundle Management in Kubernetes

Learn how to configure debug bundle retention and storage in Kubernetes environments.

These configuration options apply only when you trigger a debug bundle remotely. For example using Redpanda Console, rpk debug remote-bundle, or the Admin API. They do not apply to the rpk debug bundle command.

Automatically remove debug bundles

To avoid manually deleting debug bundles, you can configure the debug_bundle_auto_removal_seconds property. This cluster configuration property automatically deletes debug bundles after the specified number of seconds. By default, this property is not set, meaning debug bundles are retained indefinitely.

Only one debug bundle can exist at a time. If you generate a new debug bundle, any existing bundle from a previous run will be automatically deleted.

Changes to this property take effect immediately and do not require a cluster restart.

To set this property, use the config.cluster.debug_bundle_auto_removal_seconds field:

  • Helm + Operator

  • Helm

redpanda-cluster.yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    config:
      cluster:
        debug_bundle_auto_removal_seconds: <seconds>

For example, to retain debug bundles for 1 day:

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

Apply the changes with:

kubectl apply -f redpanda-cluster.yaml --namespace <namespace>

Update the values.yaml file or use the --set flag to specify the property:

  • --values

  • --set

cloud-storage.yaml
config:
  cluster:
    debug_bundle_auto_removal_seconds: <seconds>

For example, to retain debug bundles for 1 day:

cloud-storage.yaml
config:
  cluster:
    debug_bundle_auto_removal_seconds: 86400

Apply the changes with:

helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --values cloud-storage.yaml --reuse-values
helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --set config.cluster.debug_bundle_auto_removal_seconds=<seconds>

For example, to retain debug bundles for 1 day:

helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --set config.cluster.debug_bundle_auto_removal_seconds=86400

Choose where the debug bundle is saved

The debug_bundle_storage_dir property allows you to specify a custom directory for storing debug bundles on the broker. By default, debug bundles are stored in the Redpanda data directory. Configuring a custom storage directory can help manage storage capacity and isolate debug data from operational data.

Changes to this property take effect immediately and do not require a cluster restart.

Before you change this property:

  • Ensure that your chosen directory has sufficient storage capacity to handle debug bundles.

    Factors such as the volume of logs can increase the bundle size. While it is difficult to define an exact storage requirement due to variability in bundle size, 200 MB should be sufficient for most cases.

  • Verify the directory’s permissions to ensure Redpanda can write to it. By default, Redpanda operates as the redpanda user within the redpanda group.

To set this property, use the config.cluster.debug_bundle_storage_dir field:

  • Helm + Operator

  • Helm

redpanda-cluster.yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    config:
      cluster:
        debug_bundle_storage_dir: <path-to-directory>

For example:

apiVersion: cluster.redpanda.com/v1alpha2
kind: Redpanda
metadata:
  name: redpanda
spec:
  chartRef: {}
  clusterSpec:
    config:
      cluster:
        debug_bundle_storage_dir: /var/log/redpanda/debug_bundles

Apply the changes with:

kubectl apply -f redpanda-cluster.yaml --namespace <namespace>

Update the values.yaml file or use the --set flag to specify the property:

  • --values

  • --set

config:
  cluster:
    debug_bundle_storage_dir: <path-to-directory>

For example, to store debug bundles in /var/log/redpanda/debug_bundles:

config:
  cluster:
    debug_bundle_storage_dir: /var/log/redpanda/debug_bundles

Apply the changes with:

helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --values values.yaml --reuse-values
helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --set config.cluster.debug_bundle_storage_dir=<path-to-directory>

For example:

helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --set config.cluster.debug_bundle_storage_dir=/var/log/redpanda/debug_bundles