@leverege/build-tools 2.26.4 → 2.27.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.26.4",
3
+ "version": "2.27.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -65,14 +65,14 @@
65
65
  "parse-gitignore": "^2.0.0",
66
66
  "readline-sync": "^1.4.10",
67
67
  "semver": "^7.3.8",
68
- "simple-git": "^3.16.0",
69
- "zx": "^7.1.1"
68
+ "simple-git": "^3.17.0",
69
+ "zx": "^7.2.0"
70
70
  },
71
71
  "devDependencies": {
72
- "@babel/cli": "^7.20.7",
73
- "@babel/core": "^7.20.12",
72
+ "@babel/cli": "^7.21.0",
73
+ "@babel/core": "^7.21.0",
74
74
  "@leverege/babel-preset-leverege-node": "^2.0.0",
75
75
  "@leverege/eslint-config-leverege": "^3.0.1",
76
- "npm": "^9.4.1"
76
+ "npm": "^9.6.1"
77
77
  }
78
78
  }
package/src/helmup CHANGED
@@ -21,7 +21,7 @@ PLATFORM=(
21
21
  scheduler
22
22
  transponder-bq
23
23
  transponder-rt
24
- transponder-postgres # deprecated
24
+ # transponder-postgres # deprecated
25
25
  transponder-tsdb
26
26
  )
27
27
 
@@ -110,14 +110,9 @@ function createNamespaceIfNeeded() {
110
110
 
111
111
  function bootstrapLocalSetup() {
112
112
  SERVICE="$1"
113
- [ -z "$1" ] && errorExit "bootstrapLocalSetup function requires a service name"
114
- TOOLS_SRC="$(build-tools --reporoot)/src"
115
- SYSTEM_FILES="$(build-tools --reporoot)/src/system-charts"
113
+ [ -z "$SERVICE" ] && errorExit "bootstrapLocalSetup function requires a service name"
116
114
 
117
- SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
118
- [ ! -f "$SYSTEM_CHART" ] && errorExit "Missing $SERVICE chart => $(color y $SYSTEM_CHART)"
119
- SYSTEM_HUP="$SYSTEM_FILES/$SERVICE.hup"
120
- [ ! -f "$SYSTEM_HUP" ] && errorExit "Missing $SERVICE helmup script => $(color y $SYSTEM_HUP)"
115
+ ifPluggedIn $SERVICE && return # if it's already plugged in then go
121
116
 
122
117
  if [ ! -d "$SERVICE" ];
123
118
  then
@@ -140,14 +135,37 @@ MISSING_HELMUP_PLUGIN
140
135
  errorExit "Installaion of `color y $SERVICE` failed - exiting"
141
136
  fi
142
137
 
143
- if [ "$2" == "set-values-local" ];
138
+ TOOLS_SRC="$(build-tools --reporoot)/src"
139
+ SYSTEM_FILES="$(build-tools --reporoot)/src/system-charts"
140
+
141
+ case "$2" in
142
+ "set-values-local")
143
+ SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
144
+ TARGET_CHART="values-local.yaml"
145
+ ;;
146
+
147
+ "ovh-values-local")
148
+ SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml.ovh"
149
+ TARGET_CHART="$SERVICE-local.yaml.ovh"
150
+ echo "$SERVICE-local.yaml" > $SERVICE/.gitignore
151
+ ;;
152
+
153
+ *)
154
+ SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
155
+ TARGET_CHART="$SYSTEM_CHART"
156
+ touch $SERVICE/.nohelm
157
+ ;;
158
+ esac
159
+
160
+ if [ ! -f "$SYSTEM_CHART" ];
144
161
  then
145
- TARGET_CHART="values-local.yaml"
146
- else
147
- TARGET_CHART="$SERVICE-local.yaml"
148
- touch $SERVICE/.nohelm
162
+ rm -rf $SERVICE
163
+ errorExit "Missing $SERVICE chart => $(color y $SYSTEM_CHART)"
149
164
  fi
150
165
 
166
+ SYSTEM_HUP="$SYSTEM_FILES/$SERVICE.hup"
167
+ [ ! -f "$SYSTEM_HUP" ] && errorExit "Missing $SERVICE helmup script => $(color y $SYSTEM_HUP)"
168
+
151
169
  cp $SYSTEM_CHART $SERVICE/$TARGET_CHART
152
170
  cp $SYSTEM_HUP $SERVICE/helmup.plugin
153
171
  git add $SERVICE
@@ -232,7 +250,7 @@ ELASTIC_EXPORTER_CHART_MOD
232
250
  bootstrapLocalSetup prometheus set-values-local
233
251
 
234
252
  ## Install Grafana
235
- bootstrapLocalSetup grafana
253
+ bootstrapLocalSetup grafana ovh-values-local
236
254
 
237
255
  ## Clean up
238
256
  removeHelmRepo prometheus-community
@@ -701,7 +719,7 @@ function doInstall() {
701
719
  ;;
702
720
 
703
721
  "grafana")
704
- bootstrapLocalSetup grafana
722
+ bootstrapLocalSetup grafana ovh-values-local
705
723
  ;;
706
724
 
707
725
  "monitoring")
