From 98e6aca2d3b0057200aa35b188da313baa7db60e Mon Sep 17 00:00:00 2001 From: Nathan Jones Date: Wed, 13 Nov 2019 06:56:18 -0500 Subject: [PATCH] Improved manual UCP uninstall commands (#9752) * Improved manual UCP uninstall commands Current `service rm` command made assumptions about the names of existing services and would fail in some instances. Current `container rm` command would not remove k8s containers. New commands don't rely on grep, awk, or xargs. * Added missing flag Added `-a` flag to see UCP containers from client bundle --- ee/ucp/admin/install/uninstall.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ee/ucp/admin/install/uninstall.md b/ee/ucp/admin/install/uninstall.md index 60db02b0f1..8a50f6907e 100644 --- a/ee/ucp/admin/install/uninstall.md +++ b/ee/ucp/admin/install/uninstall.md @@ -36,10 +36,13 @@ This runs the uninstall command in interactive mode, so that you are prompted for any necessary configuration values. > **Important**: If the `uninstall-ucp` command fails, you can run the following commands to manually uninstall UCP: -``` -docker service rm ucp-agent-win ucp-agent-s390x ucp-agent -docker ps -a | grep ucp | awk '{print $1}' | xargs docker rm -f -docker volume ls | grep ucp | awk '{print $2}' | xargs docker volume rm +```bash +#Run the following command on one manager node to remove remaining UCP services +docker service rm $(docker service ls -f name=ucp- -q) +#Run the following command on each manager node to remove remaining UCP containers +docker container rm -f $(docker container ps -a -f name=ucp- -f name=k8s_ -q) +#Run the following command on each manager node to remove remaining UCP volumes +docker volume rm $(docker volume ls -f name=ucp -q) ``` The UCP configuration is kept in case you want to reinstall UCP with the same