This is the documentation for version 0.39. For documentation on the latest version of kpt, please see kpt.dev.

Migrate (alpha)

Migrate the package inventory object to a ResourceGroup custom resource

NOTE: This is an alpha command for the new ResourceGroup as inventory object functionality. This alpha command is not available unless the RESOURCE_GROUP_INVENTORY environment variable is set.

The migrate command upgrades the inventory object from a ConfigMap to a ResourceGroup custom resource. The migrate performs the following steps:

  1. Applies the ResourceGroup custom resource definition (see kpt live install-resource-group)
  2. If a ConfigMap inventory object exists in the cluster, the inventory object is upgraded to a ResourceGroup custom resource (deleting the previous ConfigMap ).
  3. If it has not already been created, the Kptfile inventory section is filled in. These values are used to create the ResourceGroup custom resource inventory object when the package is applied.
  4. Deletes the local ConfigMap file (usually inventory-template.yaml).

Examples

# migrate from ConfigMap to ResourceGroup inventory object
export RESOURCE_GROUP_INVENTORY=1
kpt live migrate my-dir/
# check the steps that will occur for the migrate, but
# do not actually run them.
export RESOURCE_GROUP_INVENTORY=1
kpt live migrate my-dir/ --dry-run
# migrate from ConfigMap to ResourceGroup inventory object, forcing
# new values for the inventory object to be written to the Kptfile.
export RESOURCE_GROUP_INVENTORY=1
kpt live migrate my-dir/ --force

Synopsis

kpt live migrate DIRECTORY [flags]

Args

DIR:
  Path to a package directory. The package must contain a Kptfile.
  If the package directory contains a ConfigMap inventory template
  file (usually named inventory-template.yaml), then this file
  will be deleted.

Flags

--dry-run:
  Do not actually run the migrate; only print out the steps that
  will occur.
--force:
  Set inventory values even if already set in Kptfile.
--name:
  Set the inventory object name, instead of default generated
  name (e.g. inventory-62308923). The user must make sure the
  inventory name does not collide with other inventory objects
  in the same namespace.