Delete old support bundles

KOTS Admin Console stores application support bundles in two locations: metadata in Kubernetes Secrets and the bundle archives in object storage (such as MinIO). As your system accumulates support bundles over time, this can lead to:

  • Performance degradation
  • Potential out-of-memory (OOM) events
  • Disk space shortages

While the Admin Console UI provides a way to remove old support bundles, performance issues may make this approach impractical when there are too many bundles. This guide presents alternative command-line methods using kubectl to efficiently manage and remove support bundles.

:warning: Warning: The following operations manipulate internal KOTS data structures. These procedures may change without notice in future KOTS releases. Download any required support bundles before proceeding.

Prerequisites

  • kubectl access to your Kubernetes cluster
  • Proper permissions to execute commands in the KOTS namespace

Step 1 : Delete all support bundle metadata from Kubernetes Secrets

export NAMESPACE=<namespace>
kubectl get secrets -n $NAMESPACE --no-headers=true | grep "^supportbundle" | awk '{print $1}' | xargs kubectl delete secret

Step 2: Delete support bundle archives from KOTS object storage (when Minio is used)

# exec into minio pod
kubectl exec -it sts/kotsadm-minio -n <namespace> -- sh
mc alias set myminio http://localhost:9000 $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
# list all support bundle archives
 mc ls --summarize --recursive myminio/kotsadm/supportbundles

e.g.
[2025-05-05 23:52:03 UTC] 1.4KiB STANDARD 2whlz1oeebtpazvjwbiyggp3sf0/redactions.gz
[2025-05-05 23:52:03 UTC] 131KiB STANDARD 2whlz1oeebtpazvjwbiyggp3sf0/supportbundle.tar.gz
[2025-05-05 23:52:03 UTC] 1.7KiB STANDARD 2whlz1oeebtpazvjwbiyggp3sf0/treeindex.gz
[2025-05-06 00:00:17 UTC] 1.5KiB STANDARD 2whmz3ghm3yq4izcwnqit7ijxlk/redactions.gz
[2025-05-06 00:00:17 UTC] 130KiB STANDARD 2whmz3ghm3yq4izcwnqit7ijxlk/supportbundle.tar.gz
[2025-05-06 00:00:17 UTC] 1.7KiB STANDARD 2whmz3ghm3yq4izcwnqit7ijxlk/treeindex.gz
[2025-05-06 00:01:32 UTC] 1.4KiB STANDARD 2whn8unuugrvj6kk1vs3qsmpwsu/redactions.gz
[2025-05-06 00:01:32 UTC] 130KiB STANDARD 2whn8unuugrvj6kk1vs3qsmpwsu/supportbundle.tar.gz
[2025-05-06 00:01:32 UTC] 1.7KiB STANDARD 2whn8unuugrvj6kk1vs3qsmpwsu/treeindex.gz
[2025-05-06 00:01:43 UTC] 1.5KiB STANDARD 2whn9xboeoukze2hdkegqkheppz/redactions.gz
[2025-05-06 00:01:43 UTC] 129KiB STANDARD 2whn9xboeoukze2hdkegqkheppz/supportbundle.tar.gz
[2025-05-06 00:01:43 UTC] 1.7KiB STANDARD 2whn9xboeoukze2hdkegqkheppz/treeindex.gz

Total Size: 533 KiB
Total Objects: 12
# delete all support bundle archives with dry-run
mc rm --recursive --force --dry-run myminio/kotsadm/supportbundles/

# delete all support bundle archives
mc rm --recursive --force myminio/kotsadm/supportbundles/

# delete support bundle archives by date filter
mc rm --recursive --force myminio/kotsadm/supportbundles/ --older-than 7d10h31s

Verifying Changes

After completing these steps, verify that:

  1. The KOTS Admin Console still functions properly
  2. Your application can still be managed normally
  3. Disk space has been reclaimed

In step 2:

How/where do I get the $MINIO_* values?

Hi @rcanitrs,

The MINIO* environment variables are populated in statefulset sts/kotsadm-minio

I hope this helps.

Gerard

Thanks a lot @GerardNguyen, that helped.
One more question though: do we expect the timestamps of the output of mc ls --summarize --recursive myminio/kotsadm/supportbundles to match 1:1 to the support bundle on the admin console or the file name of the tar.gz? I see some variance, though it could just be that the file is named based on start time but the entry in Minio is based on completed time.

i.e.,

Actual files

supportbundle-2025-07-08T11_44_13.tar.gz
supportbundle-2025-07-08T13_16_26.tar.gz
supportbundle-2025-07-08T13_16_32.tar.gz

Minio

/ $ mc ls --summarize --recursive myminio/kotsadm/supportbundles | grep supportbundle
[2025-07-08 11:50:44 UTC] 828KiB STANDARD 2zahnoyt8hmkvfveteuzbgwjjo8/supportbundle.tar.gz
[2025-07-08 13:22:52 UTC] 820KiB STANDARD 2zasb7ry9beqncjjj04nvhtit1n/supportbundle.tar.gz
[2025-07-08 13:17:33 UTC] 823KiB STANDARD 2zasbtkme8pcudkq3nvk69uliv4/supportbundle.tar.gz

It will not be 1:1 match, you are correct that the timestamp in the support bundle filename is the start time of the collection while timestamp in Minio is when the bundle uploaded successfully.

1 Like