@leverege/build-tools 2.27.0 → 2.28.0-beta.2

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.
Files changed (38) hide show
  1. package/package.json +5 -5
  2. package/src/helm-charts/elastic-cluster/.nohelm +0 -0
  3. package/src/helm-charts/elastic-cluster/elasticsearch-client.yaml +51 -0
  4. package/src/helm-charts/elastic-cluster/elasticsearch-data.yaml +51 -0
  5. package/src/helm-charts/elastic-cluster/elasticsearch-master.yaml +51 -0
  6. package/src/helm-charts/elasticsearch/.nohelm +0 -0
  7. package/src/helm-charts/grafana/.nohelm +0 -0
  8. package/src/helm-charts/grafana/gitignore +1 -0
  9. package/src/{system-charts → helm-charts/grafana}/grafana-local.yaml.ovh +1 -0
  10. package/src/helm-charts/postgres/.nohelm +0 -0
  11. package/src/helm-charts/redis/.nohelm +0 -0
  12. package/src/helm-charts/timescale-db/.nohelm +0 -0
  13. package/src/helm-charts/traefik/.nohelm +0 -0
  14. package/src/helm-charts/velero/.nohelm +0 -0
  15. package/src/helmdn +2 -3
  16. package/src/helmup +29 -111
  17. package/src/system-charts/cert-manager-local.yaml +0 -43
  18. package/src/system-charts/cert-manager.hup +0 -37
  19. /package/src/{system-charts/elastic-cluster.hup → helm-charts/elastic-cluster/helmup.plugin} +0 -0
  20. /package/src/{system-charts → helm-charts/elasticsearch}/elasticsearch-local.yaml +0 -0
  21. /package/src/{system-charts/elasticsearch.hup → helm-charts/elasticsearch/helmup.plugin} +0 -0
  22. /package/src/{system-charts/grafana.hup → helm-charts/grafana/helmup.plugin} +0 -0
  23. /package/src/{system-charts/postgres.hup → helm-charts/postgres/helmup.plugin} +0 -0
  24. /package/src/{system-charts → helm-charts/postgres}/postgres-local.yaml +0 -0
  25. /package/src/{system-charts/prometheus.hup → helm-charts/prometheus/helmup.plugin} +0 -0
  26. /package/src/{system-charts/prometheus-local.yaml → helm-charts/prometheus/values-local.yaml} +0 -0
  27. /package/src/{system-charts/redis.hup → helm-charts/redis/helmup.plugin} +0 -0
  28. /package/src/{system-charts → helm-charts/redis}/redis-local.yaml +0 -0
  29. /package/src/{system-charts/stackdriver-exporter.hup → helm-charts/stackdriver-exporter/helmup.plugin} +0 -0
  30. /package/src/{system-charts/stackdriver-exporter-local.yaml → helm-charts/stackdriver-exporter/values-local.yaml} +0 -0
  31. /package/src/{system-charts/timescale-db.hup → helm-charts/timescale-db/helmup.plugin} +0 -0
  32. /package/src/{system-charts → helm-charts/timescale-db}/timescale-db-local.yaml +0 -0
  33. /package/src/{system-charts/traefik.hup → helm-charts/traefik/helmup.plugin} +0 -0
  34. /package/src/{system-charts → helm-charts/traefik}/traefik-local.yaml +0 -0
  35. /package/src/{system-charts → helm-charts/traefik-canary}/traefik-canary-local.yaml +0 -0
  36. /package/src/{system-charts → helm-charts/traefik-canary}/traefik-canary.hup +0 -0
  37. /package/src/{system-charts/velero.hup → helm-charts/velero/helmup.plugin} +0 -0
  38. /package/src/{system-charts → helm-charts/velero}/velero-local.yaml +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.27.0",
3
+ "version": "2.28.0-beta.2",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -55,7 +55,7 @@
55
55
  "chalk": "^4.1.2",
56
56
  "command-line-args": "^5.2.1",
57
57
  "command-line-usage": "^6.1.3",
