Uninstalling Flow Enterprise

Tags: Flow on-prem

In some situations, it may be necessary to uninstall Flow Enterprise. Uninstalling is required in Flow versions 2021.1.1 and newer to properly utilize your raw block devices. If your underlying Kubernetes system is not working right, or if you're experiencing data corruption due to a lack of disk space on your system, you may need to uninstall Flow.

Important: Back up your Flow database before uninstalling or installing Flow. Learn more about backing up Flow.

To uninstall Flow, first download the latest version of flow-enterprise-tools from the link provided by Pluralsight Support. If you already have a copy of this package installed on your servers, update the installation with the updated version.

Run the uninstall script either from the directory where you installed flow-enterprise-tools or directly from the command line if you installed flow-enterprise-tools system-wide.

Run the uninstall script of every node of your Flow Enterprise cluster. Uninstall first on the Flow primary node/server, then on each worker node.

Tip: The uninstall script is identical for primary and worker nodes.

Note: The article's uninstallation example uses the /opt/flow-enterprise-tools/ directory as its location.

First, run sudo ./flow-uninstall.

$ cd /opt/flow/enterprise-tools/bin

$ sudo ./flow-uninstall

root@primary-node:/opt/flow-enterprise-tools/bin# sudo ./flow-uninstall 

[WARN] ======================= WARNING ===========================

[WARN] Running this script will remove Kubernetes and all 

[WARN] related components, Flow application from this server.

[WARN] Worker nodes will be drained and deleted from cluster.

[WARN] Following directory contents will be removed:

[WARN] var/lib/kubelet/var/lib/rook

[WARN] /var/lib/ceph~/.kube/var/lib/docker/opt/flow

[WARN] /opt/replicated/var/lib/weave

[WARN] ===========================================================

=== Warning: Removing all Kubernetes components ===

Enter y/n to continue or exit : 

Press y to continue uninstalling.


[INFO] Checking environment...

[INFO] Archive command (tar): OK

[INFO] HTTP command (curl): OK

[INFO] YAML command (yq): OK

[INFO] KOTS CLI command (kubectl kots): OK

[INFO] Flow app installed: OK

[INFO] Using yq command: /opt/flow-enterprise-tools/packages/yq

  • Connecting to cluster ✓  

    The application manifests have been downloaded and saved in /tmp/flow-export-to-kotsv6K/flow-enterprise

After editing these files, you can upload a new version using

      kubectl kots upload --namespace default --slug flow-enterprise /tmp/flow-export-to-kotsv6K/flow-enterprise

[INFO] Exporting config bundle: kots-config-2021-03-24-14-52-42.tar.gz

[INFO] Cleaning up...

Best practice is to backup the database prior to proceeding; Is it safe to continue? (Y/N): 

Note: This script automatically creates a backup of the last running configuration of your Flow Enterprise settings to a file name kots-config-<datestamp>.tar.gz. It does not create any backups of the current embedded database or external database, so you should back up your database before continuing.

When prompted, press Y to continue.

[INFO] Master node detected with 0 worker nodes

[INFO] Scaling down flow ..

deployment.apps/flow-aod-repo-wkr scaled

deployment.apps/flow-bg-wkr scaled

deployment.apps/flow-commit-dedupe-utility-pod scaled

deployment.apps/flow-helm-repo scaled

deployment.apps/flow-inc-repo-wkr scaled

deployment.apps/flow-java-mgrt-mgr scaled

deployment.apps/flow-java-prs scaled

deployment.apps/flow-java-tickets scaled

deployment.apps/flow-mgrt-mgr scaled

deployment.apps/flow-new-repo-wkr scaled

deployment.apps/flow-prj-wkr scaled

deployment.apps/flow-scheduler scaled

deployment.apps/flow-syslog scaled

deployment.apps/flow-web scaled

deployment.apps/flow-web-proxy scaled

Pods left = 0 [/]  

[INFO] Deleting Embedded DBs ..

statefulset.apps "flow-db" deleted

statefulset.apps "flow-redis-master" deleted

NAME               READY   AGE

kotsadm-postgres   1/1     2d15h

[INFO] Disabling Services

[INFO] Stopping kubelet service ..

Removed /etc/systemd/system/multi-user.target.wants/kubelet.service.

[INFO] Stopping containerd service ..

Removed /etc/systemd/system/multi-user.target.wants/containerd.service.

[INFO] Stopping and disabling Docker ..

Failed to stop docker.service: Unit docker.service not loaded.

[INFO] Please reboot the server and re-run this script to continue uninstall.

[INFO] Note: May need to do a force reboot/hard reset to clear mounted docker folders

[INFO] run: 'sudo sh -c 'echo b > /proc/sysrq-trigger''

#

Run the last command in the script output to force a hard reboot of your server. Once the server is rebooted, rerun the same ./flow-uninstall script from the same location to continue the uninstall process.

