TVK Cleanup Plugin

tvk-cleanup is a kubectl plugin that uninstalls the Triliovault Operator, Application, Custom Resources, and CRDs in a Kubernetes cluster.


  1. 1.
    krew - kubectl-plugin manager. Install from here.
  2. 2.
    kubectl - kubernetes command-line tool. Install from here.
For openshift environments, if kubectl is not installed and oc binary is installed on host machine, then oc binary can be used to perform kubectl operation by creating symlink with -
sudo ln -s /usr/local/bin/oc /usr/local/bin/kubectl
  • oc binary path can found by executing which oc
  • To delete/remove symbolic links use either unlink or rm command:
unlink /usr/local/bin/kubectl

Supported OS:

  • Linux
  • darwin

TVK Cleanup

This plugin cleans up all TVK Custom Resources, CRDs, and TVK application itself from all the namespace. It cleans up TVK installed as operator (on OCP platform) and as helm chart on upstream k8s (Rancher) cluster.
Please note the following:
  • Ensure kubectl utility is present on system
  • Ensure kubectl is pointed to k8s cluster (i.e can access the remote target cluster)
  • Ensure helm utility is present on system and pointed to the cluster
    • helmVersion=~v3 is needed on the cluster
  • Ensure minimum Kubernetes version >= 1.18.x
  • Cleans up all the Triliovault Custom Resources, Triliovault Manager application and CRDs from all the namespaces
  • User can select to delete any or all of
    1. 1.
      Triliovault Application (Operator or Helm chart)
    2. 2.
      Triliovault CRDs
    3. 3.
      Triliovault Customer Resources as listed here - Restore Backup Backupplan Hook Target Policy License

Installation, Upgrade, Removal of Plugins

With krew:

  • Add TVK custom plugin index of krew:
    kubectl krew index add tvk-plugins https://github.com/trilioData/tvk-plugins.git
  • Installation:
    kubectl krew install tvk-plugins/tvk-cleanup
  • Upgrade:
    kubectl krew upgrade tvk-cleanup
  • Removal:
    kubectl krew uninstall tvk-cleanup

Without krew:

  1. 2.
    Choose a version of preflight plugin to install and check if release assets have preflight plugin's package[cleanup.tar.gz]
  2. 3.
    Set env variable version=v1.x.x [update with your desired version]. If version is not exported, latest tagged version will be considered.


  • Bash or ZSH shells:
set -ex; cd "$(mktemp -d)" &&
if [[ -z ${version} ]]; then version=$(curl -s https://api.github.com/repos/trilioData/tvk-plugins/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")'); fi &&
echo "Installing version=${version}" &&
curl -fsSLO "https://github.com/trilioData/tvk-plugins/releases/download/"${version}"/cleanup.tar.gz" &&
tar zxvf cleanup.tar.gz && sudo mv cleanup/cleanup /usr/local/bin/kubectl-tvk_cleanup
Verify installation with kubectl tvk-cleanup --help




kubectl tvk-cleanup [options] [arguments]
-h, --help show brief help
-n, --noninteractive run script in non-interactive mode
-c, --crd delete Triliovault CRDs
-t, --tvm delete Triliovault Manager or Operator
-r, --resources \"resource1 resource2..\"
specify list of Triliovault CRs to delete
If not provided, all Triliovault CRs (listed below) will be deleted
e.g. Restore Backup Backupplan ClusterRestore ClusterBackup
ClusterBackupPlan Hook Target Policy License


  • Interactive, Cleans up all:
kubectl tvk-cleanup -t -c -r
  • Non-interactive, Cleans up all:
kubectl tvk-cleanup -n -t -c -r
  • Non-interactive, Cleans up only Triliovault Manager or Operator:
kubectl tvk-cleanup -n -t
  • Non-interactive, Cleans up only Triliovault CRDs
kubectl tvk-cleanup -n -c
  • Non-interactive, Cleans up only specified Triliovault CRs
kubectl tvk-cleanup -n -r "Restore Backup Backupplan"