58
- "deepmerge": "^4.3.0",
58
+ "deepmerge": "^4.3.1",
59
59
  "dotenv": "^16.0.3",
60
60
  "enquirer": "^2.3.6",
61
61
  "execa": "^5.1.1",
@@ -66,13 +66,13 @@
66
66
  "readline-sync": "^1.4.10",
67
67
  "semver": "^7.3.8",
68
68
  "simple-git": "^3.17.0",
69
- "zx": "^7.2.0"
69
+ "zx": "^7.2.1"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@babel/cli": "^7.21.0",
73
- "@babel/core": "^7.21.0",
73
+ "@babel/core": "^7.21.3",
74
74
  "@leverege/babel-preset-leverege-node": "^2.0.0",
75
75
  "@leverege/eslint-config-leverege": "^3.0.1",
76
- "npm": "^9.6.1"
76
+ "npm": "^9.6.2"
77
77
  }
78
78
  }
File without changes
@@ -0,0 +1,51 @@
1
+ # client / coordinating nodes - smart load balancers
2
+ nodeGroup: "client"
3
+ clusterName: "elasticsearch"
4
+
5
+ #esJavaOpts: "-Xmx1g -Xms1g"
6
+ #
7
+ resources:
8
+ limits: #
9
+ cpu: # 1000m default
10
+ memory: "2Gi" # 2Gi
11
+ requests: # values.yaml defaults
12
+ cpu: "200m" # 1000m
13
+ memory: "1500Mi" # 2Gi
14
+
15
+ volumeClaimTemplate:
16
+ storageClassName: "ssd"
17
+ resources:
18
+ requests:
19
+ storage: "1Gi"
20
+
21
+ roles: # client / coordinator
22
+ master: "false"
23
+ ingest: "false"
24
+ data: "false"
25
+ remote_cluster_client: "false"
26
+ ml: "false"
27
+
28
+ replicas: 3
29
+ antiAffinity: "hard" # hard is default
30
+
31
+ esConfig:
32
+ elasticsearch.yml: |
33
+ xpack.security.enabled: false
34
+
35
+ persistence:
36
+ enabled: false
37
+
38
+ tolerations:
39
+ - key: "elastic"
40
+ operator: "Equal"
41
+ value: "true"
42
+ effect: "NoSchedule"
43
+
44
+ nodeAffinity:
45
+ requiredDuringSchedulingIgnoredDuringExecution:
46
+ nodeSelectorTerms:
47
+ - matchExpressions:
48
+ - key: target-env
49
+ operator: In
50
+ values:
51
+ - elastic
@@ -0,0 +1,51 @@
1
+ #
2
+ nodeGroup: "data"
3
+ clusterName: "elasticsearch"
4
+
5
+ esJavaOpts: "-Xmx4g -Xms4g"
6
+
7
+ resources:
8
+ limits: #
9
+ cpu: # 1000m default
10
+ memory: "8Gi" # 2Gi
11
+ requests: # values.yaml defaults
12
+ cpu: "1000m" # 1000m
13
+ memory: "4Gi" # 2Gi
14
+
15
+ volumeClaimTemplate:
16
+ storageClassName: "ssd"
17
+ resources:
18
+ requests:
19
+ storage: "64Gi"
20
+
21
+ roles: # data
22
+ master: "false"
23
+ ingest: "true"
24
+ data: "true"
25
+ remote_cluster_client: "false"
26
+ ml: "false"
27
+
28
+ replicas: 3
29
+ antiAffinity: "soft" # hard is default
30
+
31
+ esConfig:
32
+ elasticsearch.yml: |
33
+ xpack.security.enabled: false
34
+
35
+ persistence:
36
+ enabled: true
37
+
38
+ tolerations:
39
+ - key: "elastic"
40
+ operator: "Equal"
41
+ value: "true"
42
+ effect: "NoSchedule"
43
+
44
+ nodeAffinity:
45
+ requiredDuringSchedulingIgnoredDuringExecution:
46
+ nodeSelectorTerms:
47
+ - matchExpressions:
48
+ - key: target-env
49
+ operator: In
50
+ values:
51
+ - elastic
@@ -0,0 +1,51 @@
1
+ # master - manages indexes, tracks nodes and shards
2
+ nodeGroup: "master"
3
+ clusterName: "elasticsearch"
4
+
5
+ #esJavaOpts: "-Xmx1g -Xms1g"
6
+ #
7
+ resources:
8
+ limits: #
9
+ cpu: # 1000m default
10
+ memory: "2Gi" # 2Gi
11
+ requests: # values.yaml defaults
12
+ cpu: "100m" # 1000m
13
+ memory: "1500Mi" # 2Gi
14
+
15
+ volumeClaimTemplate:
16
+ storageClassName: "ssd"
17
+ resources:
18
+ requests:
19
+ storage: "4Gi"
20
+
21
+ roles: # master
22
+ master: "true"
23
+ ingest: "false"
24
+ data: "false"
25
+ remote_cluster_client: "false"
26
+ ml: "false"
27
+
28
+ replicas: 3
29
+ antiAffinity: "hard" # hard is default
30
+
31
+ esConfig:
32
+ elasticsearch.yml: |
33
+ xpack.security.enabled: false
34
+
35
+ persistence:
36
+ enabled: true
37
+
38
+ tolerations:
39
+ - key: "elastic"
40
+ operator: "Equal"
41
+ value: "true"
42
+ effect: "NoSchedule"
43
+
44
+ nodeAffinity:
45
+ requiredDuringSchedulingIgnoredDuringExecution:
46
+ nodeSelectorTerms:
47
+ - matchExpressions:
48
+ - key: target-env
49
+ operator: In
50
+ values:
51
+ - elastic
File without changes
File without changes
@@ -0,0 +1 @@
1
+ grafana-local.yaml
@@ -1,3 +1,4 @@
1
+ # ONLY EDIT grafana-local.yaml.ovh / grafana-local.yaml is git ignored
1
2
  service:
