Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-27029 Start/stop ELK by default via docker scripts #15718

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
- Adds logic to delete elastic PVC/PV
- Defines option to suppress deletion of elastic4hpcclogs

Signed-off-by: Rodrigo Pastrana <[email protected]>
rpastrana committed Feb 8, 2022

Verified

This commit was signed with the committer’s verified signature.
Emojigit 1F616EMO~nya
commit e20e64c45de601e28afafc5daa394d2da39ff0ad
8 changes: 5 additions & 3 deletions dockerfiles/startall.sh
Original file line number Diff line number Diff line change
@@ -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 () {

@@ -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
;;
@@ -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"
13 changes: 9 additions & 4 deletions dockerfiles/stopall.sh
Original file line number Diff line number Diff line change
@@ -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
@@ -29,11 +30,12 @@ while [ "$#" -gt 0 ]; do
-n) shift
CLUSTERNAME=$1
;;
-e) UNINSTALL_ELK=1
-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 Uninstall light-weight Elastic Stack"
echo " -e Suppress deletion of elastic4hpcclogs"
exit
;;
esac
@@ -45,12 +47,15 @@ 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

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

if [[ $wait == 1 ]] ; then
sleep 2
while (kubectl get pods | grep -q ^NAME) ; do