Configure Debug Bundle Management in Kubernetes
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 |
|
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 |
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.
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:
-
Operator
-
Helm
redpanda-cluster.yamlapiVersion: 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.yamlapiVersion: 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.yamlconfig:
cluster:
debug_bundle_auto_removal_seconds: <seconds>
For example, to retain debug bundles for 1 day:
cloud-storage.yamlconfig:
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
redpandauser within theredpandagroup.
To set this property, use the config.cluster.debug_bundle_storage_dir field:
-
Operator
-
Helm
redpanda-cluster.yamlapiVersion: 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
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
The same cluster properties as for a single Kubernetes 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.yamlapiVersion: 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.
Multicluster operator debug bundle
The 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
-
Redpanda Operator version 26.2.1 or later on every cluster.
-
rpkversion 26.2 or later with thek8splugin.rpkinstalls the plugin the first time you run anrpk k8scommand, or you can install it in advance withrpk 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
Set these flags when you run the command. There is no persistent configuration.
| Option | Default | Description |
|---|---|---|
|
off |
Keep |
|
|
Cap the operator log collected from each cluster, by bytes and by lines. Set |
|
|
Number of |
|
none |
Repeat the flag to name the clusters to bundle. You must pass |
|
|
The namespace that the Redpanda Operator runs in. |
|
|
Where to write the ZIP file. |
For the full flag list, see the command reference. To generate a bundle, see Generate a multicluster operator debug bundle.