2
3
  type: "NodePort"
3
4
  port: "9000"
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/helmdn CHANGED
@@ -25,10 +25,9 @@ CLEARWARN
25
25
 
26
26
  clearlyWarn
27
27
  cat<<ABOUT2NUKE
28
- You are about to start nuking deployments, as in delete with --purge. Are
29
- you certain this is what you want to do?
28
+ You are about to cause helm to uninstall a service from the cluster.
30
29
 
31
- Enter "yes" if that is in fact the case.
30
+ Enter "yes" to continue to the `color toast nuking`...
32
31
 
33
32
  ABOUT2NUKE
34
33
 
package/src/helmup CHANGED
@@ -21,7 +21,6 @@ PLATFORM=(
21
21
  scheduler
22
22
  transponder-bq
23
23
  transponder-rt
24
- # transponder-postgres # deprecated
25
24
  transponder-tsdb
26
25
  )
27
26
 
@@ -33,7 +32,6 @@ SYSTEM=(
33
32
  preemptible-killer
34
33
  zombie-killer
35
34
  reloader
36
- # cert-manager # deprecated from SYSTEM 01/13/2023
37
35
  traefik
38
36
  velero
39
37
  monitoring # do monitoring last to show password
@@ -135,39 +133,18 @@ MISSING_HELMUP_PLUGIN
135
133
  errorExit "Installaion of `color y $SERVICE` failed - exiting"
136
134
  fi
137
135
 
138
- TOOLS_SRC="$(build-tools --reporoot)/src"
139
- SYSTEM_FILES="$(build-tools --reporoot)/src/system-charts"
140
-
141
- case "$2" in
142
- "set-values-local")
143
- SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
144
- TARGET_CHART="values-local.yaml"
145
- ;;
146
-
147
- "ovh-values-local")
148
- SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml.ovh"
149
- TARGET_CHART="$SERVICE-local.yaml.ovh"
150
- echo "$SERVICE-local.yaml" > $SERVICE/.gitignore
151
- ;;
152
-
153
- *)
154
- SYSTEM_CHART="$SYSTEM_FILES/$SERVICE-local.yaml"
155
- TARGET_CHART="$SYSTEM_CHART"
156
- touch $SERVICE/.nohelm
157
- ;;
158
- esac
159
-
160
- if [ ! -f "$SYSTEM_CHART" ];
136
+ HELM_CHARTS="$(build-tools --reporoot)/src/helm-charts"
137
+ SERVICE_CHART="$HELM_CHARTS/$SERVICE"
138
+
139
+ if [ ! -d "$SERVICE_CHART" ];
161
140
  then
