@leverege/build-tools 2.5.9 → 2.5.11
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 +12 -11
- package/src/helmup +28 -20
- package/src/klog +34 -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.11",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"helmup": "src/helmup",
|
|
36
36
|
"k8scale": "src/k8scale",
|
|
37
37
|
"k8x": "src/k8x",
|
|
38
|
+
"klog": "src/klog",
|
|
38
39
|
"npm-link": "src/npm-link",
|
|
39
40
|
"npm-unlink": "src/npm-unlink",
|
|
40
41
|
"overwhelm": "src/overwhelm.js",
|
|
@@ -52,30 +53,30 @@
|
|
|
52
53
|
"clear": "^0.1.0",
|
|
53
54
|
"clipboardy": "^2.3.0",
|
|
54
55
|
"command-line-args": "^5.1.1",
|
|
55
|
-
"command-line-usage": "^6.1.
|
|
56
|
+
"command-line-usage": "^6.1.1",
|
|
56
57
|
"dotenv": "^8.2.0",
|
|
57
|
-
"execa": "^4.0
|
|
58
|
+
"execa": "^4.1.0",
|
|
58
59
|
"figlet": "^1.5.0",
|
|
59
60
|
"git-branch": "^2.0.1",
|
|
60
61
|
"glob": "^7.1.6",
|
|
61
62
|
"inquirer": "^7.3.3",
|
|
62
63
|
"js-yaml": "^3.14.0",
|
|
63
64
|
"ncp": "^2.0.0",
|
|
64
|
-
"npm-check-updates": "^
|
|
65
|
-
"npm-registry-fetch": "^
|
|
65
|
+
"npm-check-updates": "^10.2.2",
|
|
66
|
+
"npm-registry-fetch": "^9.0.0",
|
|
66
67
|
"open": "^7.3.0",
|
|
67
68
|
"ora": "^5.1.0",
|
|
68
69
|
"parse-gitignore": "^1.0.1",
|
|
69
70
|
"readline-sync": "^1.4.10",
|
|
70
71
|
"semver": "^7.3.2",
|
|
71
|
-
"simple-git": "^2.
|
|
72
|
+
"simple-git": "^2.23.0"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
|
-
"@babel/cli": "^7.12.
|
|
75
|
-
"@babel/core": "^7.12.
|
|
76
|
-
"@babel/node": "^7.12.
|
|
75
|
+
"@babel/cli": "^7.12.7",
|
|
76
|
+
"@babel/core": "^7.12.7",
|
|
77
|
+
"@babel/node": "^7.12.6",
|
|
77
78
|
"@leverege/babel-preset-leverege-node": "^1.1.1",
|
|
78
|
-
"@leverege/eslint-config-leverege": "^2.
|
|
79
|
-
"npm": "^6.14.
|
|
79
|
+
"@leverege/eslint-config-leverege": "^2.2.0",
|
|
80
|
+
"npm": "^6.14.9"
|
|
80
81
|
}
|
|
81
82
|
}
|
package/src/helmup
CHANGED
|
@@ -13,20 +13,18 @@ PLATFORM=(
|
|
|
13
13
|
messenger
|
|
14
14
|
reason
|
|
15
15
|
scheduler
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
transponder-bq
|
|
17
|
+
transponder-rt
|
|
18
|
+
transponder-postgres
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
SYSTEM=(
|
|
22
|
-
# coredns
|
|
23
22
|
elastic
|
|
24
23
|
redis
|
|
25
24
|
postgres
|
|
26
25
|
velero
|
|
27
26
|
reloader
|
|
28
27
|
monitoring
|
|
29
|
-
# custom-metrics
|
|
30
28
|
)
|
|
31
29
|
|
|
32
30
|
# Simple ANSI color coded string generator.
|
|
@@ -317,6 +315,7 @@ function installVelero() {
|
|
|
317
315
|
kubectl create secret generic velero-credentials --namespace velero --from-file cloud=credentials-velero
|
|
318
316
|
|
|
319
317
|
## Install velero
|
|
318
|
+
helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
|
|
320
319
|
helm upgrade --install velero vmware-tanzu/velero \
|
|
321
320
|
--namespace velero \
|
|
322
321
|
--set configuration.provider="gcp" \
|
|
@@ -388,7 +387,18 @@ helm repo update &> /dev/null # && helm search leverege
|
|
|
388
387
|
# of the standard setup scripts.
|
|
389
388
|
function ifPluggedIn() {
|
|
390
389
|
PLUGIN="$1/helmup.plugin"
|
|
391
|
-
[ ! -
|
|
390
|
+
[ ! -f $PLUGIN ] && return 1
|
|
391
|
+
|
|
392
|
+
if [ ! -x $PLUGIN ];
|
|
393
|
+
then
|
|
394
|
+
cat<<PLUGIN_NOEXEC
|
|
395
|
+
$RED_ERROR The plugin file is preset but is not executable.
|
|
396
|
+
Try running => `color y "chmod +x $PLUGIN"`
|
|
397
|
+
|
|
398
|
+
PLUGIN_NOEXEC
|
|
399
|
+
exit 1
|
|
400
|
+
fi
|
|
401
|
+
|
|
392
402
|
printf "\n***Executing local plugin code => `color y $PLUGIN`\n\n" && sleep 2
|
|
393
403
|
. $PLUGIN # executing with . allows the plugin to use functions like color
|
|
394
404
|
return 0
|
|
@@ -433,6 +443,10 @@ function doInstall() {
|
|
|
433
443
|
printf "\nGithub repo is here => https://github.com/helm/charts/tree/master/stable/coredns\n\n"
|
|
434
444
|
;;
|
|
435
445
|
|
|
446
|
+
"custom-metrics")
|
|
447
|
+
kubectl create -f https://raw.githubusercontent.com/GoogleCloudPlatform/k8s-stackdriver/master/custom-metrics-stackdriver-adapter/deploy/production/adapter.yaml
|
|
448
|
+
;;
|
|
449
|
+
|
|
436
450
|
"elastic"|"elasticsearch")
|
|
437
451
|
checkSSDStorageClass
|
|
438
452
|
helm repo add elastic https://helm.elastic.co
|
|
@@ -449,14 +463,6 @@ function doInstall() {
|
|
|
449
463
|
monitoringHelp
|
|
450
464
|
;;
|
|
451
465
|
|
|
452
|
-
"mysql")
|
|
453
|
-
helm upgrade --install mysql stable/mysql -f mysql/mysql-values.yaml --version 1.6.3
|
|
454
|
-
printf "\n***Proxy 4306 with this => kubectl port-forward svc/mysql 4306:3306\n\n"
|
|
455
|
-
printf "\n***Grab MYSQL Root Password => MYSQL_ROOT_PASSWORD=\$(kubectl get secret --namespace default mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo)"
|
|
456
|
-
printf "\n***Set MYSQL_HOST to 127.0.0.1 and MYSQL_PORT to 4306 and run => mysql -h \${MYSQL_HOST} -P\${MYSQL_PORT} -u root -p\${MYSQL_ROOT_PASSWORD} \n\n"
|
|
457
|
-
printf "\n***Set Make sure to make api-server an admin \n\n"
|
|
458
|
-
;;
|
|
459
|
-
|
|
460
466
|
"polaris")
|
|
461
467
|
helm repo add reactiveops-stable https://charts.reactiveops.com/stable
|
|
462
468
|
helm upgrade --install polaris reactiveops-stable/polaris --namespace polaris
|
|
@@ -477,23 +483,25 @@ function doInstall() {
|
|
|
477
483
|
printf "To start a specific version => `color c 'REDIS_HELM_CHART="v9.1.5" helmup redis'`\n\n"
|
|
478
484
|
;;
|
|
479
485
|
|
|
486
|
+
"reloader")
|
|
487
|
+
helm upgrade --install reloader stakater/reloader
|
|
488
|
+
;;
|
|
489
|
+
|
|
480
490
|
"timescale-db")
|
|
481
491
|
checkTimescalePassword
|
|
482
492
|
helm upgrade --install timescale-db leverege/timescale-db
|
|
483
493
|
;;
|
|
484
494
|
|
|
485
|
-
"
|
|
486
|
-
|
|
495
|
+
"transponder-*")
|
|
496
|
+
# transponders use the same chart but different deployment name
|
|
497
|
+
helm upgrade --install $SERVICE leverege/transponder \
|
|
498
|
+
-f $SERVICE/values.yaml
|
|
487
499
|
;;
|
|
488
500
|
|
|
489
501
|
"velero")
|
|
490
502
|
installVelero # because it's a little more involved
|
|
491
503
|
;;
|
|
492
504
|
|
|
493
|
-
"reloader")
|
|
494
|
-
helm upgrade --install reloader stakater/reloader
|
|
495
|
-
;;
|
|
496
|
-
|
|
497
505
|
*)
|
|
498
506
|
if [ ! -d $SERVICE ] || [ ! -f $SERVICE/values-local.yaml ];
|
|
499
507
|
then
|
package/src/klog
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
[ -f overwhelm.yaml ] && [ -f package.json ] && npm run ahoy
|
|
4
|
+
|
|
5
|
+
[ ! -x "$(command -v fzf)" ] && printf "\n***ERROR: Missing fzf fuzzy matcher => brew install fzf\n\n" && exit 1
|
|
6
|
+
|
|
7
|
+
# Pipes the output from kubectl into the fuzzy matcher which will yield:
|
|
8
|
+
# default message-processor-6b48cf68c6-8zblz 1/1 Running etc...
|
|
9
|
+
KUBEOUT=$(kubectl get pods --all-namespaces -owide | fzf | awk '{print $1, $2}')
|
|
10
|
+
|
|
11
|
+
# split the namespace and full pod name from a string which will yield:
|
|
12
|
+
# default message-processor-6b48cf68c6-8zblz
|
|
13
|
+
IFS=" " read NAMESPACE PODNAME <<< "$KUBEOUT" && unset IFS
|
|
14
|
+
|
|
15
|
+
# splits the full pod name on dashes which will yield an array of:
|
|
16
|
+
# message processor 6b48cf68c6 8zblz
|
|
17
|
+
IFS=- read -a PODCHUNKS <<< "$PODNAME"
|
|
18
|
+
|
|
19
|
+
# the chop length is the array length minus 2 to lop off the last two elements
|
|
20
|
+
CHOPLEN="${#PODCHUNKS[@]}-2"
|
|
21
|
+
|
|
22
|
+
# slice the array by lopping off the last two elements in the array yielding:
|
|
23
|
+
# message processor
|
|
24
|
+
SLICED="${PODCHUNKS[@]:0:$CHOPLEN}"
|
|
25
|
+
|
|
26
|
+
# keep in mind the slice above yields a string, so now we replace the spaces:
|
|
27
|
+
# message-processor
|
|
28
|
+
CONTAINER=${SLICED// /-}
|
|
29
|
+
DTS="`date +\"%Y%m%d-%H%M%S\"`"
|
|
30
|
+
|
|
31
|
+
kubecmd="kubectl logs --tail=50 --follow -c $CONTAINER --namespace $NAMESPACE $PODNAME | tee $CONTAINER-$DTS.log | pino-pretty"
|
|
32
|
+
echo " run=[${kubecmd}]"
|
|
33
|
+
|
|
34
|
+
eval ${kubecmd}
|