@leverege/build-tools 2.5.26 → 2.5.28
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/lib/server/overwhelm.js +1 -1
- package/lib/server/repo-init/config.tgz +0 -0
- package/lib/web/overwhelm.js +1 -1
- package/package.json +8 -8
- package/src/helmdn +1 -1
- package/src/helmup +48 -8
- package/src/install-traefik +8 -3
- package/src/overwhelm.js +1 -1
package/lib/server/overwhelm.js
CHANGED
|
@@ -275,7 +275,7 @@ ahoy.forEach(dir => {
|
|
|
275
275
|
}
|
|
276
276
|
}); // we can also apply replaceables to any top level .ovh files to support top level config maps
|
|
277
277
|
|
|
278
|
-
glob.sync('
|
|
278
|
+
glob.sync('**/*.ovh').forEach(cfgmap => {
|
|
279
279
|
const target = cfgmap.replace(/.ovh$/, '');
|
|
280
280
|
let valuesOut = fs.readFileSync(cfgmap, {
|
|
281
281
|
encoding: 'utf-8'
|
|
Binary file
|
package/lib/web/overwhelm.js
CHANGED
|
@@ -275,7 +275,7 @@ ahoy.forEach(dir => {
|
|
|
275
275
|
}
|
|
276
276
|
}); // we can also apply replaceables to any top level .ovh files to support top level config maps
|
|
277
277
|
|
|
278
|
-
glob.sync('
|
|
278
|
+
glob.sync('**/*.ovh').forEach(cfgmap => {
|
|
279
279
|
const target = cfgmap.replace(/.ovh$/, '');
|
|
280
280
|
let valuesOut = fs.readFileSync(cfgmap, {
|
|
281
281
|
encoding: 'utf-8'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.28",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -63,21 +63,21 @@
|
|
|
63
63
|
"inquirer": "^7.3.3",
|
|
64
64
|
"js-yaml": "^4.0.0",
|
|
65
65
|
"ncp": "^2.0.0",
|
|
66
|
-
"npm-check-updates": "^11.1.
|
|
66
|
+
"npm-check-updates": "^11.1.4",
|
|
67
67
|
"npm-registry-fetch": "^9.0.0",
|
|
68
|
-
"open": "^7.4.
|
|
68
|
+
"open": "^7.4.2",
|
|
69
69
|
"ora": "^5.3.0",
|
|
70
70
|
"parse-gitignore": "^1.0.1",
|
|
71
71
|
"readline-sync": "^1.4.10",
|
|
72
72
|
"semver": "^7.3.4",
|
|
73
|
-
"simple-git": "^2.
|
|
73
|
+
"simple-git": "^2.35.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@babel/cli": "^7.12.
|
|
77
|
-
"@babel/core": "^7.12.
|
|
78
|
-
"@babel/node": "^7.12.
|
|
76
|
+
"@babel/cli": "^7.12.17",
|
|
77
|
+
"@babel/core": "^7.12.17",
|
|
78
|
+
"@babel/node": "^7.12.17",
|
|
79
79
|
"@leverege/babel-preset-leverege-node": "^1.1.1",
|
|
80
80
|
"@leverege/eslint-config-leverege": "^2.2.0",
|
|
81
|
-
"npm": "^7.5.
|
|
81
|
+
"npm": "^7.5.4"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/src/helmdn
CHANGED
package/src/helmup
CHANGED
|
@@ -32,6 +32,7 @@ SYSTEM=(
|
|
|
32
32
|
timescale-db
|
|
33
33
|
monitoring
|
|
34
34
|
reloader
|
|
35
|
+
traefik
|
|
35
36
|
velero
|
|
36
37
|
)
|
|
37
38
|
|
|
@@ -64,13 +65,17 @@ function generatePassword(){
|
|
|
64
65
|
echo $RANDOMPW
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
function
|
|
68
|
+
function createNamespaceIfNeeded(){
|
|
68
69
|
# Check the namespace exists in kubernetes
|
|
69
|
-
kubectl get namespace
|
|
70
|
+
kubectl get namespace $1 &> /dev/null
|
|
70
71
|
if [[ $? -eq 1 ]]; then
|
|
71
|
-
printf "\n*** Creating
|
|
72
|
-
kubectl create namespace
|
|
72
|
+
printf "\n*** Creating $1 namespace ***\n\n"
|
|
73
|
+
kubectl create namespace $1
|
|
73
74
|
fi
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function installMonitoringCharts(){
|
|
78
|
+
createNamespaceIfNeeded monitoring
|
|
74
79
|
|
|
75
80
|
# Add necessary helm repositories - note that stable is deprecated
|
|
76
81
|
printf "\nAdding and updating helm repositories...\n"
|
|
@@ -147,20 +152,20 @@ SA_EXISTS
|
|
|
147
152
|
## Install Prometheus
|
|
148
153
|
helm upgrade --install prometheus prometheus-community/prometheus \
|
|
149
154
|
--namespace monitoring \
|
|
150
|
-
|
|
155
|
+
--values prometheus/values.yaml \
|
|
151
156
|
--version 13.2.1
|
|
152
157
|
|
|
153
158
|
## Installing ES exporter
|
|
154
159
|
helm upgrade --install elasticsearch-exporter prometheus-community/prometheus-elasticsearch-exporter \
|
|
155
160
|
--namespace monitoring \
|
|
156
|
-
|
|
161
|
+
--values elasticsearch-exporter/values-es-exporter.yaml \
|
|
157
162
|
--version 4.1.0
|
|
158
163
|
|
|
159
164
|
## Install Grafana
|
|
160
165
|
helm repo add grafana https://grafana.github.io/helm-charts && helm repo update
|
|
161
166
|
helm upgrade --install grafana grafana/grafana \
|
|
162
167
|
--namespace monitoring \
|
|
163
|
-
|
|
168
|
+
--values grafana/values-grafana.yaml \
|
|
164
169
|
--version 6.2.2
|
|
165
170
|
}
|
|
166
171
|
|
|
@@ -214,6 +219,37 @@ function checkSSDStorageClass(){
|
|
|
214
219
|
printf "\n*** Attaching PVC to SSD Class ***\n\n"
|
|
215
220
|
}
|
|
216
221
|
|
|
222
|
+
function getManagedSecret() {
|
|
223
|
+
local SECNAME=$1
|
|
224
|
+
local PROJECT="${2:-leverege-docker-images}"
|
|
225
|
+
SECRET=$(gcloud secrets versions access latest --secret=$SECNAME --project=$PROJECT)
|
|
226
|
+
echo $SECRET
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function installTraefik() {
|
|
230
|
+
createNamespaceIfNeeded traefik
|
|
231
|
+
|
|
232
|
+
kubectl get secret cloudflare --namespace traefik &>/dev/null
|
|
233
|
+
if [[ $? -eq 1 ]]; then
|
|
234
|
+
cat<<NEED_TRAEFIK_SECRET
|
|
235
|
+
`color r "***ERROR:"` missing secret: `color y cloudflare` namespace: `color y traefik`
|
|
236
|
+
|
|
237
|
+
This secret may be fetched from the leverege-docker-images cluster and
|
|
238
|
+
properly injected into this cluster.
|
|
239
|
+
NEED_TRAEFIK_SECRET
|
|
240
|
+
yesToContinue "to copy and inject the cloudflare secret"
|
|
241
|
+
TOKEN=$(getManagedSecret "CLOUDFLARE_API_TOKEN")
|
|
242
|
+
exitOnError $? "Failed to fetch the secret from leverege-docker-images"
|
|
243
|
+
kubectl create secret generic cloudflare \
|
|
244
|
+
--namespace traefik \
|
|
245
|
+
--from-literal=dns-token=$TOKEN
|
|
246
|
+
fi
|
|
247
|
+
|
|
248
|
+
helm upgrade --install traefik traefik/traefik \
|
|
249
|
+
--namespace traefik \
|
|
250
|
+
--values traefik/traefik-values.yaml
|
|
251
|
+
}
|
|
252
|
+
|
|
217
253
|
function installVelero() {
|
|
218
254
|
## Set the project id by parsing current context
|
|
219
255
|
currContext=`kubectl config current-context`
|
|
@@ -451,7 +487,11 @@ function doInstall() {
|
|
|
451
487
|
transponder-*)
|
|
452
488
|
# transponders use the same chart but different deployment name
|
|
453
489
|
helm upgrade --install $SERVICE leverege/transponder \
|
|
454
|
-
|
|
490
|
+
--values $SERVICE/values.yaml
|
|
491
|
+
;;
|
|
492
|
+
|
|
493
|
+
"traefik")
|
|
494
|
+
installTraefik
|
|
455
495
|
;;
|
|
456
496
|
|
|
457
497
|
"velero")
|
package/src/install-traefik
CHANGED
|
@@ -4,17 +4,18 @@ cat<<TRAEFIK_CERT
|
|
|
4
4
|
|
|
5
5
|
*** This is currently informational only ***
|
|
6
6
|
|
|
7
|
+
overwhelm
|
|
7
8
|
helm repo add traefik https://containous.github.io/traefik-helm-chart
|
|
8
9
|
helm repo add jetstack https://charts.jetstack.io
|
|
9
10
|
helm repo update
|
|
10
11
|
|
|
11
12
|
kubectl create namespace cert-manager
|
|
12
13
|
kubectl create secret generic cloudflare --namespace cert-manager \
|
|
13
|
-
--from-literal=dns-token=
|
|
14
|
+
--from-literal=dns-token="CLOUD FLARE API TOKEN KEEWEB"
|
|
14
15
|
|
|
15
16
|
kubectl create namespace traefik
|
|
16
17
|
kubectl create secret generic cloudflare --namespace traefik \
|
|
17
|
-
--from-literal=dns-token=
|
|
18
|
+
--from-literal=dns-token="CLOUD FLARE API TOKEN KEEWEB"
|
|
18
19
|
|
|
19
20
|
helm install --namespace traefik traefik traefik/traefik -f traefik/traefik-values.yaml
|
|
20
21
|
|
|
@@ -33,5 +34,9 @@ helm install \
|
|
|
33
34
|
# this token is a cox2m token
|
|
34
35
|
kubectl apply --namespace cert-manager -f cert-manager
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
# to describe the cert
|
|
38
|
+
kubectl describe certificate --namespace cert-manager
|
|
39
|
+
|
|
40
|
+
# to delete the issuer
|
|
41
|
+
kubectl -n cert-manager delete clusterissuer <issuer name?>
|
|
37
42
|
TRAEFIK_CERT
|
package/src/overwhelm.js
CHANGED
|
@@ -230,7 +230,7 @@ ahoy.forEach( ( dir ) => {
|
|
|
230
230
|
} )
|
|
231
231
|
|
|
232
232
|
// we can also apply replaceables to any top level .ovh files to support top level config maps
|
|
233
|
-
glob.sync( '
|
|
233
|
+
glob.sync( '**/*.ovh' ).forEach( ( cfgmap ) => {
|
|
234
234
|
const target = cfgmap.replace(/.ovh$/,'')
|
|
235
235
|
let valuesOut = fs.readFileSync( cfgmap, { encoding : 'utf-8' } )
|
|
236
236
|
valuesOut = doReplacements( valuesOut, over )
|