October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Back Up Kubernetes Custom Resources Before Removing an Operator

Export the custom resources you need while their CRD APIs are served. Understand finalizers, CRD deletion risks, and why YAML exports differ from etcd recovery.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Export the custom resources you need while their CRD APIs are still available, verify the files and their dependencies, and only then remove the operator components in the order its documentation specifies. Removing an operator controller and deleting its CRDs are separate actions: deleting a CRD also deletes the custom objects stored through it. A YAML export preserves selected API objects, not a complete application or cluster backup.

What you need to preserve—and what a YAML export does

A CustomResourceDefinition (CRD) registers a resource type and its API endpoint; custom resources (CRs) are the objects created through that API. Kubernetes makes them accessible with tools such as kubectl. An operator controller is different: it runs reconciliation logic for those objects. Removing the controller does not, by itself, mean the CRD has been deleted.

As an Amazon Associate I earn from qualifying purchases.

A kubectl get ... -o yaml export is a targeted way to save selected API objects. It is not a backup of every dependency those objects may reference. Check the operator documentation for required Secrets, ConfigMaps, persistent-volume contents, external services, credentials, and other application data, and preserve those separately using an appropriate method.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An etcd snapshot serves a different purpose. Kubernetes documents restoring etcd data from a snapshot or remaining data directory as a cluster data recovery process. It is not a targeted export of one operator’s resources. Neither a CR YAML file nor an etcd snapshot should be assumed to capture all external or persistent application data.

#1 Best Overall

Back up custom resources before uninstalling

  1. Identify the operator’s resources. Consult its installation and uninstall documentation to identify the CRDs it owns or uses. List the relevant CRDs and determine whether each resource type is namespaced or cluster-scoped.
  2. Inventory the objects to keep. For namespaced resources, check every relevant namespace; for cluster-scoped resources, inventory them at cluster scope. Decide whether you need desired configuration, status for reference, or a broader recovery point. The right scope depends on the operator and your recovery goal.
  3. Export the selected objects while the APIs are served. Use kubectl‘s YAML output mode to retrieve the resource types and scope you identified, and save the results in a protected, durable location. The exact resource names and namespace options depend on the operator and cluster; there is no universal export command that can identify every relevant object automatically.
  4. Verify the export. Check that the files contain every intended object and that you can read and retain them securely. Identify separate configuration, secrets, storage, or external state the operator needs; a CR manifest alone does not include those dependencies.
  5. Review cleanup and finalizers before removing the controller. Inspect the resources’ metadata.finalizers and follow the operator’s uninstall guidance. A controller may need to perform cleanup before a deletion finishes. Do not remove it until required cleanup has completed, unless the operator documentation gives a safe alternative.
  6. Uninstall in the documented order. If you need the custom objects to remain accessible in the cluster, retain their CRDs. If you intend to delete a CRD, first verify the export and accept that deleting that CRD deletes all custom objects stored through it.
  7. Plan restoration against a compatible API. Before reapplying saved objects, ensure the required CRD exists and serves a compatible API version. Consult the operator’s migration and restore guidance if its schema or release has changed.

These are planning steps, not a universal uninstall command sequence. The correct commands and order vary by operator, release, and installation method, such as Helm, manifests, or an Operator Lifecycle Manager. Do not assume a broad command such as kubectl delete all includes CRDs or every related resource.

Understand CRD deletion and finalizers

Deleting the operator controller and deleting a CRD are distinct operations. The controller reconciles resources; the CRD defines their API type. Kubernetes warns that deleting a CRD removes its REST API endpoint and all custom objects stored in it, and that recreating the CRD starts with no such objects. The Kubernetes CRD documentation describes this behavior.

Finalizers can make deletion asynchronous. Kubernetes explains: “Finalizers are namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources that are marked for deletion.” After a deletion request, an object with finalizers can remain in a terminating state while its controller performs the required work. The controller removes its finalizer when that work is complete. See Kubernetes finalizers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The kubectl delete reference says deletion waits for finalizers by default; force deletion can remove resources immediately and may cause inconsistency or data loss. It is not a routine fix for an object that remains terminating. See the kubectl delete reference.

If the controller has already been removed, it cannot perform its normal reconciliation. Whether a particular resource can safely be retained, deleted, or restored depends on that operator’s cleanup design. Removing finalizers directly can bypass intended cleanup; do so only with operator-specific knowledge and a recovery plan.

Restore with the right CRD and API version

A saved manifest is useful only if the API needed to accept it is available and compatible. CRDs can serve multiple API versions and support conversion between versions. A changed schema or operator release may require migration steps rather than a direct reapply. Retain the relevant CRD and version configuration, and consult the operator’s documentation before restoring objects into a changed environment. Kubernetes describes CRD versions and conversion in its CustomResourceDefinition documentation.

Before a restore, confirm which API version the saved object uses, which versions the installed CRD serves, and whether the operator documents a migration path. Also restore any separately backed-up dependencies required by the application; reapplying a CR does not recreate data stored outside that API object.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the backup scope that matches the recovery goal

Approach Scope and restore use What it does not establish on its own
Custom-resource YAML export Selected API objects; useful for targeted preservation and reapplication when a compatible CRD/API is available. Does not automatically include referenced configuration or secrets, persistent-volume contents, external service state, or all cluster data.
etcd snapshot Cluster datastore recovery; Kubernetes documents restoring etcd data from a snapshot or remaining data directory. Not a targeted export of one operator’s CRs, and does not by itself establish that external or application data is covered.

See Kubernetes documentation for YAML output with kubectl and etcd backup and restore. The exact export scope, restore procedure, and version compatibility depend on the cluster and operator. Check documentation for the Kubernetes version you run; the official documentation is not uniformly pinned to one version.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.