Back up CRDs with Operator
Backup CRDs in multiple groups with operator
If you are running applications with operator deployments that have CRDs in multiple groups, you can use:
- The
TRIM_CRD_GROUP_NAMEoperator in the kdmp-config map to enable Stork to back up all these CRDs. For more information, see Configure kdmp-config ConfigMap parameters.
To enable Stork to create a backup:
-
Run the following command to edit the kdmp-config ConfigMap present in the Namespace where Stork is deployed (
<stork-namespace>):kubectl edit cm kdmp-config -n <stork-namespace> -
Add the following parameter along with the common group name in the data section:
TRIM_CRD_GROUP_NAME: <common_group_name>
Consider an example where group names are agents.agent.k8s.elastic.co, apmservers.apm.k8s.elastic.co, and beats.beat.k8s.elastic.co. The group names are different even though they belong to the same operator, and the common group name is k8s.elastic.co.
In such cases, update the kdmp-config ConfigMap with the common group name:
TRIM_CRD_GROUP_NAME: k8s.elastic.co
Portworx Backup captures a CustomResourceDefinition (CRD) only when at least one instance of a CustomResource (CR) in the specified group exists at the time of backup. If a CR exists, Portworx Backup automatically includes the corresponding CRD in the backup. You can restore both the CR and the CRD from the backup object in Portworx Backup. If no CR instance exists at the time of backup, the corresponding CRD is not included in the backup.