@leverege/build-tools 2.24.1 → 2.25.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 +6 -4
- package/src/helmdn +1 -0
- package/src/helmup +1 -4
- package/src/k8cryo +13 -0
- package/src/system-charts/postgres-local.yaml +1 -1
- package/src/system-charts/prometheus-local.yaml +10 -10
- package/src/system-charts/velero-local.yaml +12 -5
- package/src/system-charts/velero.hup +7 -4
- package/.vscode/launch.json +0 -29
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.25.0",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"compile": "npm run clean && npm run compile_server && npm run compile_web",
|
|
14
14
|
"compile_server": "NODE_ENV=server babel -d lib/server src/",
|
|
15
15
|
"compile_web": "NODE_ENV=web babel -d lib/web src/",
|
|
16
|
-
"
|
|
16
|
+
"xpostinstall": "src/npm-scripts/postinstall.js",
|
|
17
17
|
"prepublintOnly": "npm run lint && npm run build",
|
|
18
18
|
"prepublishOnly": "npm run compile",
|
|
19
19
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"helmup": "src/helmup",
|
|
33
33
|
"helmwhat": "src/helmup",
|
|
34
34
|
"k8scale": "src/k8scale",
|
|
35
|
+
"k8cryo": "src/k8cryo",
|
|
36
|
+
"k8thaw": "src/k8thaw",
|
|
35
37
|
"k8x": "src/k8x",
|
|
36
38
|
"klog": "src/klog",
|
|
37
39
|
"npm-link": "src/npm-link",
|
|
@@ -53,7 +55,7 @@
|
|
|
53
55
|
"chalk": "^4.1.2",
|
|
54
56
|
"command-line-args": "^5.2.1",
|
|
55
57
|
"command-line-usage": "^6.1.3",
|
|
56
|
-
"deepmerge": "^4.
|
|
58
|
+
"deepmerge": "^4.3.0",
|
|
57
59
|
"dotenv": "^16.0.3",
|
|
58
60
|
"enquirer": "^2.3.6",
|
|
59
61
|
"execa": "^5.1.1",
|
|
@@ -71,6 +73,6 @@
|
|
|
71
73
|
"@babel/core": "^7.20.12",
|
|
72
74
|
"@leverege/babel-preset-leverege-node": "^2.0.0",
|
|
73
75
|
"@leverege/eslint-config-leverege": "^3.0.1",
|
|
74
|
-
"npm": "^9.4.
|
|
76
|
+
"npm": "^9.4.1"
|
|
75
77
|
}
|
|
76
78
|
}
|
package/src/helmdn
CHANGED
package/src/helmup
CHANGED
|
@@ -470,6 +470,7 @@ NEED_TRAEFIK_SECRET
|
|
|
470
470
|
function installVeleroEnvironment() {
|
|
471
471
|
# Follows instructions => https://github.com/vmware-tanzu/velero-plugin-for-gcp
|
|
472
472
|
showInstalling "Velero Backup Management"
|
|
473
|
+
createNamespaceIfNeeded velero
|
|
473
474
|
|
|
474
475
|
gcloud config set project $GCP_PROJECT_ID
|
|
475
476
|
|
|
@@ -548,10 +549,6 @@ function installVeleroEnvironment() {
|
|
|
548
549
|
$SERVICE_ACCOUNT_EMAIL
|
|
549
550
|
warnOnError $? "gcloud workload identity binding may have failed"
|
|
550
551
|
|
|
551
|
-
## Create velero namespace
|
|
552
|
-
kubectl get namespaces velero &>/dev/null
|
|
553
|
-
[ $? -eq 1 ] && kubectl create ns velero
|
|
554
|
-
|
|
555
552
|
printf "\nCreate and annotate the k8s SA\n"
|
|
556
553
|
kubectl create serviceaccount velero --namespace velero
|
|
557
554
|
warnOnError $? "Failed to create k8s SA - perhaps it already exists?"
|
package/src/k8cryo
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
if [ "`basename $0`" == "k8thaw" ];
|
|
4
|
+
then
|
|
5
|
+
errorExit "k8thaw - UNDER CONSTRUCTION"
|
|
6
|
+
fi
|
|
7
|
+
|
|
8
|
+
# Gets the UTC time in the same format that velero schedules use for
|
|
9
|
+
# generating the Date Time Stamp for scheduled backups.
|
|
10
|
+
DTS="`date -u +\"%Y%m%d%H%M%S\"`"
|
|
11
|
+
|
|
12
|
+
# The 1440h specifies the number of hours to keep the backup - 60 days
|
|
13
|
+
velero backup create velero-cryo-$DTS --ttl 1440h
|
|
@@ -737,7 +737,7 @@ serverFiles:
|
|
|
737
737
|
- name: Velero Alerts
|
|
738
738
|
rules:
|
|
739
739
|
- alert: VeleroBackupFailure
|
|
740
|
-
expr: (time() - velero_backup_last_successful_timestamp{
|
|
740
|
+
expr: (time() - velero_backup_last_successful_timestamp{schedule_version=~"2.[0]"} > 108000) and (velero_backup_success_total{schedule!=""} != 0)
|
|
741
741
|
for: 5m
|
|
742
742
|
labels:
|
|
743
743
|
severity: warning
|
|
@@ -745,15 +745,15 @@ serverFiles:
|
|
|
745
745
|
summary: "Velero schedule {{ $labels.schedule }} backup failed to execute properly"
|
|
746
746
|
description: "It has been over 30 hours since the last successful backup"
|
|
747
747
|
dashboard: "OVH:<MONITORING>/velero"
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
748
|
+
# - alert: NoVeleroBackups
|
|
749
|
+
# expr: velero_backup_success_total{schedule!=""} == 0
|
|
750
|
+
# for: 5m
|
|
751
|
+
# labels:
|
|
752
|
+
# severity: warning
|
|
753
|
+
# annotations:
|
|
754
|
+
# summary: "Velero has not made any backups yet"
|
|
755
|
+
# description: "Velero has been broken since cluster initialization because there is no successful backups around"
|
|
756
|
+
# dashboard: "OVH:<MONITORING>/velero"
|
|
757
757
|
|
|
758
758
|
server:
|
|
759
759
|
affinity:
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
# Backup schedules to create.
|
|
3
3
|
#
|
|
4
4
|
schedules:
|
|
5
|
-
|
|
5
|
+
psql:
|
|
6
6
|
disabled: false
|
|
7
|
-
schedule: "0
|
|
7
|
+
schedule: "0 7 * * *"
|
|
8
8
|
template:
|
|
9
9
|
ttl: "720h"
|
|
10
10
|
snapshotVolumes: true
|
|
@@ -13,9 +13,9 @@ schedules:
|
|
|
13
13
|
release: "postgres"
|
|
14
14
|
app: "postgresql"
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
tsdb:
|
|
17
17
|
disabled: false
|
|
18
|
-
schedule: "0
|
|
18
|
+
schedule: "0 8 * * *"
|
|
19
19
|
template:
|
|
20
20
|
ttl: "720h"
|
|
21
21
|
snapshotVolumes: true
|
|
@@ -24,6 +24,12 @@ schedules:
|
|
|
24
24
|
release: "timescale-db"
|
|
25
25
|
app: "postgresql"
|
|
26
26
|
|
|
27
|
+
full:
|
|
28
|
+
disabled: false
|
|
29
|
+
schedule: "0 11 * * *"
|
|
30
|
+
template:
|
|
31
|
+
ttl: "168h"
|
|
32
|
+
|
|
27
33
|
mysql:
|
|
28
34
|
disabled: true
|
|
29
35
|
schedule: "0 4 * * *"
|
|
@@ -69,7 +75,8 @@ labels: {}
|
|
|
69
75
|
|
|
70
76
|
# Additional pod labels for Velero deployment's template. Optional
|
|
71
77
|
# ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
|
72
|
-
podLabels:
|
|
78
|
+
podLabels:
|
|
79
|
+
shedule-version: "2.0"
|
|
73
80
|
|
|
74
81
|
# Tolerations to use for the Velero deployment. Optional.
|
|
75
82
|
tolerations: []
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
|
|
4
4
|
|
|
5
|
-
createNamespaceIfNeeded
|
|
6
|
-
|
|
7
5
|
[ -z "$VELERO_HELM_CHART" ] && VELERO_HELM_CHART="3"
|
|
8
6
|
#
|
|
9
7
|
# Build the bucket, region and SA email variables and use --set to mod the
|
|
@@ -17,6 +15,11 @@ GCE_BUCKET="$GCP_PROJECT_ID-velero-$VELERO_HELM_CHART"
|
|
|
17
15
|
GCE_REGION=`overwhelm -k GCE_REGION`
|
|
18
16
|
GCE_SA_EMAIL="velero@${GCP_PROJECT_ID}.iam.gserviceaccount.com"
|
|
19
17
|
|
|
18
|
+
# Get rid of the previous schedules since we will be defining new schedules
|
|
19
|
+
# in the chart, otherwise any modified pod labels could end up attached to
|
|
20
|
+
# older metrics.
|
|
21
|
+
velero schedule delete --all --confirm &> /dev/null
|
|
22
|
+
|
|
20
23
|
helm upgrade \
|
|
21
24
|
--install velero vmware-tanzu/velero --namespace velero \
|
|
22
25
|
--values velero/velero-local.yaml \
|
|
@@ -32,8 +35,8 @@ cat<<DONE_VELERO
|
|
|
32
35
|
|
|
33
36
|
Wait at least 1 minute before kicking off the following backups:
|
|
34
37
|
|
|
35
|
-
`color g 'velero backup create --from-schedule velero-
|
|
36
|
-
`color g 'velero backup create --from-schedule velero-
|
|
38
|
+
`color g 'velero backup create --from-schedule velero-psql'`
|
|
39
|
+
`color g 'velero backup create --from-schedule velero-tsdb'`
|
|
37
40
|
|
|
38
41
|
This will create initial backups from the defined schedules which should
|
|
39
42
|
avoid alerts from prometheus about backups failing on new installations.
|
package/.vscode/launch.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "firebase deploy",
|
|
11
|
-
"skipFiles": [
|
|
12
|
-
"<node_internals>/**"
|
|
13
|
-
],
|
|
14
|
-
"program": "${workspaceFolder}/src/firebaseDeploy.mjs",
|
|
15
|
-
"console": "integratedTerminal"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"type": "node",
|
|
19
|
-
"request": "launch",
|
|
20
|
-
"name": "unleash",
|
|
21
|
-
"skipFiles": [
|
|
22
|
-
"<node_internals>/**"
|
|
23
|
-
],
|
|
24
|
-
"program": "${workspaceFolder}/src/unleash.js",
|
|
25
|
-
"args": [ "unleasb","unleash-flex" ],
|
|
26
|
-
"console": "integratedTerminal"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|