@leverege/build-tools 2.23.2 → 2.23.4

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.23.2",
3
+ "version": "2.23.4",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -57,7 +57,7 @@
57
57
  "dotenv": "^16.0.3",
58
58
  "enquirer": "^2.3.6",
59
59
  "execa": "^5.1.1",
60
- "glob": "^8.0.3",
60
+ "glob": "^8.1.0",
61
61
  "js-yaml": "^4.1.0",
62
62
  "npm-registry-fetch": "^13.3.1",
63
63
  "parse-gitignore": "^2.0.0",
package/src/helmup CHANGED
@@ -33,7 +33,7 @@ SYSTEM=(
33
33
  preemptible-killer
34
34
  zombie-killer
35
35
  reloader
36
- cert-manager # deprecated
36
+ # cert-manager # deprecated from SYSTEM 01/13/2023
37
37
  traefik
38
38
  velero
39
39
  monitoring # do monitoring last to show password
@@ -137,17 +137,6 @@ function bootstrapLocalSetup() {
137
137
  ifPluggedIn $SERVICE
138
138
  }
139
139
 
140
- function installGrafana() {
141
- ## Install Grafana
142
- addHelmRepo grafana https://grafana.github.io/helm-charts
143
- [ -z "$GRAFANA_HELM_CHART" ] && GRAFANA_HELM_CHART="6"
144
- helm upgrade --install grafana grafana/grafana \
145
- --namespace monitoring \
146
- --values grafana/values-grafana.yaml \
147
- --version $GRAFANA_HELM_CHART
148
- removeHelmRepo grafana
149
- }
150
-
151
140
  function errorIfMissingSecret() {
152
141
  SECRET="$1"
153
142
  kubectl get secret $SECRET &> /dev/null
@@ -478,7 +467,7 @@ NEED_TRAEFIK_SECRET
478
467
  fi
479
468
  }
480
469
 
481
- function installVelero() {
470
+ function installVeleroEnvironment() {
482
471
  # Follows instructions => https://github.com/vmware-tanzu/velero-plugin-for-gcp
483
472
  showInstalling "Velero Backup Management"
484
473
 
@@ -576,63 +565,6 @@ function installVelero() {
576
565
 
577
566
  ## Clean up from previous failed install
578
567
  kubectl delete volumesnapshotlocation.velero.io -n velero gcp &>/dev/null
579
-
580
- ## Install velero chart => https://github.com/vmware-tanzu/helm-charts/blob/main/charts/velero/values.yaml
581
- ## The velero plugin for GCP => https://github.com/vmware-tanzu/velero-plugin-for-gcp
582
- ## Helpful debugging link => https://github.com/vmware-tanzu/helm-charts/issues/351
583
- addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
584
- ## Build velero command
585
- helm upgrade --install velero vmware-tanzu/velero \
586
- --version "$VELERO_HELM_CHART" \
587
- --namespace "velero" \
588
- --set credentials.useSecret="false" \
589
- --set configuration.provider="gcp" \
590
- --set configuration.backupStorageLocation.name="default" \
591
- --set configuration.backupStorageLocation.bucket="${BUCKET}" \
592
- --set configuration.backupStorageLocation.config.serviceAccount="$SERVICE_ACCOUNT_EMAIL" \
593
- --set serviceAccount.server.create="false" \
594
- --set serviceAccount.server.name="velero" \
595
- --set snapshotsEnabled="true" \
596
- --set configuration.volumeSnapshotLocation.name="default" \
597
- --set configuration.volumeSnapshotLocation.config.snapshotLocation="$GCE_REGION" \
598
- --set "initContainers[0].name"="velero-plugin-for-gcp" \
599
- --set "initContainers[0].image"="velero/velero-plugin-for-gcp:v1.5.0" \
600
- --set "initContainers[0].volumeMounts[0].mountPath"="/target" \
601
- --set "initContainers[0].volumeMounts[0].name"="plugins" \
602
- --set schedules.postgresql.schedule="0 2 * * *" \
603
- --set schedules.postgresql.template.ttl="720h" \
604
- --set schedules.postgresql.template.labelSelector.matchLabels.release="postgres" \
605
- --set schedules.postgresql.template.labelSelector.matchLabels.app="postgresql" \
606
- --set schedules.postgresql.template.snapshotVolumes="true" \
607
- --set schedules.timescale.schedule="0 3 * * *" \
608
- --set schedules.timescale.template.ttl="720h" \
609
- --set schedules.timescale.template.labelSelector.matchLabels.release="timescale-db" \
610
- --set schedules.timescale.template.labelSelector.matchLabels.app="postgresql" \
611
- --set schedules.timescale.template.snapshotVolumes="true" \
612
- --set schedules.redis.schedule="*/30 * * * *" \
613
- --set schedules.redis.template.ttl="24h" \
614
- --set schedules.redis.template.labelSelector.matchLabels.name="redis" \
615
- --set schedules.redis.template.snapshotVolumes="true"
616
-
617
- velero get backups
618
- cat<<DONE_VELERO
619
-
620
- Velero docs => `color g 'open https://velero.io/docs'`
621
-
622
- Wait at least 1 minute before kicking off the following backups:
623
-
624
- `color g 'velero backup create --from-schedule velero-postgresql'`
625
- `color g 'velero backup create --from-schedule velero-timescale'`
626
-
627
- This will create initial backups from the defined schedules which should
628
- avoid alerts from prometheus about backups failing on new installations.
629
-
630
- The status of the backups may be checked by running:
631
-
632
- `color g 'overwhelm && velero get backups'`
633
-
634
- DONE_VELERO
635
- removeHelmRepo vmware-tanzu
636
568
  }
637
569
 
638
570
  # If a helmup.plugin file exists and is executable helmup assumes it is
@@ -805,7 +737,8 @@ function doInstall() {
805
737
  ;;
806
738
 
807
739
  "velero")
808
- installVelero # because it's a little more involved
740
+ installVeleroEnvironment
741
+ bootstrapLocalSetup velero
809
742
  ;;
810
743
 
811
744
  *)
@@ -0,0 +1,105 @@
1
+ # Backup schedules to create.
2
+ #
3
+ schedules:
4
+ postgresql:
5
+ disabled: false
6
+ schedule: "0 2 * * *"
7
+ template:
8
+ ttl: "720h"
9
+ snapshotVolumes: true
10
+ labelSelector:
11
+ matchLabels:
12
+ release: "postgres"
13
+ app: "postgresql"
14
+
15
+ timescale:
16
+ disabled: false
17
+ schedule: "0 3 * * *"
18
+ template:
19
+ ttl: "720h"
20
+ snapshotVolumes: true
21
+ labelSelector:
22
+ matchLabels:
23
+ release: "timescale-db"
24
+ app: "postgresql"
25
+
26
+ redis:
27
+ disabled: true
28
+ schedule: "*/30 * * * *"
29
+ template:
30
+ ttl: "24h"
31
+ snapshotVolumes: true
32
+ labelSelector:
33
+ matchLabels:
34
+ name: "redis"
35
+ ##
36
+ ## End of Schedules Section
37
+ ##
38
+
39
+ # Resource requests/limits to specify for the Velero deployment.
40
+ # https://velero.io/docs/v1.6/customize-installation/#customize-resource-requests-and-limits
41
+ resources:
42
+ requests:
43
+ cpu: 250m
44
+ memory: 128Mi
45
+ limits:
46
+ cpu: 300m
47
+ memory: 256Mi
48
+
49
+ # Annotations to add to the Velero deployment's. Optional.
50
+ #
51
+ # If you are using reloader use the following annotation with your VELERO_SECRET_NAME
52
+ annotations: {}
53
+ # secret.reloader.stakater.com/reload: "<VELERO_SECRET_NAME>"
54
+
55
+ # Labels to add to the Velero deployment's. Optional.
56
+ labels: {}
57
+
58
+ # Additional pod labels for Velero deployment's template. Optional
59
+ # ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
60
+ podLabels: {}
61
+
62
+ # Tolerations to use for the Velero deployment. Optional.
63
+ tolerations: []
64
+
65
+ # Affinity to use for the Velero deployment. Optional.
66
+ affinity: {}
67
+
68
+ # Node selector to use for the Velero deployment. Optional.
69
+ nodeSelector: {}
70
+
71
+ # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required.
72
+ # If the value is a string then it is evaluated as a template.
73
+ initContainers:
74
+ - name: velero-plugin-for-gcp
75
+ image: velero/velero-plugin-for-gcp:v1.5.0
76
+ volumeMounts:
77
+ - mountPath: /target
78
+ name: plugins
79
+
80
+ ##
81
+ ## Parameters for the `default` BackupStorageLocation and VolumeSnapshotLocation,
82
+ ## and additional server settings.
83
+ ##
84
+ configuration:
85
+ # Cloud provider being used (e.g. aws, azure, gcp).
86
+ provider: gcp
87
+
88
+ # Parameters for the `default` VolumeSnapshotLocation. See
89
+ # https://velero.io/docs/v1.6/api-types/volumesnapshotlocation/
90
+ volumeSnapshotLocation:
91
+ name: default
92
+
93
+ # Information about the Kubernetes service account Velero uses. The SA is
94
+ # created and bound the first time helmup deploys the service. No need to
95
+ # recreate with each deployment.
96
+ serviceAccount:
97
+ server:
98
+ create: false
99
+ name: velero
100
+
101
+ # Info about the secret to be used by the Velero deployment, which
102
+ # should contain credentials for the cloud provider IAM account you've
103
+ # set up for Velero.
104
+ credentials:
105
+ useSecret: false
@@ -0,0 +1,45 @@
1
+ #!/bin/bash
2
+
3
+ addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
4
+
5
+ [ -z "$VELERO_HELM_CHART" ] && VELERO_HELM_CHART="3"
6
+ #
7
+ # Build the bucket, region and SA email variables and use --set to mod the
8
+ # chart values as opposed to using an OVH:<label> approach. This eliminates
9
+ # the need for an overwhelm generated values.yaml file which also contains
10
+ # all of the contamination from the default-values.yaml file.
11
+ #
12
+ # Note: GCP_PROJECT_ID is passed down from helmup's environment.
13
+ #
14
+ GCE_BUCKET="$GCP_PROJECT_ID-velero-$VELERO_HELM_CHART"
15
+ GCE_REGION=`overwhelm -k GCE_REGION`
16
+ GCE_SA_EMAIL="velero@${GCP_PROJECT_ID}.iam.gserviceaccount.com"
17
+
18
+ helm upgrade \
19
+ --install velero vmware-tanzu/velero --namespace velero \
20
+ --values velero/velero-local.yaml \
21
+ --version $VELERO_HELM_CHART $HELM_WHAT \
22
+ --set configuration.backupStorageLocation.bucket="$GCE_BUCKET" \
23
+ --set configuration.backupStorageLocation.config.serviceAccount="$GCE_SA_EMAIL" \
24
+ --set configuration.volumeSnapshotLocation.config.snapshotLocation="$GCE_REGION"
25
+
26
+ velero schedule get
27
+ cat<<DONE_VELERO
28
+
29
+ Velero docs => `color g 'open https://velero.io/docs'`
30
+
31
+ Wait at least 1 minute before kicking off the following backups:
32
+
33
+ `color g 'velero backup create --from-schedule velero-postgresql'`
34
+ `color g 'velero backup create --from-schedule velero-timescale'`
35
+
36
+ This will create initial backups from the defined schedules which should
37
+ avoid alerts from prometheus about backups failing on new installations.
38
+
39
+ The status of the backups may be checked by running:
40
+
41
+ `color g 'overwhelm && velero get backups'`
42
+
43
+ DONE_VELERO
44
+
45
+ removeHelmRepo vmware-tanzu