# Configure Debug Bundle Management in Kubernetes

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [streaming-full.txt](https://docs.redpanda.com/streaming-full.txt)

---
title: Configure Debug Bundle Management in Kubernetes
latest-redpanda-tag: v26.2.6
latest-console-tag: v3.14.0
latest-operator-version: v26.2.5
# EOL = End-of-Life (support lifecycle status)
page-is-nearing-eol: "false"
page-is-past-eol: "false"
page-eol-date: July 28, 2027
latest-connect-version: 4.117.0
docname: debug-bundle/configure/kubernetes
page-component-name: streaming
page-version: "26.2"
page-component-version: "26.2"
page-component-title: Streaming
page-relative-src-path: debug-bundle/configure/kubernetes.adoc
page-edit-url: https://github.com/redpanda-data/docs/edit/main/modules/troubleshoot/pages/debug-bundle/configure/kubernetes.adoc
description: Configure debug bundle retention for Redpanda brokers in Kubernetes, and the capture options for the multicluster operator debug bundle.
page-git-created-date: "2024-12-16"
page-git-modified-date: "2026-10-08"
page-generated-content: none
support-status: supported
---

<!-- Source: https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/configure/kubernetes.md -->

Configure debug bundle retention for Redpanda brokers in Kubernetes, and the capture options for the multicluster operator debug bundle.

Which settings apply depends on how Redpanda is deployed:

| Deployment | Debug bundle | What you configure |
| --- | --- | --- |
| Single Kubernetes cluster (Redpanda Operator or Helm chart) | Redpanda debug bundle, collected from the brokers | config.cluster.debug_bundle_auto_removal_seconds on the Redpanda resource or in Helm values. See Single Kubernetes cluster. |
| Stretch Cluster across several Kubernetes clusters | Both: the Redpanda debug bundle from the brokers, and the multicluster operator debug bundle from the operators | The same config.cluster.debug_bundle_auto_removal_seconds for the broker bundle, set on the StretchCluster resource. Nothing on the cluster for the operator bundle: it is written to your machine and controlled by rpk k8s multicluster bundle flags. See Stretch Cluster. |

## [](#single-cluster)Single Kubernetes cluster

In a single-cluster deployment, the only debug bundle is the one collected from the Redpanda brokers. Set its retention and storage properties on the Redpanda resource or in Helm values.

> 📝 **NOTE**
>
> 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.

### [](#remove)Automatically remove debug bundles

To avoid manually deleting debug bundles, you can configure the [`debug_bundle_auto_removal_seconds`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#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.

> 📝 **NOTE**
>
> 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:

#### Operator

`redpanda-cluster.yaml`

```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`

```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:

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

#### Helm

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

`cloud-storage.yaml`

```yaml
config:
  cluster:
    debug_bundle_auto_removal_seconds: <seconds>
```

For example, to retain debug bundles for 1 day:

`cloud-storage.yaml`

```yaml
config:
  cluster:
    debug_bundle_auto_removal_seconds: 86400
```

Apply the changes with:

```bash
helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --values cloud-storage.yaml --reuse-values
```

##### --set

```bash
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:

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

### [](#save)Choose where the debug bundle is saved

The [`debug_bundle_storage_dir`](https://docs.redpanda.com/streaming/current/reference/properties/cluster-properties/#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:

#### Operator

`redpanda-cluster.yaml`

```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:

```yaml
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:

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

#### Helm

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

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

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

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

Apply the changes with:

```bash
helm upgrade --install redpanda redpanda/redpanda --namespace <namespace> --create-namespace \
  --values values.yaml --reuse-values
```

##### --set

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

For example:

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

## [](#stretch-cluster)Stretch Cluster

A Stretch Cluster has two debug bundles: the Redpanda debug bundle from the brokers, which you configure on the StretchCluster resource, and the multicluster operator debug bundle, which has no cluster-side configuration.

### [](#redpanda-debug-bundle)Redpanda debug bundle

The same cluster properties as for a [single Kubernetes cluster](#single-cluster) apply, including `debug_bundle_auto_removal_seconds` and `debug_bundle_storage_dir`. Set them under `spec.config.cluster` on the StretchCluster resource, which has no `clusterSpec` level. For example, to retain debug bundles for 1 day:

`stretch-cluster.yaml`

```yaml
apiVersion: cluster.redpanda.com/v1alpha2
kind: StretchCluster
metadata:
  name: redpanda
spec:
  config:
    cluster:
      debug_bundle_auto_removal_seconds: 86400
```

Apply the same StretchCluster manifest to every Kubernetes cluster, as described in [Deploy a Stretch Cluster on Kubernetes](https://docs.redpanda.com/streaming/current/deploy/redpanda/kubernetes/k-stretch-clusters/).

### [](#multicluster-debug-bundle)Multicluster operator debug bundle

The [`rpk k8s multicluster bundle`](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-k8s/rpk-k8s-multicluster-bundle/) command collects the operator Pod and Deployment, logs, `/metrics` samples, Raft status, and TLS material from every Kubernetes cluster in a Stretch Cluster, and writes one ZIP file to your local machine. The Redpanda brokers are not involved, so the `debug_bundle_auto_removal_seconds` property and the storage settings above don’t apply. Delete the ZIP file yourself when you no longer need it.

#### [](#prerequisites)Prerequisites

-   Redpanda Operator version 26.2.1 or later on every cluster.

-   [`rpk`](https://docs.redpanda.com/streaming/current/reference/rpk/) version 26.2 or later with the [`k8s` plugin](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-k8s/rpk-k8s/). `rpk` installs the plugin the first time you run an `rpk k8s` command, or you can install it in advance with `rpk k8s install`.

-   A kubeconfig for at least one of the Stretch Cluster’s Kubernetes clusters. The command discovers the other clusters from the kubeconfig cache Secrets that the operator keeps in its namespace.


#### [](#capture-options)Capture options

Set these flags when you run the command. There is no persistent configuration.

| Option | Default | Description |
| --- | --- | --- |
| --include-private-keys | off | Keep tls.key and the cached peer kubeconfig.yaml payloads in the serialized Secrets. By default both are redacted. Leave this off unless Redpanda Support asks for the keys. |
| --logs-size-limit, --logs-tail-lines | 5M, 5000 | Cap the operator log collected from each cluster, by bytes and by lines. Set --logs-size-limit to 0 or --logs-tail-lines to -1 to remove that cap. Use --skip-logs to collect no logs. |
| --metrics-samples, --metrics-interval | 2, 10s | Number of /metrics scrapes per cluster, minimum 2, and the interval between them. Two or more samples let Redpanda Support compute counter rates, such as Raft leader changes, without a live Prometheus. Use --skip-metrics to collect no metrics. |
| --context | none | Repeat the flag to name the clusters to bundle. You must pass --context, --kubeconfig, or both. If you pass only --kubeconfig, every context in that file is used. Discovery runs only when exactly one context is selected. With more than one, the command skips discovery and bundles exactly those clusters, which is useful when the cached peer kubeconfigs aren’t reachable from your machine. |
| --namespace | redpanda | The namespace that the Redpanda Operator runs in. |
| -o, --output | ./operator-bundle-<timestamp>.zip | Where to write the ZIP file. |

For the full flag list, see the [command reference](https://docs.redpanda.com/streaming/current/reference/rpk/rpk-k8s/rpk-k8s-multicluster-bundle/). To generate a bundle, see [Generate a multicluster operator debug bundle](https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/generate/kubernetes/#multicluster-debug-bundle).

## [](#next-steps)Next steps

-   [Generate a debug bundle in Kubernetes](https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/generate/kubernetes/)

-   [Inspect a debug bundle](https://docs.redpanda.com/streaming/current/troubleshoot/debug-bundle/inspect/)