@leverege/build-tools 2.0.13 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/helmup +42 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "A package for development build tools.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/helmup CHANGED
@@ -44,6 +44,7 @@ function color() {
44
44
  }
45
45
  RED_ERROR=`color r '***ERROR:'`
46
46
  YELO_WARN="`color y '***WARNING:'`"
47
+ GREEN_INFO=`color g '***INFO:'`
47
48
 
48
49
  function setOrUnset() {
49
50
  local setting=`color toast "NEEDS TO BE SET"`
@@ -78,25 +79,35 @@ function installMonitoringCharts(){
78
79
  fi
79
80
 
80
81
  ## Install Prometheus
81
- helm upgrade --install prometheus --namespace monitoring stable/prometheus -f prometheus/values.yaml
82
+ helm upgrade --install prometheus stable/prometheus \
83
+ --namespace monitoring \
84
+ -f prometheus/values.yaml \
85
+ --version 11.0.0
82
86
 
83
87
  ## Installing ES exporter
84
88
  helm upgrade --install elasticsearch-exporter stable/elasticsearch-exporter \
85
89
  --namespace monitoring \
86
- --set-string service.annotations."prometheus\.io/port"="9108" \
87
- --set-string service.annotations."prometheus\.io/scrape"="true" \
88
- --set es.uri="http://databases-elasticsearch.default.svc.cluster.local:9200" \
90
+ -f elasticsearch-exporter/values-es-exporter.yaml \
89
91
  --version 3.0.0
90
92
 
91
93
  ## Install Grafana
92
94
  helm upgrade --install grafana stable/grafana \
93
95
  --namespace monitoring \
94
- --set service.type="NodePort" \
95
- --set service.port="9000" \
96
- --set persistence.enabled="true" \
97
- --set persistence.storageClassName="ssd" \
96
+ -f grafana/values-grafana.yaml \
98
97
  --version 5.0.3
99
-
98
+
99
+ ## Print out instructions
100
+ printf "\n$GREEN_INFO To access prometheus =>\n\n"
101
+ printf "Prometheus Server (manage targets, configs, alerts): \n
102
+ export POD_NAME=\$(kubectl get pods --namespace monitoring -l 'app=prometheus,component=server' -o jsonpath='{.items[0].metadata.name}')
103
+ kubectl --namespace monitoring port-forward \$POD_NAME 9090\n\n"
104
+
105
+ printf "Alertmanager (manage alert notification, silences): \n
106
+ export POD_NAME=\$(kubectl get pods --namespace monitoring -l 'app=prometheus,component=alertmanager' -o jsonpath='{.items[0].metadata.name}')
107
+ kubectl --namespace monitoring port-forward \$POD_NAME 9093\n\n"
108
+
109
+ printf "$YELO_WARN Save Grafana password to Keeweb if you haven't already & create ingress\n\n"
110
+ printf " kubectl get secret --namespace monitoring grafana -o jsonpath='{.data.admin-password}' | base64 --decode ; echo\n\n"
100
111
  }
101
112
 
102
113
  function createSSDYAML(){
@@ -238,6 +249,28 @@ EOK8S
238
249
  exit 1
239
250
  fi
240
251
 
252
+ OLD_MONITORING="${GITTOP}/values-monitoring.yaml"
253
+ if [ -f "$OLD_MONITORING" ];
254
+ then
255
+ cat<<OLDMON
256
+
257
+ $RED_ERROR Old monitoring setup detected
258
+
259
+ Monitoring now runs in the monitoring namespace, centrally managed via helmup.
260
+
261
+ To migrate to the new setup:
262
+ 1) Delete values-monitoring.yaml
263
+ 2) Grab prometheus/values-local.yaml from master branch (modify as needed for opsgenie config)
264
+ 3) Grab stackdriver-exporter/values-local.yaml from master branch
265
+ 4) Create grafana dir => add .nohelm and values-grafana.yaml
266
+ 5) Create elasticsearch-exporter dir => add .nohelm and values-es-exporter.yaml
267
+
268
+ Now run helmup monitoring and follow directions.
269
+
270
+ OLDMON
271
+ exit 1
272
+ fi
273
+
241
274
  npm run ahoy
242
275
  [ $? -ne 0 ] && printf "\n\n***Aborting helmup...\n\n" && exit 1
243
276