The Transform command facilitates the frequently necessary changes to the exported resources when migrating workloads between one environment to another. For example:
Because most changes are specific to an environment, Crane is designed for total customization and the transform command accepts a “plugins” directory argument.
Each plugin is an executable with a well defined stdin/out interface allowing for customization or installation and use of published generic plugins.
After exporting the resources into a local directory and installing the desired transformation plugins, the crane transform
command can run. The output is placed in a directory with a set of transform files that describe the changes that need to be applied to the original resources before their final import. The changes are written in the JSON Patch format, are human readable, and easily hackable.
This command generates a patch to add an annotation transform-test:test
for objects in the export
directory and the transform
directory to be used as input for the apply
command.
crane transform -e export -p plugins -t transform --optional-flags="add-annotations=transform-test:test"
Run the following to see the list of available optional commands for configured plugins.
crane transform optionals
See PlugIn Manager for more information on plugins that can be consumed by the transform command.