@leverege/build-tools 2.5.27 → 2.5.29
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/repo-init/config.tgz +0 -0
- package/package.json +8 -8
- package/src/helmdn +2 -1
- package/src/helmup +49 -10
- package/src/install-traefik +4 -0
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.29",
|
|
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
|
@@ -57,6 +57,7 @@ SYSTEM=(
|
|
|
57
57
|
monitoring
|
|
58
58
|
polaris
|
|
59
59
|
redis
|
|
60
|
+
traefik
|
|
60
61
|
velero
|
|
61
62
|
)
|
|
62
63
|
|
|
@@ -93,7 +94,7 @@ function doNuking() {
|
|
|
93
94
|
|
|
94
95
|
if [ "$SERVICE" == "monitoring" ];
|
|
95
96
|
then
|
|
96
|
-
annihilateMonitoring &&
|
|
97
|
+
annihilateMonitoring && continue
|
|
97
98
|
fi
|
|
98
99
|
|
|
99
100
|
if [ "$SERVICE" == "platform" ];
|
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
|
|
|
@@ -186,7 +191,6 @@ function monitoringHelp(){
|
|
|
186
191
|
`color g "Show this helpful message again with"` => `color r "helmup monitoring-wtf"`
|
|
187
192
|
|
|
188
193
|
ACCESS
|
|
189
|
-
exit 0
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
function createSSDYAML(){
|
|
@@ -214,6 +218,37 @@ function checkSSDStorageClass(){
|
|
|
214
218
|
printf "\n*** Attaching PVC to SSD Class ***\n\n"
|
|
215
219
|
}
|
|
216
220
|
|
|
221
|
+
function getManagedSecret() {
|
|
222
|
+
local SECNAME=$1
|
|
223
|
+
local PROJECT="${2:-leverege-docker-images}"
|
|
224
|
+
SECRET=$(gcloud secrets versions access latest --secret=$SECNAME --project=$PROJECT)
|
|
225
|
+
echo $SECRET
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function installTraefik() {
|
|
229
|
+
createNamespaceIfNeeded traefik
|
|
230
|
+
|
|
231
|
+
kubectl get secret cloudflare --namespace traefik &>/dev/null
|
|
232
|
+
if [[ $? -eq 1 ]]; then
|
|
233
|
+
cat<<NEED_TRAEFIK_SECRET
|
|
234
|
+
`color r "***ERROR:"` missing secret: `color y cloudflare` namespace: `color y traefik`
|
|
235
|
+
|
|
236
|
+
This secret may be fetched from the leverege-docker-images cluster and
|
|
237
|
+
properly injected into this cluster.
|
|
238
|
+
NEED_TRAEFIK_SECRET
|
|
239
|
+
yesToContinue "to copy and inject the cloudflare secret"
|
|
240
|
+
TOKEN=$(getManagedSecret "CLOUDFLARE_API_TOKEN")
|
|
241
|
+
exitOnError $? "Failed to fetch the secret from leverege-docker-images"
|
|
242
|
+
kubectl create secret generic cloudflare \
|
|
243
|
+
--namespace traefik \
|
|
244
|
+
--from-literal=dns-token=$TOKEN
|
|
245
|
+
fi
|
|
246
|
+
|
|
247
|
+
helm upgrade --install traefik traefik/traefik \
|
|
248
|
+
--namespace traefik \
|
|
249
|
+
--values traefik/traefik-values.yaml
|
|
250
|
+
}
|
|
251
|
+
|
|
217
252
|
function installVelero() {
|
|
218
253
|
## Set the project id by parsing current context
|
|
219
254
|
currContext=`kubectl config current-context`
|
|
@@ -416,7 +451,7 @@ function doInstall() {
|
|
|
416
451
|
;;
|
|
417
452
|
|
|
418
453
|
"monitoring-wtf")
|
|
419
|
-
monitoringHelp
|
|
454
|
+
monitoringHelp && exit 0
|
|
420
455
|
;;
|
|
421
456
|
|
|
422
457
|
"polaris")
|
|
@@ -451,7 +486,11 @@ function doInstall() {
|
|
|
451
486
|
transponder-*)
|
|
452
487
|
# transponders use the same chart but different deployment name
|
|
453
488
|
helm upgrade --install $SERVICE leverege/transponder \
|
|
454
|
-
|
|
489
|
+
--values $SERVICE/values.yaml
|
|
490
|
+
;;
|
|
491
|
+
|
|
492
|
+
"traefik")
|
|
493
|
+
installTraefik
|
|
455
494
|
;;
|
|
456
495
|
|
|
457
496
|
"velero")
|
package/src/install-traefik
CHANGED
|
@@ -34,5 +34,9 @@ helm install \
|
|
|
34
34
|
# this token is a cox2m token
|
|
35
35
|
kubectl apply --namespace cert-manager -f cert-manager
|
|
36
36
|
|
|
37
|
+
# to describe the cert
|
|
37
38
|
kubectl describe certificate --namespace cert-manager
|
|
39
|
+
|
|
40
|
+
# to delete the issuer
|
|
41
|
+
kubectl -n cert-manager delete clusterissuer <issuer name?>
|
|
38
42
|
TRAEFIK_CERT
|