@leverege/build-tools 2.63.3 → 2.64.1

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.
@@ -0,0 +1,18 @@
1
+ {
2
+ "workbench.colorCustomizations": {
3
+ "commandCenter.border": "#e7e7e799",
4
+ "sash.hoverBorder": "#065782",
5
+ "statusBar.background": "#0877b3",
6
+ "statusBar.border": "#0877b3",
7
+ "statusBar.foreground": "#e7e7e7",
8
+ "statusBarItem.hoverBackground": "#0a97e4",
9
+ "statusBarItem.remoteBackground": "#0877b3",
10
+ "statusBarItem.remoteForeground": "#e7e7e7",
11
+ "titleBar.activeBackground": "#0877b3",
12
+ "titleBar.activeForeground": "#e7e7e7",
13
+ "titleBar.border": "#0877b3",
14
+ "titleBar.inactiveBackground": "#0877b399",
15
+ "titleBar.inactiveForeground": "#e7e7e799"
16
+ },
17
+ "peacock.color": "#0877b3"
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.63.3",
3
+ "version": "2.64.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -69,7 +69,7 @@
69
69
  "execa": "^9.5.2",
70
70
  "glob": "^11.0.1",
71
71
  "handlebars": "^4.7.8",
72
- "inquirer": "^12.4.2",
72
+ "inquirer": "^12.4.3",
73
73
  "js-yaml": "^4.1.0",
74
74
  "jsdoc": "^4.0.4",
75
75
  "ms": "^2.1.3",
@@ -80,10 +80,10 @@
80
80
  "semver": "^7.7.1",
81
81
  "simple-git": "^3.27.0",
82
82
  "toml": "^3.0.0",
83
- "zx": "^8.3.2"
83
+ "zx": "^8.4.0"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@leverege/eslint-config-leverege": "^5.0.1",
87
- "npm": "^11.1.0"
87
+ "npm": "^11.2.0"
88
88
  }
89
89
  }
@@ -11,22 +11,22 @@ config:
11
11
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
12
12
 
13
13
  # CNPG overrides
14
- # # stock pgsql
15
- # MODEL_SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands"
16
- # PG_MODELS_HOST: "cnpg-db-psql-stack-rw.cnpg-operands"
17
- # # timescale
18
- # PG_HOST: "cnpg-db-tsdb-basic-r.cnpg-operands"
14
+ # stock pgsql
15
+ MODEL_SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands"
16
+ PG_MODELS_HOST: "cnpg-db-psql-stack-rw.cnpg-operands"
17
+ # timescale
18
+ PG_HOST: "cnpg-db-tsdb-basic-r.cnpg-operands"
19
19
 
20
20
  # The settings on the left are for the "standard" legacy chart settings which
21
21
  # specifiy the old k8s secrets setups and are the defaults values from the
22
22
  # api-server helm chart.
23
- psqlSecurity: # v----- these are for CNPG -----v
24
- PSQL_SECRET_NAME: "authz-postgres" # "cnpg-db-psql-stack-postgres-pw"
25
- PSQL_SECRET_KEY: "postgresql-password" # "password"
26
- TSDB_SECRET_NAME: "postgresql-password" # "cnpg-db-tsdb-basic-postgres-pw"
27
- TSDB_SECRET_KEY: "postgresql-password" # "password"
28
- TSDB_DENSE_SECRET_NAME: "postgresql-password" # "cnpg-db-tsdb-dense-postgres-pw"
29
- TSDB_DENSE_SECRET_KEY: "postgresql-password" # "password"
23
+ psqlSecurity:
24
+ PSQL_SECRET_NAME: "cnpg-db-psql-stack-postgres-pw"
25
+ PSQL_SECRET_KEY: "password"
26
+ TSDB_SECRET_NAME: "cnpg-db-tsdb-basic-postgres-pw"
27
+ TSDB_SECRET_KEY: "password"
28
+ TSDB_DENSE_SECRET_NAME: "cnpg-db-tsdb-dense-postgres-pw"
29
+ TSDB_DENSE_SECRET_KEY: "password"
30
30
 
31
31
  autoscaling:
32
32
  minReplicas: 3
@@ -10,4 +10,4 @@ config:
10
10
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
11
11
 
12
12
  # CNPG override
13
- # SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
13
+ SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
@@ -10,11 +10,11 @@ spec:
10
10
  instances: 1
11
11
  type: rw
12
12
  pgbouncer:
13
- poolMode: session
13
+ poolMode: transaction
14
14
  parameters:
