@leverege/build-tools 2.63.2 → 2.64.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.63.2",
3
+ "version": "2.64.0",
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"
@@ -4,20 +4,22 @@ metadata:
4
4
  name: cnpg-db-psql-stack
5
5
  namespace: cnpg-operands
6
6
  spec:
7
+ # https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-ClusterSpec
7
8
  instances: 1
8
9
  logLevel: info # warning debug
9
10
 
10
11
  monitoring:
11
12
  enablePodMonitor: false # set true once monitoring is setup
12
13
 
13
- description: "Leverege Stack PostgreSQL DB"
14
+ # https://console.cloud.google.com/artifacts/docker/leverege-registry/us/system/images%2Fleverege-pgsql?project=leverege-registry
14
15
  imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.2-cnpg-lvrg-rel.2
16
+ description: "Leverege Stack PostgreSQL DB"
15
17
  bootstrap:
16
18
  initdb:
17
19
  # database: models # do not set - let it default to cnpg app db
18
20
  postInitSQL:
19
- # - CREATE DATABASE app; # operator expects this
20
- # - CREATE ROLE app; # and this to exist on restore
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;
@@ -25,29 +27,20 @@ spec:
25
27
  - CREATE DATABASE models;
26
28
  - CREATE DATABASE scheduler;
27
29
 
30
+ # we use superuser access for backwards compatibility with legacy (aka lazy)
28
31
  enableSuperuserAccess: true
29
32
  superuserSecret:
30
- name: cnpg-db-psql-stack-postgres-pw # postgres db pw
33
+ name: cnpg-db-psql-stack-postgres-pw # postgres db pw created by helmup
31
34
 
32
- affinity:
33
- enablePodAntiAffinity: true
34
- topologyKey: kubernetes.io/hostname # default value
35
- nodeAffinity:
36
- requiredDuringSchedulingIgnoredDuringExecution:
37
- nodeSelectorTerms:
38
- - matchExpressions:
39
- - key: target-env
40
- operator: In
41
- values:
42
- - database
43
- tolerations:
44
- - key: "database"
45
- operator: "Equal"
46
- value: "true"
47
- effect: "NoSchedule"
35
+ # Require 50Gi of space per instance using ssd storage class
36
+ storage:
37
+ storageClass: premium-rwo
38
+ size: 50Gi
39
+ # walStorage:
40
+ # storageClass: premium-rwo
41
+ # size: 1Gi
48
42
 
49
- # Parameters and pg_hba configuration will be append
50
- # to the default ones to make the cluster work
43
+ # customize psql settings - be careful - should be tuned
51
44
  postgresql:
52
45
  parameters:
53
46
  # max_connections: "100"
@@ -59,25 +52,9 @@ spec:
59
52
  # maintenance_work_mem: 1GB
60
53
  # work_mem: 20MB
61
54
 
62
- # - unsupervised: automated update of the primary once all
63
- # replicas have been upgraded (default)
64
- # - supervised: requires manual supervision to perform
65
- # the switchover of the primary
66
- primaryUpdateStrategy: unsupervised
67
- primaryUpdateMethod: switchover
68
-
69
- serviceAccountTemplate:
70
- metadata:
71
- annotations:
72
- iam.gke.io/gcp-service-account: cnpg-operands-sa@OVH:<PROJECT_ID>.iam.gserviceaccount.com
73
-
74
- # Require 50Gi of space per instance using ssd storage class
75
- storage:
76
- storageClass: premium-rwo
77
- size: 50Gi
78
- # walStorage:
79
- # storageClass: premium-rwo
80
- # size: 1Gi
55
+ postgresql:
56
+ shared_preload_libraries:
57
+ - pg_stat_statements
81
58
 
82
59
  backup:
83
60
  retentionPolicy: 7d # don't think this does anything?
@@ -86,7 +63,7 @@ spec:
86
63
  snapshotOf: cnpg-db-psql-stack
87
64
  className: cnpg-snapshotclass
88
65
  barmanObjectStore:
89
- destinationPath: gs://OVH:<PROJECT_ID>-barman
66
+ destinationPath: gs://${PROJECT_ID}-barman
90
67
  googleCredentials:
91
68
  gkeEnvironment: true
92
69
  tags:
@@ -94,6 +71,34 @@ spec:
94
71
  wal:
95
72
  compression: gzip
96
73
  maxParallel: 4
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
+
84
+ # affinity and toleration to control node pool placement, typically on database pool
85
+ affinity:
86
+ enablePodAntiAffinity: true
87
+ topologyKey: kubernetes.io/hostname # default value
88
+ nodeAffinity:
89
+ requiredDuringSchedulingIgnoredDuringExecution:
90
+ nodeSelectorTerms:
91
+ - matchExpressions:
92
+ - key: target-env
93
+ operator: In
94
+ values:
95
+ - database
96
+ tolerations:
97
+ - key: "database"
98
+ operator: "Equal"
99
+ value: "true"
100
+ effect: "NoSchedule"
101
+
97
102
  ---
98
103
  apiVersion: postgresql.cnpg.io/v1
99
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"
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # See => https://cloudnative-pg.io/documentation/current/installation_upgrade/
4
4
  #
5
- OPVER="1.25.0"
5
+ OPVER="1.25.1"
6
6
 
7
7
  createNamespaceIfNeeded cnpg-system
8
8
 
@@ -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=(
@@ -1160,7 +1162,13 @@ $RED_ERROR The Leverege service-man utility is missing - install and rerun helmu
1160
1162
  NO_SERVICE_MAN
1161
1163
  exit 1
1162
1164
  fi
1163
- service-man --from-helmup --create-service $SERVICE
1165
+
1166
+ if [[ "$SERVICE" == *-canary ]];
1167
+ then
1168
+ printf "\n$YELO_WARN Canary detected - skipping service-man SA creation\n\n"
1169
+ else
1170
+ service-man --from-helmup --create-service $SERVICE
1171
+ fi
1164
1172
 
1165
1173
  checkUpgradeNotes $SERVICE
1166
1174
 
File without changes