T4K Cleanup Plugin

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

Prerequisites:

  1. krew - kubectl-plugin manager. Install from here.

  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

T4K Cleanup

This plugin cleans up all T4K Custom Resources, CRDs, and T4K application itself from all the namespace. It cleans up T4K 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 Trilio Custom Resources, Trilio Manager application and CRDs from all the namespaces

  • User can select to delete any or all of

    1. Trilio Application (Operator or Helm chart)

    2. Trilio CRDs

    3. Trilio Customer Resources as listed here - Restore Backup Backupplan Hook Target Policy License

Installation, Upgrade, Removal of Plugins

With krew:

  • Add T4K custom plugin index of krew:

  • Installation:

  • Upgrade:

  • Removal:

Without krew:

  1. Choose a version of preflight plugin to install and check if release assets have preflight plugin's package[cleanup.tar.gz]

  2. Set env variable version=v1.x.x [update with your desired version]. If version is not exported, latest tagged version will be considered.

Linux/macOS

  • Bash or ZSH shells:

Verify installation with kubectl tvk-cleanup --help

Windows

NOT SUPPORTED\

Usage:

Examples

  • Interactive, Cleans up all:

  • Non-interactive, Cleans up all:

  • Non-interactive, Cleans up only Trilio Manager or Operator:

  • Non-interactive, Cleans up only Trilio CRDs

  • Non-interactive, Cleans up only specified Trilio CRs