162
141
  rm -rf $SERVICE
163
- errorExit "Missing $SERVICE chart => $(color y $SYSTEM_CHART)"
142
+ errorExit "Missing $SERVICE chart => $(color y $SERVICE_CHART)"
164
143
  fi
165
144
 
166
- SYSTEM_HUP="$SYSTEM_FILES/$SERVICE.hup"
167
- [ ! -f "$SYSTEM_HUP" ] && errorExit "Missing $SERVICE helmup script => $(color y $SYSTEM_HUP)"
168
-
169
- cp $SYSTEM_CHART $SERVICE/$TARGET_CHART
170
- cp $SYSTEM_HUP $SERVICE/helmup.plugin
145
+ cp -a $SERVICE_CHART .
146
+ # because npm tends to not allow .gitinore files the easy way...
147
+ [ -f "$SERVICE/gitignore" && mv $SERVICE/gitignore $SERVICE/.gitignore
171
148
  git add $SERVICE
172
149
  overwhelm.js --genvals
173
150
  ifPluggedIn $SERVICE
@@ -228,7 +205,7 @@ function installMonitoringEnvironment() {
228
205
 
229
206
  ## Install Stackdriver Exporter
230
207
  installStackdriverExporterEnvironment
231
- bootstrapLocalSetup stackdriver-exporter set-values-local
208
+ bootstrapLocalSetup stackdriver-exporter
232
209
 
233
210
  # Add necessary helm repositories - note that stable is deprecated
234
211
  addHelmRepo prometheus-community https://prometheus-community.github.io/helm-charts
@@ -247,10 +224,10 @@ es:
247
224
  ELASTIC_EXPORTER_CHART_MOD
248
225
 
249
226
  ## Install Prometheus
250
- bootstrapLocalSetup prometheus set-values-local
227
+ bootstrapLocalSetup prometheus
251
228
 
252
229
  ## Install Grafana
253
- bootstrapLocalSetup grafana ovh-values-local
230
+ bootstrapLocalSetup grafana
254
231
 
255
232
  ## Clean up
256
233
  removeHelmRepo prometheus-community
@@ -414,65 +391,6 @@ OLDER_GKE
414
391
  fi
415
392
  }
416
393
 
417
- function installCertManager() {
418
- showInstalling "Cert Managment"
419
- createNamespaceIfNeeded cert-manager
420
-
421
- kubectl get secret cloudflare --namespace cert-manager &>/dev/null
422
- if [[ $? -eq 1 ]];
423
- then
424
- cat<<NEED_MANAGED_SECRET
425
- $RED_ERROR missing secret: `color y cloudflare` namespace: `color y cert-manager`
426
-
427
- This secret will be fetched from the leverege-docker-images cluster and
428
- injected into this cluster.
429
- NEED_MANAGED_SECRET
430
- #yesToContinue "to copy and inject the cloudflare secret"
431
- TOKEN=$(getManagedSecret "CLOUDFLARE_API_TOKEN")
432
- if [ $? -ne 0 ];
433
- then
434
- printf "$RED_ERROR getManagedSecret reponse=>[$TOKEN]"
435
- exitOnError 1 "Failed to fetch the secret from leverege-docker-images"
436
- fi
437
- printf "\nInjecting=[$TOKEN] into cloudflare secret\n"
438
- kubectl create secret generic cloudflare \
439
- --namespace cert-manager \
440
- --from-literal=dns-token=$TOKEN
441
- fi
442
-
443
- addHelmRepo jetstack https://charts.jetstack.io
444
- [ -z "$CERT_MANAGER_HELM_CHART" ] && CERT_MANAGER_HELM_CHART="v1.10"
445
- helm upgrade --install cert-manager jetstack/cert-manager \
446
- --namespace cert-manager --set installCRDs=true \
447
- --version $CERT_MANAGER_HELM_CHART
448
-
449
- cat<<DELAY
450
-
451
- `color y "20 second delay to allow cert-manager to stabilize before proceeding...\n"`
452
-
453
- DELAY
454
-
455
- sleep 20
456
- kubectl -n cert-manager apply -f cert-manager
457
-
458
- if [[ $? -eq 1 ]];
459
- then
460
-
461
- `color y "***WARNING: cert-manager components still coming up"`
462
-
463
- Try rerunning this apply again in 30 seconds:
464
- `color g "kubectl -n cert-manager apply -f cert-manager"`
465
- fi
466
-
467
- cat<<HINTS
468
-
469
- fetch certs: `color g "kubectl -n cert-manager get certificate"`
470
- check certs: `color g "kubectl -n cert-manager describe certificate"`
471
-
472
- HINTS
473
- removeHelmRepo jetstack
474
- }
475
-
476
394
  function installTraefikEnvironment() {
477
395
  showInstalling "Traefik Namespace and Cloudflare Secret"
478
396
  createNamespaceIfNeeded traefik
@@ -697,11 +615,6 @@ function doInstall() {
697
615
  doInstall "${SYSTEM[@]}"
698
616
  ;;
699
617
 
700
- "cert-manager")
701
- installCertManager
702
- bootstrapLocalSetup cert-manager
703
- ;;
704
-
705
618
  "cronZombieKiller"|"zombie-killer")
706
619
  installCronZombieKiller # eradicate the gke 1.20+ zombies
707
620
  ;;
@@ -710,8 +623,12 @@ function doInstall() {
710
623
  kubectl create -f https://raw.githubusercontent.com/GoogleCloudPlatform/k8s-stackdriver/master/custom-metrics-stackdriver-adapter/deploy/production/adapter.yaml
711
624
  ;;
712
625
 
713
- "elastic"|"elasticsearch")
714
- bootstrapLocalSetup elasticsearch
626
+ "elasticsearch") # simple 3 master cluster
627
+ bootstrapLocalSetup $SERVICE
628
+ ;;
629
+
630
+ "elastic-cluster") # complex master/data/client ES cluster
631
+ bootstrapLocalSetup $SERVICE
715
632
  ;;