15
15
  # https://www.pgbouncer.org/config.html#generic-settings
16
16
  max_client_conn: "500"
17
- default_pool_size: "10"
17
+ default_pool_size: "5"
18
18
  # https://www.pgbouncer.org/config.html#log-settings
19
19
  log_connections: "0"
20
20
  log_disconnections: "0"
@@ -18,6 +18,8 @@ spec:
18
18
  initdb:
19
19
  # database: models # do not set - let it default to cnpg app db
20
20
  postInitSQL:
21
+ # create the extensions
22
+ - CREATE EXTENSION pg_stat_statements;
21
23
  # create the stack databases
22
24
  - CREATE DATABASE authz;
23
25
  - CREATE DATABASE fota;
@@ -50,6 +52,10 @@ spec:
50
52
  # maintenance_work_mem: 1GB
51
53
  # work_mem: 20MB
52
54
 
55
+ postgresql:
56
+ shared_preload_libraries:
57
+ - pg_stat_statements
58
+
53
59
  backup:
54
60
  retentionPolicy: 7d # don't think this does anything?
55
61
  volumeSnapshot:
@@ -66,6 +72,15 @@ spec:
66
72
  compression: gzip
67
73
  maxParallel: 4
68
74
 
75
+ # Method to follow to upgrade the primary server during a rolling update procedure,
76
+ # after all replicas have been successfully updated - default is restart
77
+ primaryUpdateMethod: switchover
78
+
79
+ serviceAccountTemplate:
80
+ metadata:
81
+ annotations:
82
+ iam.gke.io/gcp-service-account: cnpg-operands-sa@${PROJECT_ID}.iam.gserviceaccount.com
83
+
69
84
  # affinity and toleration to control node pool placement, typically on database pool
70
85
  affinity:
71
86
  enablePodAntiAffinity: true
@@ -84,15 +99,6 @@ spec:
84
99
  value: "true"
85
100
  effect: "NoSchedule"
86
101
 
87
- # Method to follow to upgrade the primary server during a rolling update procedure,
88
- # after all replicas have been successfully updated - default is restart
89
- primaryUpdateMethod: switchover
90
-
91
- serviceAccountTemplate:
92
- metadata:
93
- annotations:
94
- iam.gke.io/gcp-service-account: cnpg-operands-sa@${PROJECT_ID}.iam.gserviceaccount.com
95
-
96
102
  ---
97
103
  apiVersion: postgresql.cnpg.io/v1
98
104
  kind: ScheduledBackup
@@ -10,11 +10,11 @@ spec:
10
10
  instances: 1
11
11
  type: rw
12
12
  pgbouncer:
13
- poolMode: session
13
+ poolMode: transaction
14
14
  parameters:
15
15
  # https://www.pgbouncer.org/config.html#generic-settings
16
16
  max_client_conn: "500"
17
- default_pool_size: "10"
17
+ default_pool_size: "5"
18
18
  # https://www.pgbouncer.org/config.html#log-settings
19
19
  log_connections: "0"
20
20
  log_disconnections: "0"
@@ -24,23 +24,6 @@ spec:
24
24
  superuserSecret:
25
25
  name: <postgres_password> # postgres db pw
26
26
 
27
- affinity:
28
- enablePodAntiAffinity: true
29
- topologyKey: kubernetes.io/hostname # default value
30
- nodeAffinity:
31
- requiredDuringSchedulingIgnoredDuringExecution:
32
- nodeSelectorTerms:
33
- - matchExpressions:
34
- - key: target-env
35
- operator: In
36
- values:
37
- - database
38
- tolerations:
39
- - key: "database"
40
- operator: "Equal"
41
- value: "true"
42
- effect: "NoSchedule"
43
-
44
27
  # Parameters and pg_hba configuration will be append
45
28
  # to the default ones to make the cluster work
46
29
  postgresql:
@@ -54,18 +37,6 @@ spec:
54
37
  # maintenance_work_mem: 1GB
55
38
  # work_mem: 20MB
56
39
 
57
- # - unsupervised: automated update of the primary once all
58
- # replicas have been upgraded (default)
59
- # - supervised: requires manual supervision to perform
60
- # the switchover of the primary
61
- primaryUpdateStrategy: unsupervised
62
- primaryUpdateMethod: switchover
63
-
64
- serviceAccountTemplate:
65
- metadata:
66
- annotations:
67
- iam.gke.io/gcp-service-account: cnpg-operands-sa@OVH:<PROJECT_ID>.iam.gserviceaccount.com
68
-
69
40
  # Require 50Gi of space per instance using ssd storage class
