Resource Modifiers

Introduction

Resource modifiers allow you to specify if and how specific Kubernetes resources should be automatically modified by restore, migration, and replication jobs. This advanced feature can be used to provide fine-grained control over the resulting configuration.

Note

Resource modifiers are available only with CloudCasa premium (paid) service plans.

Overview

Resource modifiers enable you to:

  • Modify resource specifications during restore (e.g. change image tags, resource limits, labels)

  • Transform resources to match different environments (e.g. development to production)

  • Apply security policies or compliance requirements during restore

  • Customize networking configurations for different target clusters

The feature uses YAML configuration files that define the modifications to be applied to specific resource types during the restore process.

Using Resource Modifiers

To use resource modifiers during a cluster restore, migration, or replication job:

  1. Enable the Feature: In the cluster restore, migration, or replication wizard, navigate to the Restore transforms step.

  2. Toggle the Option On: By enabling the Enable Resource Modifiers switch.

  3. Upload the Configuration: Upload a YAML file containing your restore modifier configuration.

The YAML file format is compatible with the Velero Resource Modifier configuration as defined in the Velero documentation.

Configuration Format

Here is the basic structure:

version: v1
resourceModifierRules:
- conditions:
    groupResource: deployments.apps
    resourceNameRegex: "^test-.*$"
    namespaces:
    - bar
    - foo
  patches:
  - operation: replace
    path: "/spec/replicas"
    value: "1"
  - operation: add
    path: "/metadata/labels/environment"
    value: "development"

Key Configuration Elements

Conditions: Define which resources the modifier applies to:

  • groupResource: The API group and resource type (e.g., deployments.apps, services)

  • resourceNameRegex: Regular expression to match resource names

  • namespaces: List of namespaces where the modifier applies

  • labelSelector: Label selector to match specific resources

Patches: Define the modifications to apply:

  • operation: The type of operation (add, remove, replace, copy, move, test)

  • path: JSON path to the field to modify

  • value: The new value to apply (for add and replace operations)

Limitations

  • Resource modifiers are only available with paid CloudCasa service plans.

  • The YAML file format must be compatible with the Velero resource modifier specifications.

  • Some complex transformations may require multiple patches.

  • Modifications are applied during restore and cannot be automatically undone.