716
633
 
717
634
  "estafette"|"preemptible-killer")
@@ -719,7 +636,7 @@ function doInstall() {
719
636
  ;;
720
637
 
721
638
  "grafana")
722
- bootstrapLocalSetup grafana ovh-values-local
639
+ bootstrapLocalSetup $SERVICE
723
640
  ;;
724
641
 
725
642
  "monitoring")
@@ -731,16 +648,16 @@ function doInstall() {
731
648
  monitoringHelp && exit 0
732
649
  ;;
733
650
 
734
- "postgres"|"postgresql")
735
- bootstrapLocalSetup postgres
651
+ "postgres")
652
+ bootstrapLocalSetup $SERVICE
736
653
  ;;
737
654
 
738
655
  "prometheus")
739
- bootstrapLocalSetup prometheus set-values-local
656
+ bootstrapLocalSetup $SERVICE
740
657
  ;;
741
658
 
742
659
  "redis")
743
- bootstrapLocalSetup redis
660
+ bootstrapLocalSetup $SERVICE
744
661
  ;;
745
662
 
746
663
  "reloader")
@@ -752,11 +669,11 @@ function doInstall() {
752
669
 
753
670
  "stackdriver-exporter")
754
671
  installStackdriverExporterEnvironment
755
- bootstrapLocalSetup stackdriver-exporter set-values-local
672
+ bootstrapLocalSetup $SERVICE
756
673
  ;;
