Skip to content

Commit

Permalink
HPCC-27029 Start/stop ELK by default via docker scripts
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
rpastrana committed Feb 4, 2022
1 parent d625a42 commit 6d237ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 5 additions & 3 deletions dockerfiles/startall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
# 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 [<image.version>] [<helm-install-options>]

DOCKER_REPO=hpccsystems
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 () {

Expand Down Expand Up @@ -87,7 +88,7 @@ while [ "$#" -gt 0 ]; do
echo " -c Update chart dependencies"
echo " -p <location> Use local persistent data"
echo " -pv <yamlfile> 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
;;
Expand All @@ -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"
Expand Down
13 changes: 6 additions & 7 deletions dockerfiles/stopall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6d237ea

Please sign in to comment.