destroy
Remove all previously applied resources in a package from the cluster
destroy removes all files belonging to a package from the cluster.
Synopsis #
kpt live destroy [PKG_PATH | -]
Args #
PKG_PATH | -:
Path to the local package which should be deleted from the cluster. It must
contain a Kptfile or a ResourceGroup manifest with inventory metadata.
Defaults to the current working directory.
Using '-' as the package path will cause kpt to read resources from stdin.
Flags #
--dry-run:
It true, kpt will print the resources that will be removed from the cluster,
but no resources will be deleted.
--inventory-policy:
Determines how to handle overlaps between the package being currently applied
and existing resources in the cluster. The available options are:
* strict: If any of the resources already exist in the cluster, but doesn't
belong to the current package, it is considered an error.
* adopt: If a resource already exist in the cluster, but belongs to a
different package, it is considered an error. Resources that doesn't belong
to other packages are adopted into the current package.
The default value is `strict`.
--output:
Determines the output format for the status information. Must be one of the following:
* events: The output will be a list of the status events as they become available.
* json: The output will be a list of the status events as they become available,
each formatted as a json object.
* table: The output will be presented as a table that will be updated inline
as the status of resources become available.
The default value is ‘events’.
--show-status-events:
The output will include the details on the reconciliation status
for all resources. Default is `false`.
Does not apply for the `table` output format.
--status-policy:
Determines which status information should be saved in the inventory
(if compatible). The available options are:
* all: Save status for all resources in the inventory.
* none: Do not save any status information in the inventory.
The default value is `all`.
--delete-propagation-policy:
The propagation policy that should be used when deleting resources. The
default value here is 'Background'. The other options are 'Foreground' and 'Orphan'.
--delete-timeout:
The threshold for how long to wait for all resources to be deleted before
giving up. If this flag is not set, kpt live destroy will wait until
interrupted. In most cases, it would also make sense to set the
--delete-propagation-policy to Foreground when this flag is set.
Examples #
# remove all resources in the current package from the cluster.
$ kpt live destroy
Last modified July 24, 2026: Add --delete-propagation-policy and --delete-timeout flags to kpt live destroy (51d62ec2)