Cleanup etcd, docker, kubernetes

Change-Id: I307a67f9e28edc1410893d9930e9372e1fa8fed0
This commit is contained in:
Davanum Srinivas 2017-05-04 13:40:54 -04:00
parent dfce08820e
commit 292e55394e
1 changed files with 9 additions and 0 deletions

View File

@ -139,6 +139,15 @@ function install_k8s_cloud_provider {
# runs that a clean run would need to clean up
function cleanup_k8s_cloud_provider {
echo_summary "Cleaning up Devstack Plugin for k8s-cloud-provider"
# Kill etcd and the k8s processes
ps -ef | grep -e etcd -e hyperkube | grep -v grep | awk '{print $2}' | xargs sudo kill -9
# Cleanup docker images and containers
sudo docker rm -f $(docker ps -a -q) || true
sudo docker rmi -f $(docker images -q -a) || true
# Stop docker
sudo systemctl stop docker.service
sudo rm -rf "$K8S_SRC"
sudo rm -rf "$DEST/etcd"
}