#!/bin/bash
cd kubernetes
docker-compose stop
docker-compose rm -f
echo "Removing k8s-started containers..."
docker rm -f `docker ps -a -f "name=k8s_" -q`

#!/bin/bash
cd kubernetes
docker-compose stop
docker-compose rm -f

k8s_containers=`docker ps -a -f "name=k8s_" -q`

if [ ! -z $k8s_containers ]; then
    echo "Removing k8s-started containers..."
    docker rm -f $k8s_containers
fi

Check if there are any k8s containers to be removed before attempting to .
Check if there are any k8s containers to be removed before attempting to .
