Skip to content

Commit

Permalink
HPCC-27029 Code review changes
Browse files Browse the repository at this point in the history
- Adds logic to delete elastic PVC/PV
- Defines option to suppress deletion of elastic4hpcclogs

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Feb 8, 2022
1 parent 6d237ea commit 5fbbe1a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions dockerfiles/stopall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Utility script for stopping a local cluster started by startall.sh
wait=0
CLUSTERNAME=mycluster
UNINSTALL_ELK=1

while [ "$#" -gt 0 ]; do
arg=$1
Expand All @@ -29,11 +30,12 @@ while [ "$#" -gt 0 ]; do
-n) shift
CLUSTERNAME=$1
;;
-e) UNINSTALL_ELK=1
echo " -e option now ignored - lightweight Elastic Stack stopped by default"
-e) UNINSTALL_ELK=0
echo "elastic4hpcclogs will not be stopped..."
;;
*) echo "Usage: stoptall.sh [options]"
echo " -w Wait for all pods to terminate"
echo " -e Suppress deletion of elastic4hpcclogs"
exit
;;
esac
Expand All @@ -45,10 +47,14 @@ helm uninstall localfile
helm uninstall myprometheus4hpccmetrics
kubectl delete jobs --all
kubectl delete networkpolicy --all
echo "Uninstalling myelastic4hpcclogs:"
echo "PLEASE NOTE: Elastic Search declares PVC(s) which might require explicit manual removal if no longer needed."
helm uninstall myelastic4hpcclogs
kubectl get pvc

if [[ $UNINSTALL_ELK == 1 ]] ; then
echo "Uninstalling myelastic4hpcclogs:"
helm uninstall myelastic4hpcclogs

echo "Deleting Elasticsearch PVC..."
kubectl delete pvc elasticsearch-master-elasticsearch-master-0
fi

if [[ $wait == 1 ]] ; then
sleep 2
Expand Down

0 comments on commit 5fbbe1a

Please sign in to comment.