70
41
  storage:
71
42
  storageClass: premium-rwo
@@ -81,14 +52,41 @@ spec:
81
52
  snapshotOf: cnpg-db-recovery
82
53
  className: cnpg-snapshotclass
83
54
  barmanObjectStore:
84
- destinationPath: gs://OVH:<PROJECT_ID>-barman
55
+ destinationPath: gs://${PROJECT_ID}-barman
85
56
  googleCredentials:
86
57
  gkeEnvironment: true
87
58
  tags:
88
59
  cnpgCluster: cnpg-db-recovery
89
60
  wal:
90
61
  compression: gzip
91
- maxParallel: 8
62
+ maxParallel: 4
63
+
64
+ # Method to follow to upgrade the primary server during a rolling update procedure,
65
+ # after all replicas have been successfully updated - default is restart
66
+ primaryUpdateMethod: switchover
67
+
68
+ serviceAccountTemplate:
69
+ metadata:
70
+ annotations:
71
+ iam.gke.io/gcp-service-account: cnpg-operands-sa@${PROJECT_ID}.iam.gserviceaccount.com
72
+
73
+ affinity:
74
+ enablePodAntiAffinity: true
75
+ topologyKey: kubernetes.io/hostname # default value
76
+ nodeAffinity:
77
+ requiredDuringSchedulingIgnoredDuringExecution:
78
+ nodeSelectorTerms:
79
+ - matchExpressions:
80
+ - key: target-env
81
+ operator: In
82
+ values:
83
+ - database
84
+ tolerations:
85
+ - key: "database"
86
+ operator: "Equal"
87
+ value: "true"
88
+ effect: "NoSchedule"
89
+
92
90
  ---
93
91
  apiVersion: postgresql.cnpg.io/v1
94
92
  kind: ScheduledBackup
@@ -10,11 +10,11 @@ spec:
10
10
  instances: 1
11
11
  type: rw
12
12
  pgbouncer:
13
- poolMode: session
13
+ poolMode: transaction
14
14
  parameters:
15
15
  # https://www.pgbouncer.org/config.html#generic-settings
16
16
  max_client_conn: "500"
17
- default_pool_size: "10"
17
+ default_pool_size: "5"
18
18
  # https://www.pgbouncer.org/config.html#log-settings
19
19
  log_connections: "0"
20
20
  log_disconnections: "0"
@@ -10,11 +10,11 @@ spec:
10
10
  instances: 1
11
11
  type: rw
12
12
  pgbouncer:
13
- poolMode: session
13
+ poolMode: transaction
14
14
  parameters:
15
15
  # https://www.pgbouncer.org/config.html#generic-settings
16
16
  max_client_conn: "500"
17
- default_pool_size: "10"
17
+ default_pool_size: "5"
18
18
  # https://www.pgbouncer.org/config.html#log-settings
19
19
  log_connections: "0"
20
20
  log_disconnections: "0"
@@ -10,11 +10,11 @@ spec:
10
10
  instances: 1
11
11
  type: rw
12
12
  pgbouncer:
13
- poolMode: session
13
+ poolMode: transaction
14
14
  parameters:
15
15
  # https://www.pgbouncer.org/config.html#generic-settings
16
16
  max_client_conn: "500"
17
- default_pool_size: "10"
17
+ default_pool_size: "5"
18
18
  # https://www.pgbouncer.org/config.html#log-settings
19
19
  log_connections: "0"
20
20
  log_disconnections: "0"
@@ -3,5 +3,5 @@ image:
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
- TSDB_CLEANUP_ENABLED: "true"
7
6
  FIREBASE_CLEANUP_ENABLED: "true"
7
+ TSDB_CLEANUP_ENABLED: "false" # no need is new tsdb using autoexpiry
@@ -2,7 +2,7 @@
2
2
  #
3
3
  showInstalling "Elastic Search 8"
4
4
 