@@ -0,0 +1,23 @@
1
+ #!/bin/bash
2
+ #
3
+ # Do not move to 7.17+ until the memory explosion problem is resolved
4
+ #
5
+ ES_VERSION="7.16"
6
+
7
+ showInstalling "Elastic Search Cluster v${ES_VERSION}"
8
+
9
+ addHelmRepo elastic https://helm.elastic.co
10
+
11
+ deployES() {
12
+ ES_TYPE="elasticsearch-${1}"
13
+ printf "\n Deploying ES cluster component: `color y "$ES_TYPE"`\n"
14
+ helm upgrade --install $ES_TYPE elastic/elasticsearch \
15
+ --version $ES_VERSION \
16
+ --values elastic-cluster/$ES_TYPE.yaml
17
+ }
18
+
19
+ deployES "master"
20
+ deployES "client"
21
+ deployES "data"
22
+
23
+ removeHelmRepo elastic
@@ -1,3 +1,15 @@
1
+ # Foundation Chart: https://artifacthub.io/packages/helm/elastic/elasticsearch
2
+ #
3
+ # esJavaOpts: "" # example: "-Xmx1g -Xms1g"
4
+ #
5
+ # resources:
6
+ # requests:
7
+ # cpu: "1000m"
8
+ # memory: "2Gi"
9
+ # limits:
10
+ # cpu: "1000m"
11
+ # memory: "2Gi"
12
+
1
13
  tolerations:
2
14
  - key: "database"
3
15
  operator: "Equal"
@@ -12,3 +24,15 @@ nodeAffinity:
12
24
  operator: In
13
25
  values:
14
26
  - database
27
+
28
+ # RecovR Prd Settings - very beefy on an n2-standard-8
29
+ #
30
+ # esJavaOpts: "-Xmx8g -Xms8g"
31
+ #
32
+ # resources:
33
+ # requests:
34
+ # cpu: "6250m"
35
+ # memory: "16Gi"
36
+ # limits:
37
+ # cpu: "6750m"
38
+ # memory: "20Gi"
@@ -0,0 +1,54 @@
1
+ service:
2
+ type: "NodePort"
3
+ port: "9000"
4
+
5
+ datasources:
6
+ datasources.yaml:
7
+ apiVersion: 1
8
+ datasources:
9
+ - name: kubernetes
10
+ type: prometheus
11
+ url: http://prometheus-server.monitoring.svc.cluster.local
12
+ isDefault: true
13
+
14
+ persistence:
15
+ enabled: true
16
+ storageClassName: ssd
17
+
18
+ plugins:
19
+ - grafana-piechart-panel
20
+ - agenty-flowcharting-panel
21
+
22
+ deploymentStrategy:
23
+ type: Recreate
24
+
25
+ affinity:
26
+ nodeAffinity:
27
+ requiredDuringSchedulingIgnoredDuringExecution:
28
+ nodeSelectorTerms:
29
+ - matchExpressions:
30
+ - key: target-env
31
+ operator: In
32
+ values:
33
+ - database
34
+ tolerations:
35
+ - key: "database"
36
+ operator: "Equal"
37
+ value: "true"
38
+ effect: "NoSchedule"
39
+
40
+ extraObjects:
41
+ - apiVersion: traefik.containo.us/v1alpha1
42
+ kind: IngressRoute
43
+ metadata:
44
+ name: grafana
45
+ namespace: monitoring
46
+ spec:
47
+ entryPoints:
48
+ - websecure
49
+ routes:
50
+ - match: Host(`OVH:<PROJECT_ID>-monitoring.OVH:<HOST>.com`)
51
+ kind: Rule
52
+ services:
53
+ - name: grafana
54
+ port: 9000
@@ -202,7 +202,7 @@ serverFiles:
202
202
  severity: error
203
203
  annotations:
204
204
  summary: "Kubernetes Pod not healthy"
205
- description: "Pod {{ $labels.pod }} has been in a non-ready state for longer than a 10m."
205
+ description: "Pod {{ $labels.pod }} has been in a non-ready state for longer than 10 minutes."
206
206
  dashboard: "Check the pod status using the Kubernetes UI"
207
207
 
208
208
  - alert: KubernetesPodCrashLooping
@@ -36,7 +36,7 @@ cat<<DONE_VELERO
36
36
 
37
37
  Velero docs => `color g 'open https://velero.io/docs'`
38
38
 
39
- Wait at least 1 minute before kicking off the following backups:
39
+ `color y 'Wait at least 1 minute before kicking off the following backups:'`
40
40
 
41
41
  `color g 'velero backup create --from-schedule velero-full'`
42
42
  `color g 'velero backup create --from-schedule velero-psql'`
@@ -1,29 +0,0 @@
1
- service:
2
- type: "NodePort"
3
- port: "9000"
4
-
5
- persistence:
6
- enabled: true
7
- storageClassName: ssd
8
-
9
- plugins:
10
- - grafana-piechart-panel
11
- - agenty-flowcharting-panel
12
-
13
- deploymentStrategy:
14
- type: Recreate
15
-
16
- affinity:
17
- nodeAffinity:
18
- requiredDuringSchedulingIgnoredDuringExecution:
19
- nodeSelectorTerms:
20
- - matchExpressions:
21
- - key: target-env
22
- operator: In
23
- values:
24
- - database
25
- tolerations:
26
- - key: "database"
27
- operator: "Equal"
28
- value: "true"
29
- effect: "NoSchedule"