757
674
 
758
- "timescale"|"timescale-db")
759
- bootstrapLocalSetup timescale-db
675
+ "timescale-db")
676
+ bootstrapLocalSetup $SERVICE
760
677
  ;;
761
678
 
762
679
  transponder-*)
@@ -767,16 +684,17 @@ function doInstall() {
767
684
 
768
685
  "traefik")
769
686
  installTraefikEnvironment
770
- bootstrapLocalSetup traefik
687
+ bootstrapLocalSetup $SERVICE
771
688
  ;;
689
+
772
690
  "traefik-canary")
773
691
  # only valid if traefik is already installed
774
- bootstrapLocalSetup traefik-canary
692
+ bootstrapLocalSetup $SERVICE
775
693
  ;;
776
694
 
777
695
  "velero")
778
696
  installVeleroEnvironment
779
- bootstrapLocalSetup velero
697
+ bootstrapLocalSetup $SERVICE
780
698
  ;;
781
699
 
782
700
  *)
@@ -1,43 +0,0 @@
1
- # cert-manager is disabled
2
- #
3
- # cluster-issuer.yaml.ovh
4
- #
5
- apiVersion: cert-manager.io/v1
6
- kind: ClusterIssuer
7
- metadata:
8
- name: letsencrypt-prd
9
- spec:
10
- acme:
11
- # You must replace this email address with your own.
12
- # Let's Encrypt will use this to contact you about expiring
13
- # certificates, and issues related to your account.
14
- email: devops@leverege.com
15
- server: https://acme-v02.api.letsencrypt.org/directory
16
- privateKeySecretRef:
17
- # Secret resource used to store the account's private key.
18
- name: issuer-account-key
19
- # Add a single challenge solver, HTTP01 using nginx
20
- solvers:
21
- - dns01:
22
- cloudflare:
23
- email: devops@leverege.com
24
- apiTokenSecretRef:
25
- name: cloudflare
26
- key: dns-token
27
- selector:
28
- dnsZones:
29
- - 'OVH:<HOST>.com'
30
- ---
31
- #
32
- # this-service.yaml.ovh
33
- #
34
- kind: Certificate
35
- metadata:
36
- name: OVH:<PROJECT_ID>
37
- spec:
38
- secretName: OVH:<PROJECT_ID>-cert
39
- dnsNames:
40
- - '*.OVH:<HOST>.com'
41
- issuerRef:
42
- name: letsencrypt-prd
43
- kind: ClusterIssuer
@@ -1,37 +0,0 @@
1
- #!/bin/bash
2
- #
3
- # cert-manager may be skipped for now?
4
- #
5
- skipInstalling cert-manager && exit 0
6
-
7
- addHelmRepo jetstack https://charts.jetstack.io
8
- [ -z "$CERT_MANAGER_CHART_VERSION" ] && CERT_MANAGER_CHART_VERSION="v1.10"
9
- helm upgrade --install cert-manager jetstack/cert-manager \
10
- --namespace cert-manager --set installCRDs=true \
11
- --version $CERT_MANAGER_CHART_VERSION
12
-
13
- cat<<DELAY
14
-
15
- `color y "20 second delay to allow cert-manager to stabilize before proceeding...\n"`
16
-
17
- DELAY
18
-
19
- sleep 20
20
- kubectl -n cert-manager apply -f cert-manager
21
-
22
- if [[ $? -eq 1 ]];
23
- then
24
-
25
- `color y "***WARNING: cert-manager components still coming up"`
26
-
27
- Try rerunning this apply again in 30 seconds:
28
- `color g "kubectl -n cert-manager apply -f cert-manager"`
29
- fi
30
-
31
- cat<<HINTS
32
-
33
- fetch certs: `color g "kubectl -n cert-manager get certificate"`
34
- check certs: `color g "kubectl -n cert-manager describe certificate"`
35
-
36
- HINTS
37
- removeHelmRepo jetstack