Backup, recovery, and support operations
The backup, recovery, and support system protects the state of a KOTS installation and its applications. It preserves cluster resources and application data in snapshots, restores selected parts of an environment after a failure, and collects diagnostic bundles for support work.
Operational resilience model
The system treats resilience as three related operations: save state, restore state, and explain state. Snapshot services protect running environments. Recovery services rebuild the Admin Console and applications from a completed snapshot. Support services collect cluster evidence and make it available for review or sharing.
Backup scope
Backups cover either one deployed application or the KOTS instance as a whole. An application backup follows the application's deployed version and declared backup scope. An instance backup preserves the Admin Console, installed applications, and the cluster resources needed to bring the installation back.
The system records whether a backup was started by an operator or by a schedule. It also reports progress, completion, expiry, included applications, and volume transfer results so an engineer can judge whether the saved state is usable.
References: pkg/…/backup.go• L50-201 pkg/…/backup.go• L226-285 pkg/…/backup.go• L708-810
Snapshot storage
Snapshots need a Velero backup storage location that can be checked before use. The system can connect that location to supported cloud object stores, S3-compatible storage, internal cluster storage, or a filesystem-backed destination when the cluster supports it.
Storage configuration is validated before it becomes active. The system also exposes the health of the snapshot service and its node agents, because a valid destination is not enough if the snapshot workers are not ready.
References: pkg/…/store.go• L62-169 pkg/…/store.go• L420-588 pkg/…/velero.go• L267-352
Snapshot scheduling
Schedules create future application or instance snapshots from a cron expression. Enabling a schedule stores the expression and queues its next run. Disabling or changing a schedule removes pending work so an old schedule does not create unexpected snapshots.
Retention is separate from scheduling. A retention period becomes the snapshot time-to-live, which allows the backup system to remove saved state after the configured period.
References: pkg/…/snapshots.go• L561-699 pkg/…/snapshots.go• L701-906 pkg/…/backup.go• L145-188
Recovery scope
Recovery can rebuild the Admin Console, restore applications, or perform both actions. The Admin Console must be restored before applications when both are selected, because it provides the service that coordinates application recovery. Application recovery can then run in the background or wait until all applications finish.
The recovery path accepts only a completed and supported instance backup. It reports failures and warnings from both the cluster restore and the application restore so an operator can distinguish a finished recovery from a recovery that only started.
References: pkg/…/restore.go• L28-98 pkg/…/restore.go• L105-252 pkg/…/restore.go• L27-135 pkg/…/restore.go• L174-243
Disaster recovery context
Disaster recovery depends on preserving the resources that identify application and platform state. Backup metadata carries the application versions and deployment context needed to relate a saved snapshot to the environment that created it. Application resources receive the backup identity needed for later selection and recovery.
The system also carries embedded-cluster context when that mode is in use. This lets an instance backup represent more than application data when the target environment must be rebuilt after a major outage.
References: pkg/…/backup.go• L312-425 pkg/…/backup.go• L428-511 pkg/…/disasterrecovery.go• L23-117
Support diagnostics
Support bundles are diagnostic records tied to an application. A collection starts with the active application version and its diagnostic rules, gathers cluster data, tracks progress, and stores an archive with analysis that the Admin Console can show to an operator.
Support bundle lifecycle
When an operator requests a bundle, the system creates a running record and returns its identifier without waiting for collection to finish. The collection process updates progress and changes the record to uploaded or failed. Engineers can then inspect the bundle, read selected files, view analysis, download the archive, or remove the record.
The system supports bundles collected by the Admin Console and bundles uploaded by the kubectl support-bundle command. It can use analysis already present in a new bundle or analyze older bundles with the application’s diagnostic rules.
References: pkg/…/supportbundle.go• L35-89 pkg/…/supportbundle.go• L230-353 pkg/…/troubleshoot.go• L103-215 pkg/…/troubleshoot.go• L440-508
Diagnostic specification assembly
Support collection combines vendor rules, cluster-specific rules, and default rules into one application-specific diagnostic plan. The plan can add rules discovered from labeled cluster resources, adapts its namespace scope to the available access, and removes duplicate collectors and analyzers before collection.
Each plan is stored as a namespaced Secret. Legacy support-bundle specification ConfigMaps are removed during this refresh, while unrelated ConfigMaps and existing Secrets remain available for discovery. If one discovered plan is invalid, the system skips that plan and continues with valid plans.
The assembled plan also adds built-in evidence about the Admin Console, installed applications, snapshot service, and cluster health. It sends results to the Admin Console unless upload is disabled. Air-gapped or embedded installations do not follow external specification or result URLs.
References: pkg/…/spec.go• L50-148 pkg/…/spec.go• L176-271 pkg/…/spec.go• L386-500 pkg/…/spec.go• L665-832 pkg/…/spec_test.go• L21-51 pkg/…/spec_test.go• L681-792
Diagnostic privacy
Redaction rules come from the Admin Console, the application, and the default support-bundle policy. The collection flow writes those rules before data collection. The system stores the redaction report with the bundle so an engineer can understand what data was changed or removed.
Support bundle sharing is an explicit downstream operation. It requires a license that allows sharing and does not apply to air-gapped installations.
References: pkg/…/supportbundle.go• L112-160 pkg/…/migrate.go• L18-45 pkg/…/migrate.go• L48-75 pkg/…/troubleshoot.go• L311-418 pkg/…/troubleshoot.go• L510-592
Operational interfaces
Operators use the Admin Console API for application and instance snapshot settings, backup status, restore status, and support bundle actions. The KOTS command line provides direct backup and restore workflows for an instance and supports machine-readable output for automation.
The Admin Console API checks access to the Velero namespace before it allows snapshot operations. In a minimal RBAC installation, the operator must grant that access before the system can configure storage or create snapshots.
The two child pages describe the detailed workflows:
- Snapshots and disaster recovery covers snapshot providers, scheduling, backup and restore orchestration, and disaster recovery.
- Support bundle collection covers diagnostic specifications, collection, file access, analysis, and support delivery.
References: pkg/…/backup.go• L32-249 pkg/…/snapshots.go• L99-375 pkg/…/troubleshoot.go• L217-275 cmd/…/backup.go• L15-108 cmd/…/restore.go• L21-125
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the relationship between backup names, grouped backup records, and restore identifiers aligned across the snapshot API, CLI output, and Velero resources.
- When changing snapshot storage choices, update validation, status reporting, credential references, and the worker restart or sync behavior as one contract.
- When changing backup scope or metadata, check both application restore selection and instance recovery context for new and older backups.
- When changing support bundle status or archive metadata, keep the progress record, archive, analysis, file tree, and redaction report consistent.
- When changing support bundle specification storage, keep Secret-based collection inputs, discovery of external specs, invalid-spec isolation, and startup cleanup of legacy ConfigMaps compatible with existing installations.
- When changing support sharing rules, preserve the air-gap and license gates at the point where data leaves the installation.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Velero or its backup storage location is missing | Backup creation and backup listing cannot proceed | Check Velero status and the configured storage location before an operation |
| Minimal RBAC does not grant access to the Velero namespace | Snapshot API operations return an access conflict | Run the permission setup for the actual Velero namespace |
| A storage destination fails validation or becomes unreachable | New snapshots cannot be written or may remain incomplete | Validate the destination and monitor backup phase and volume results |
| An application has no deployed version or backup specification | An application backup cannot describe a restorable state | Deploy the application version and provide its backup scope |
| Recovery uses an unfinished, failed, or unsupported backup | Recovery stops before rebuilding the requested environment | Select a completed supported instance backup and review restore results |
| A support collection stops updating its progress record | The bundle is treated as failed instead of remaining indefinitely in progress | Inspect collection progress and retry the collection |
| A discovered support-bundle specification has an invalid reference | That specification is skipped while valid diagnostic plans continue | Check the bundle result for skipped collectors and fix the referenced object |
| Support sharing is requested from an air-gapped installation or without the required license | The archive is not sent to the support service | Download the bundle for an approved transfer path or enable the licensed sharing path |
Key files
| File | Why to read it |
|---|---|
| pkg/…/backup.go | Shows how application and instance state become backup records and how backup results are summarized. |
| pkg/…/store.go | Shows the supported storage model and the checks that make a snapshot destination usable. |
| pkg/…/restore.go | Shows the recovery boundary between the saved instance and the running Admin Console and applications. |
| pkg/…/restore.go | Shows application-level restore creation and restore result reporting. |
| pkg/…/snapshots.go | Shows the operator-facing settings for storage, schedules, and retention. |
| pkg/…/troubleshoot.go | Shows the operator-facing support bundle lifecycle, file access, analysis, and sharing actions. |
| pkg/…/supportbundle.go | Shows how collection inputs, redaction rules, archives, and analysis relate to one support record. |
| pkg/…/spec.go | Shows how diagnostic plans are assembled, scoped, deduplicated, discovered, and stored for collection. |
| pkg/…/migrate.go | Shows how old support-bundle and redactor ConfigMaps are removed after the system moves those inputs to Secrets. |
| pkg/…/supportbundle_store.go | Shows how support bundle records, analysis, archive metadata, and redactions persist across the service. |
| cmd/…/backup.go | Shows the command-line entry point for creating and listing instance backups. |
| cmd/…/restore.go | Shows the command-line entry point for restoring an instance and listing restores. |