Explorar o código

Merge pull request #15462 from rpastrana/HPCC-26570-PrometheusStartAll

HPCC-26570 Provide startall option to deploy and report Prometheus me…

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=3) %!d(string=hai) anos
pai
achega
ee4676e7af
Modificáronse 2 ficheiros con 17 adicións e 4 borrados
  1. 16 4
      dockerfiles/startall.sh
  2. 1 0
      dockerfiles/stopall.sh

+ 16 - 4
dockerfiles/startall.sh

@@ -88,6 +88,7 @@ while [ "$#" -gt 0 ]; do
          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 "    -m                 Deploy Prometheus Stack for component metrics processing"
          exit
          ;;
       t) CMD="template"
@@ -96,7 +97,10 @@ while [ "$#" -gt 0 ]; do
       # vanilla install - for testing system in the same way it will normally be used
       v) DEVELOPER_OPTIONS=""
          ;;
-      e) DEPLOY_ES=true
+      e) DEPLOY_ES=1
+         ;;
+      m) DEPLOY_PROM=1
+         PROMETHEUS_METRICS_SINK_ARG="-f $scriptdir/../helm/examples/metrics/prometheus_metrics.yaml"
          ;;
       *) restArgs+=(${arg})
          ;;
@@ -129,12 +133,12 @@ if [[ -n ${PERSIST} ]] ; then
   done
   helm ${CMD} localfile $scriptdir/../helm/examples/local/hpcc-localfile --set common.hostpath=${PERSIST} $PERSISTVALUES | tee lsfull.yaml | grep -A1000 storage: > localstorage.yaml && \
   grep "##" lsfull.yaml  && \
-  helm ${CMD} $CLUSTERNAME $scriptdir/../helm/hpcc/ --set global.image.root="${DOCKER_REPO}" --set global.image.version=$LABEL $DEVELOPER_OPTIONS $DEP_UPDATE_ARG ${restArgs[@]} -f localstorage.yaml
+  helm ${CMD} $CLUSTERNAME $scriptdir/../helm/hpcc/ --set global.image.root="${DOCKER_REPO}" --set global.image.version=$LABEL $DEVELOPER_OPTIONS $DEP_UPDATE_ARG ${restArgs[@]} -f localstorage.yaml ${PROMETHEUS_METRICS_SINK_ARG}
 else
-  helm ${CMD} $CLUSTERNAME $scriptdir/../helm/hpcc/ --set global.image.root="${DOCKER_REPO}" --set global.image.version=$LABEL $DEVELOPER_OPTIONS $DEP_UPDATE_ARG ${restArgs[@]}
+  helm ${CMD} $CLUSTERNAME $scriptdir/../helm/hpcc/ --set global.image.root="${DOCKER_REPO}" --set global.image.version=$LABEL $DEVELOPER_OPTIONS $DEP_UPDATE_ARG ${restArgs[@]} ${PROMETHEUS_METRICS_SINK_ARG}
 fi
 
-if [[ $DEPLOY_ES ]] ; then
+if [[ $DEPLOY_ES == 1 ]] ; then
   echo -e "\n\nDeploying "myelastic4hpcclogs" - light-weight Elastic Stack:"
   if [[ -z "${DEP_UPDATE_ARG}" ]]; then
     dependency_check "managed/logging/elastic"
@@ -142,6 +146,14 @@ if [[ $DEPLOY_ES ]] ; then
   helm ${CMD} myelastic4hpcclogs $scriptdir/../helm/managed/logging/elastic $DEP_UPDATE_ARG ${restArgs[@]}
 fi
 
+if [[ $DEPLOY_PROM == 1 ]] ; then
+  echo -e "\n\nDeploying "myprometheus4hpccmetrics" - Prometheus Stack:"
+  if [[ -z "${DEP_UPDATE_ARG}" ]]; then
+    dependency_check "managed/metrics/prometheus"
+  fi
+  helm ${CMD} myprometheus4hpccmetrics $scriptdir/../helm/managed/metrics/prometheus $DEP_UPDATE_ARG ${restArgs[@]} --set kube-prometheus-stack.prometheus.service.type=LoadBalancer --set kube-prometheus-stack.grafana.service.type=LoadBalancer
+fi
+
 if [ ${CMD} != "template" ] ; then
   sleep 1
   kubectl get pods

+ 1 - 0
dockerfiles/stopall.sh

@@ -42,6 +42,7 @@ done
 
 helm uninstall $CLUSTERNAME
 helm uninstall localfile
+helm uninstall myprometheus4hpccmetrics
 kubectl delete jobs --all
 kubectl delete networkpolicy --all
 if [[ $UNINSTALL_ELK == 1 ]] ; then