From 6d237eaf95dd35ef11e057d7a5efbc4d8e7d3be2 Mon Sep 17 00:00:00 2001 From: Rodrigo Pastrana Date: Tue, 1 Feb 2022 10:56:50 -0500 Subject: [PATCH] HPCC-27029 Start/stop ELK by default via docker scripts - Starts Elastic Stack instance by default via startall.sh - Stops Elastic Stack instance by default via stopall.sh - Reverses -e option to supress deployment of elk Signed-off-by: Rodrigo Pastrana --- dockerfiles/startall.sh | 8 +++++--- dockerfiles/stopall.sh | 13 ++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dockerfiles/startall.sh b/dockerfiles/startall.sh index b53b41ff865..8bc8a868806 100755 --- a/dockerfiles/startall.sh +++ b/dockerfiles/startall.sh @@ -17,7 +17,7 @@ # limitations under the License. ############################################################################## -# Utility script for starting a local cluster corresponding to current git branch +# Utility script for starting a local cluster (including elastic4hpcclogs) corresponding to current git branch # Usage startup.sh [] [] DOCKER_REPO=hpccsystems @@ -25,6 +25,7 @@ scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" restArgs=() CLUSTERNAME=mycluster PVFILE=$scriptdir/../helm/examples/local/hpcc-localfile/values.yaml +DEPLOY_ES=1 dependency_check () { @@ -87,7 +88,7 @@ while [ "$#" -gt 0 ]; do echo " -c Update chart dependencies" echo " -p Use local persistent data" echo " -pv Override dataplane definitions for local persistent data" - echo " -e Deploy light-weight Elastic Stack for component log processing" + echo " -e Suppress deployment of elastic4hpcclogs (deployed by default)" echo " -m Deploy Prometheus Stack for component metrics processing" exit ;; @@ -97,7 +98,8 @@ while [ "$#" -gt 0 ]; do # vanilla install - for testing system in the same way it will normally be used v) DEVELOPER_OPTIONS="" ;; - e) DEPLOY_ES=1 + e) DEPLOY_ES=0 + echo -e "\nDeployment of elastic4hpcclogs suppressed.\n" ;; m) DEPLOY_PROM=1 PROMETHEUS_METRICS_SINK_ARG="-f $scriptdir/../helm/examples/metrics/prometheus_metrics.yaml" diff --git a/dockerfiles/stopall.sh b/dockerfiles/stopall.sh index a9548ac1eb5..593d1084de1 100755 --- a/dockerfiles/stopall.sh +++ b/dockerfiles/stopall.sh @@ -30,10 +30,10 @@ while [ "$#" -gt 0 ]; do CLUSTERNAME=$1 ;; -e) UNINSTALL_ELK=1 + echo " -e option now ignored - lightweight Elastic Stack stopped by default" ;; *) echo "Usage: stoptall.sh [options]" echo " -w Wait for all pods to terminate" - echo " -e Uninstall light-weight Elastic Stack" exit ;; esac @@ -45,12 +45,11 @@ helm uninstall localfile helm uninstall myprometheus4hpccmetrics kubectl delete jobs --all kubectl delete networkpolicy --all -if [[ $UNINSTALL_ELK == 1 ]] ; then - 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 -fi +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 [[ $wait == 1 ]] ; then sleep 2 while (kubectl get pods | grep -q ^NAME) ; do