root@test-host-01:/opt/flow-enterprise-tools/bin# ./flow-uninstall 

[INFO] Continuing uninstall of Flow ..

[INFO] Docker Services stopped, continuing cleanup ..

[INFO] Removing K8s packages ..

Reading package lists...

Building dependency tree...

Reading state information...

The following packages will be REMOVED:

  kubeadm*

0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded.

After this operation, 39.1 MB disk space will be freed.                                                      

(Reading database ... 193758 files and directories currently installed.)

Removing kubeadm (1.19.7-00) ...

(Reading database ... 193757 files and directories currently installed.)

Purging configuration files for kubeadm (1.19.7-00) ...

[INFO] kubeadm removed

Reading package lists...

Building dependency tree...

Reading state information...

The following packages will be REMOVED:

  kubectl*

0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded.

After this operation, 43.0 MB disk space will be freed.                                                            

(Reading database ... 193755 files and directories currently installed.)

Removing kubectl (1.19.7-00) ...

[INFO] kubectl removed

Reading package lists...

Building dependency tree...

Reading state information...

The following packages will be REMOVED:

  kubelet*

0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded.

After this operation, 110 MB disk space will be freed.                                                                            

(Reading database ... 193754 files and directories currently installed.)

Removing kubelet (1.19.7-00) ...

(Reading database ... 193752 files and directories currently installed.)

Purging configuration files for kubelet (1.19.7-00) ...

[INFO] kubelet removed

Reading package lists...

Building dependency tree...

Reading state information...

The following packages will be REMOVED:

  kubernetes-cni*

0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded.

After this operation, 72.2 MB disk space will be freed.                                                                                                           

(Reading database ... 193752 files and directories currently installed.)

Removing kubernetes-cni (0.8.7-00) ...

dpkg: warning: while removing kubernetes-cni, directory '/opt/cni/bin' not empty so not removed

[INFO] kubernetes-cni removed

[INFO] Removing docker packages ..

Reading package lists...

Building dependency tree...

Reading state information...

Package 'docker-engine' is not installed, so not removed

0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.

[INFO] docker-engine removed

Reading package lists...

Building dependency tree...

Reading state information...

Package 'docker' is not installed, so not removed

0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.

[INFO] docker removed

Reading package lists...

Building dependency tree...

Reading state information...

Package 'docker.io' is not installed, so not removed

0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.

[INFO] docker.io removed

Reading package lists...

Building dependency tree...

Reading state information...

Package 'docker-ce' is not installed, so not removed

0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.

[INFO] docker-ce removed

Reading package lists...

Building dependency tree...

Reading state information...

E: Unable to locate package docker-ce-cli

[INFO] docker-ce-cli removed

Reading package lists...

Building dependency tree...

Reading state information...

Package 'containerd' is not installed, so not removed

0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.

[INFO] containerd removed

Reading package lists...

Building dependency tree...

Reading state information...

The following packages will be REMOVED:

  containerd.io*

0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded.

After this operation, 130 MB disk space will be freed.                                                                                                          

(Reading database ... 193734 files and directories currently installed.)

Removing containerd.io (1.4.3-2) ...

Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

(Reading database ... 193720 files and directories currently installed.)

Purging configuration files for containerd.io (1.4.3-2) ...

[INFO] containerd.io removed

[INFO] Cleaning up mounts ..

[INFO] Cleaning up folders ..

[INFO] Removing root's .kube ..

[INFO] Removing rook ..

[INFO] Removing kubelet ..

[INFO] Removing replicated ..

[INFO] Removing weave ..

[INFO] Removing kubernetes config dir ..

[INFO] Removing Flow logs dir ..

[INFO] Removing docker components ..

[INFO] Removing containerd components ..

[INFO] Removing CNI components ..

[INFO] Removing uninstallation files ..

[INFO] Resetting IPTABLES ..

[INFO] ceph raw disks detected..

=== Warning: Removing /dev/nvme1n1 ===

Enter Y/y to continue, N/n to exit

If you had any raw devices, you'll see a prompt to remove those devices from Flow usage. The device name varies between Linux distributions. If you have an older version of Flow, or no raw devices, this prompt will not appear. Press Y to continue.

[INFO] Removing /dev/mapper links of raw disk /dev/mapper/ceph--a1af2865--54b6--43e6--addc--e24972e1a81f-osd--data--75f29373--09e7--4fa6--8fb8--521f3eaa3187

[INFO] Resetting MBR of raw disk /dev/nvme1n1

Creating new GPT entries.

GPT data structures destroyed! You may now partition the disk using fdisk or other utilities.

[INFO] Flow uninstall has been completed.

At this point, Flow Enterprise is fully uninstalled from the primary node. Next, follow the same steps on each worker node in the cluster. If you have multiple worker nodes, you can choose to run the uninstall script in parallel on all of the worker nodes.

back to top


If you need help, please email support@pluralsight.com for 24/7 assistance.