5
- [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.4.5"
5
+ [ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.4.8"
6
6
 
7
7
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/elasticsearch"
8
8
 
@@ -8,7 +8,7 @@ config:
8
8
  NETWORK_ID: 'set-me-in-values-local'
9
9
 
10
10
  # CNPG override
11
- # SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
11
+ SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
12
12
 
13
13
  serviceMonitor:
14
14
  enabled: false
@@ -39,6 +39,13 @@ prometheus:
39
39
  ruleSelectorNilUsesHelmValues: false
40
40
  serviceMonitorSelectorNilUsesHelmValues: false
41
41
  probeSelectorNilUsesHelmValues: false
42
+ storageSpec:
43
+ volumeClaimTemplate:
44
+ spec:
45
+ accessModes: ["ReadWriteOnce"]
46
+ resources:
47
+ requests:
48
+ storage: 50Gi # Adjust size as needed
42
49
 
43
50
  # default is using kube-dns which is usually sufficient for our needs but
44
51
  # can be switched over to CoreDNS if the need arises
@@ -4,8 +4,8 @@ showInstalling "Redis"
4
4
 
5
5
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/redis"
6
6
 
7
- [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.7.1"
7
+ [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="20.11.3"
8
8
 
9
9
  helm upgrade --install redis $OCI_CHART \
10
- --values redis/redis-local.yaml \
10
+ --values redis/values.yaml \
11
11
  --version $REDIS_CHART_VERSION $HELM_WHAT
@@ -14,4 +14,4 @@ config:
14
14
  UPLOADER_LOCATION: "OVH:<GCE_REGION>"
15
15
 
16
16
  # CNPG override
17
- # SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
17
+ SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
@@ -5,4 +5,4 @@ config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
6
 
7
7
  # CNPG override
8
- # MODELS_SEQUELIZE_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
8
+ MODELS_SEQUELIZE_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
@@ -5,4 +5,4 @@ config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
6
6
 
7
7
  # CNPG override
8
- # SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
8
+ SQL_HOST: "cnpg-db-psql-stack-rw.cnpg-operands" # vs postgres-postgresql
@@ -14,10 +14,10 @@ config:
14
14
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
15
15
 
16
16
  # CNPG override
17
- # PG_HOST: "cnpg-db-tsdb-basic-rw.cnpg-operands"
18
- #
19
- # PG_PASSWORD_SECRET: "cnpg-db-tsdb-basic-postgres-pw"
20
- # PG_PASSWORD_KEY: "password"
17
+ PG_HOST: "cnpg-db-tsdb-basic-rw.cnpg-operands"
18
+
19
+ PG_PASSWORD_SECRET: "cnpg-db-tsdb-basic-postgres-pw"
20
+ PG_PASSWORD_KEY: "password"
21
21
 
22
22
  TRANSPORT_CONFIG: '{
23
23
  "type": "pubsub",
package/src/helmup.sh CHANGED
@@ -58,6 +58,8 @@ SYSTEM=(
58
58
  reloader
59
59
  traefik
60
60
  velero
61
+ cnpg-db-psql-stack
62
+ cnpg-db-tsdb-basic
61
63
  )
62
64
 
63
65
  SYSTEM_LEGACY=(
package/src/k8cryo.sh ADDED
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+ #
3
+ # Usage: k8cryo <expiry days>
4
+ #
5
+ # Simple script for performing a full cluster backup with a specific expiry
6
+ # period. The default is 60 days.
7
+ #
8
+ . `build-tools --bashfun`
9
+
10
+ daysToKeep=${1:-60}
11
+ let hoursToKeep="$daysToKeep*24"
12
+ printf "\ncryo backup set to keep for $daysToKeep days / $hoursToKeep hours\n"
13
+
14
+ if [ "`basename $0`" == "k8thaw" ];
15
+ then
16
+ errorExit "k8thaw - UNDER CONSTRUCTION"
17
+ fi
18
+
19
+ # Gets the UTC time in the same format that velero schedules use for
20
+ # generating the Date Time Stamp for scheduled backups.
21
+ DTS="`date -u +\"%Y%m%d%H%M%S\"`"
22
+
23
+ printf "\nExecuting = > velero backup create velero-cryo-$DTS --ttl ${hoursToKeep}h\n"
24
+
25
+ velero backup create velero-cryo-$DTS --ttl ${hoursToKeep}h
@@ -9,13 +9,11 @@ RUN useradd -ms /bin/bash {{runuser}} && \
9
9
  mkdir -p /usr/src/app && \
10
10
  chown {{runuser}} /usr/src/app && \
11
11
  apt-get update && apt-get install -y \
12
- wget git \
12
+ wget git libgl1 libglib2.0-0 \
13
13
  && rm -rf /var/lib/apt/lists/*
14
14
 
15
15
  # gcc \
16
16
  # git \
17
- # libgl1 \
18
- # libglib2.0-0 \
19
17
  # && rm -rf /var/lib/apt/lists/*
20
18
 
21
19
  # Copy uv binary from the official distroless Docker image.
File without changes