@leverege/build-tools 2.80.1 → 2.82.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/.vscode/launch.json +22 -0
- package/package.json +7 -6
- package/src/Utils.mjs +2 -2
- package/src/bash-funcs +21 -0
- package/src/bitnami-audit.mjs +169 -0
- package/src/bitnami-audit.sh +75 -0
- package/src/bitnami-to-leverege-artifacts.sh +140 -0
- package/src/count-lines-of-code.mjs +6 -4
- package/src/crane-lift.sh +11 -0
- package/src/helm-charts/argocd/.nohelm +0 -0
- package/src/helm-charts/argocd/.nohelmdn +0 -0
- package/src/helm-charts/argocd/helmup.bootstrap +3 -0
- package/src/helm-charts/argocd/helmup.plugin +3 -0
- package/src/helm-charts/cnpg-db-pgbench/helmup.bootstrap +11 -0
- package/src/helm-charts/cnpg-db-psql-stack/helmup.bootstrap +11 -0
- package/src/helm-charts/cnpg-db-psql-stack/helmup.plugin +1 -1
- package/src/helm-charts/cnpg-db-recovery/helmup.bootstrap +11 -0
- package/src/helm-charts/cnpg-db-recovery/helmup.plugin +1 -1
- package/src/helm-charts/cnpg-db-tsdb-basic/helmup.bootstrap +11 -0
- package/src/helm-charts/cnpg-db-tsdb-basic/helmup.plugin +1 -1
- package/src/helm-charts/cnpg-db-tsdb-dense/helmup.bootstrap +11 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/helmup.plugin +1 -1
- package/src/helm-charts/cnpg-operator/helmdn.plugin +1 -1
- package/src/helm-charts/cnpg-operator/helmup.bootstrap +201 -0
- package/src/helm-charts/cnpg-operator/helmup.plugin +1 -1
- package/src/helm-charts/cnpg-operator/operand.bootstrap +41 -0
- package/src/helm-charts/elasticsearch8/elasticsearch-local-dev.yaml +9 -0
- package/src/helm-charts/elasticsearch8/elasticsearch-local-prd.yaml +9 -0
- package/src/helm-charts/elasticsearch8/helmup.plugin +3 -3
- package/src/helm-charts/pgbouncer/helmup.bootstrap +24 -0
- package/src/helm-charts/postgres/.nohelm +0 -0
- package/src/helm-charts/postgres/.nohelmdn +0 -0
- package/src/helm-charts/postgres/README.md +6 -0
- package/src/helm-charts/postgres/helmdn.plugin +3 -0
- package/src/helm-charts/postgres/helmup.plugin +21 -0
- package/src/helm-charts/postgres/postgres-local.yaml +51 -0
- package/src/helm-charts/prom-operator/helmup.bootstrap +47 -0
- package/src/helm-charts/prom-operator/rules/traefik-rules.yaml +2 -2
- package/src/helm-charts/prom-operator/stackdriver-exporter.yaml.ovh +2 -1
- package/src/helm-charts/redis/helmup.plugin +2 -2
- package/src/helm-charts/redis/values-local.yaml +14 -0
- package/src/helm-charts/traefik/helmup.plugin +1 -1
- package/src/helm-charts/traefik/values-local.yaml +1 -1
- package/src/helm-charts/valkey/helmup.plugin +3 -3
- package/src/helm-charts/valkey/valkey-local.yaml +11 -1
- package/src/helm-charts/velero/helmup.bootstrap +104 -0
- package/src/helm-charts/velero/helmup.plugin +1 -1
- package/src/helmdn.sh +2 -1
- package/src/helmup.sh +65 -644
- package/src/init-my-chart.mjs +18 -0
- package/src/k8x.sh +4 -0
- package/src/overwhelm.mjs +1 -1
- package/.vscode/settings.json +0 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# lifted from helmup.sh
|
|
4
|
+
function installVeleroEnvironment() {
|
|
5
|
+
# Follows instructions => https://github.com/vmware-tanzu/velero-plugin-for-gcp
|
|
6
|
+
showInstalling "Velero Backup Management"
|
|
7
|
+
createNamespaceIfNeeded velero
|
|
8
|
+
|
|
9
|
+
# Do we need to => gcloud auth application-default
|
|
10
|
+
gcloud config set project $GCP_PROJECT_ID
|
|
11
|
+
|
|
12
|
+
## The major chart version will determine the bucket suffix
|
|
13
|
+
[ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="10"
|
|
14
|
+
|
|
15
|
+
## Create a bucket
|
|
16
|
+
BUCKET="$GCP_PROJECT_ID-velero-$VELERO_CHART_VERSION"
|
|
17
|
+
printf "\nCreating storage bucket `color g $BUCKET` in `color g $GCE_REGION`\n"
|
|
18
|
+
gsutil mb -l $GCE_REGION gs://$BUCKET/ &> $DEVNULL
|
|
19
|
+
warnOnError $? "Bucket failed to create or already exists - go check it\n"
|
|
20
|
+
gsutil ubla set on gs://$BUCKET &> $DEVNULL
|
|
21
|
+
|
|
22
|
+
## Create a service account
|
|
23
|
+
printf "\nCreating the service account\n"
|
|
24
|
+
gcloud iam service-accounts create velero \
|
|
25
|
+
--project $GCP_PROJECT_ID \
|
|
26
|
+
--display-name "Velero service account" \
|
|
27
|
+
--description "Velero service account" &> $DEVNULL
|
|
28
|
+
if [ $? -eq 0 ];
|
|
29
|
+
then
|
|
30
|
+
# no error means a new SA was created - slight delay to let it update
|
|
31
|
+
sleep 2
|
|
32
|
+
else
|
|
33
|
+
printf "$YELO_WARN Failed to create the service account - does it already exist?"
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
SERVICE_ACCOUNT_EMAIL="velero@${GCP_PROJECT_ID}.iam.gserviceaccount.com"
|
|
37
|
+
|
|
38
|
+
## Attach roles
|
|
39
|
+
ROLE_PERMISSIONS=(
|
|
40
|
+
compute.disks.get
|
|
41
|
+
compute.disks.create
|
|
42
|
+
compute.disks.createSnapshot
|
|
43
|
+
compute.projects.get
|
|
44
|
+
compute.snapshots.get
|
|
45
|
+
compute.snapshots.create
|
|
46
|
+
compute.snapshots.useReadOnly
|
|
47
|
+
compute.snapshots.delete
|
|
48
|
+
compute.zones.get
|
|
49
|
+
iam.serviceAccounts.actAs
|
|
50
|
+
iam.serviceAccounts.signBlob
|
|
51
|
+
storage.objects.create
|
|
52
|
+
storage.objects.delete
|
|
53
|
+
storage.objects.get
|
|
54
|
+
storage.objects.list
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
printf "\nAssigning roles to the SA\n"
|
|
58
|
+
gcloud iam roles create velero.server \
|
|
59
|
+
--project $GCP_PROJECT_ID \
|
|
60
|
+
--title "Velero Server" \
|
|
61
|
+
--permissions "$(IFS=","; echo "${ROLE_PERMISSIONS[*]}")" &> $DEVNULL
|
|
62
|
+
if [ $? -ne 0 ];
|
|
63
|
+
then
|
|
64
|
+
# assume error is that role exists so try updating instead
|
|
65
|
+
printf "\nUpdating roles on the SA\n"
|
|
66
|
+
gcloud iam roles update velero.server \
|
|
67
|
+
--project $GCP_PROJECT_ID \
|
|
68
|
+
--title "Velero Server" \
|
|
69
|
+
--permissions "$(IFS=","; echo "${ROLE_PERMISSIONS[*]}")" &> $DEVNULL
|
|
70
|
+
fi
|
|
71
|
+
warnOnError $? "Failed to add roles to velero.server - perhaps they already exist?"
|
|
72
|
+
|
|
73
|
+
printf "\nBinding IAM policy to the SA\n"
|
|
74
|
+
gcloud projects add-iam-policy-binding $GCP_PROJECT_ID \
|
|
75
|
+
--project $GCP_PROJECT_ID \
|
|
76
|
+
--member serviceAccount:$SERVICE_ACCOUNT_EMAIL \
|
|
77
|
+
--condition 'None' \
|
|
78
|
+
--role projects/$GCP_PROJECT_ID/roles/velero.server &> $DEVNULL
|
|
79
|
+
warnOnError $? "gcloud problem binding IAM policy"
|
|
80
|
+
|
|
81
|
+
printf "\nBinding workload identity IAM policy to the SA\n"
|
|
82
|
+
gcloud iam service-accounts add-iam-policy-binding \
|
|
83
|
+
--member "serviceAccount:$GCP_PROJECT_ID.svc.id.goog[velero/velero]" \
|
|
84
|
+
--role roles/iam.workloadIdentityUser \
|
|
85
|
+
$SERVICE_ACCOUNT_EMAIL
|
|
86
|
+
warnOnError $? "gcloud workload identity binding may have failed"
|
|
87
|
+
|
|
88
|
+
printf "\nCreate and annotate the k8s SA\n"
|
|
89
|
+
kubectl create serviceaccount velero --namespace velero
|
|
90
|
+
warnOnError $? "Failed to create k8s SA - perhaps it already exists?"
|
|
91
|
+
|
|
92
|
+
kubectl annotate serviceaccount velero \
|
|
93
|
+
--namespace velero \
|
|
94
|
+
"iam.gke.io/gcp-service-account=$SERVICE_ACCOUNT_EMAIL"
|
|
95
|
+
warnOnError $? "Failed to annotate k8s SA - things may fail"
|
|
96
|
+
|
|
97
|
+
gsutil iam ch serviceAccount:$SERVICE_ACCOUNT_EMAIL:objectAdmin gs://$BUCKET
|
|
98
|
+
|
|
99
|
+
## Clean up from previous failed install
|
|
100
|
+
# kubectl delete volumesnapshotlocation.velero.io -n velero gcp &> $DEVNULL
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
# Run It!
|
|
104
|
+
installVeleroEnvironment
|
|
@@ -7,7 +7,7 @@ addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
|
|
|
7
7
|
[ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="10"
|
|
8
8
|
#
|
|
9
9
|
# Build the bucket, region and SA email variables and use --set to mod the
|
|
10
|
-
# chart values as opposed to using an
|
|
10
|
+
# chart values as opposed to using an ${label} approach. This eliminates
|
|
11
11
|
# the need for an overwhelm generated values.yaml file which also contains
|
|
12
12
|
# all of the contamination from the default-values.yaml file.
|
|
13
13
|
#
|