@leverege/build-tools 2.48.6 → 2.50.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.
Files changed (47) hide show
  1. package/package.json +9 -10
  2. package/registry-compass.yaml +20 -0
  3. package/src/chart-compass.mjs +96 -0
  4. package/src/cnpg-backup.mjs +13 -0
  5. package/src/helm-charts/{db-timescale-dense/db-timescale-dense.yaml.ovh → cnpg-db-pgbench/cluster.yaml.ovh} +9 -29
  6. package/src/helm-charts/cnpg-db-pgbench/gitignore +2 -0
  7. package/src/helm-charts/cnpg-db-pgbench/helmdn.plugin +12 -0
  8. package/src/helm-charts/cnpg-db-pgbench/helmup.plugin +3 -0
  9. package/src/helm-charts/cnpg-db-pgbench/pooler.yaml +16 -0
  10. package/src/helm-charts/{db-postgres-stack/db-postgres-stack.yaml.ovh → cnpg-db-psql-stack/cluster.yaml.ovh} +22 -26
  11. package/src/helm-charts/cnpg-db-psql-stack/gitignore +2 -0
  12. package/src/helm-charts/cnpg-db-psql-stack/helmdn.plugin +12 -0
  13. package/src/helm-charts/cnpg-db-psql-stack/helmup.plugin +3 -0
  14. package/src/helm-charts/cnpg-db-psql-stack/pooler.yaml +16 -0
  15. package/src/helm-charts/cnpg-db-tsdb-basic/cluster.yaml.ovh +110 -0
  16. package/src/helm-charts/cnpg-db-tsdb-basic/gitignore +2 -0
  17. package/src/helm-charts/cnpg-db-tsdb-basic/helmdn.plugin +12 -0
  18. package/src/helm-charts/cnpg-db-tsdb-basic/helmup.plugin +3 -0
  19. package/src/helm-charts/cnpg-db-tsdb-basic/pooler.yaml +16 -0
  20. package/src/helm-charts/cnpg-db-tsdb-dense/.nohelm +0 -0
  21. package/src/helm-charts/cnpg-db-tsdb-dense/.nohelmdn +0 -0
  22. package/src/helm-charts/{db-timescale-plain/db-timescale-plain.yaml.ovh → cnpg-db-tsdb-dense/cluster.yalm.ovh} +25 -36
  23. package/src/helm-charts/cnpg-db-tsdb-dense/gitignore +2 -0
  24. package/src/helm-charts/cnpg-db-tsdb-dense/helmdn.plugin +12 -0
  25. package/src/helm-charts/cnpg-db-tsdb-dense/helmup.plugin +3 -0
  26. package/src/helm-charts/cnpg-db-tsdb-dense/pooler.yaml +16 -0
  27. package/src/helm-charts/elasticsearch8/helmup.plugin +4 -5
  28. package/src/helm-charts/kube-prometheus-stack/helmup.plugin +13 -0
  29. package/src/helm-charts/kube-prometheus-stack/old-values-local.yaml +764 -0
  30. package/src/helm-charts/pusher/values-local.yaml +2 -2
  31. package/src/helmup.sh +14 -25
  32. package/src/cnpg-snapshot.mjs +0 -38
  33. package/src/helm-charts/db-postgres-stack/gitignore +0 -1
  34. package/src/helm-charts/db-postgres-stack/helmdn.plugin +0 -3
  35. package/src/helm-charts/db-postgres-stack/helmup.plugin +0 -3
  36. package/src/helm-charts/db-timescale-dense/gitignore +0 -1
  37. package/src/helm-charts/db-timescale-dense/helmdn.plugin +0 -9
  38. package/src/helm-charts/db-timescale-dense/helmup.plugin +0 -5
  39. package/src/helm-charts/db-timescale-plain/gitignore +0 -1
  40. package/src/helm-charts/db-timescale-plain/helmdn.plugin +0 -3
  41. package/src/helm-charts/db-timescale-plain/helmup.plugin +0 -3
  42. /package/src/helm-charts/{db-postgres-stack → cnpg-db-pgbench}/.nohelm +0 -0
  43. /package/src/helm-charts/{db-postgres-stack → cnpg-db-pgbench}/.nohelmdn +0 -0
  44. /package/src/helm-charts/{db-timescale-dense → cnpg-db-psql-stack}/.nohelm +0 -0
  45. /package/src/helm-charts/{db-timescale-dense → cnpg-db-psql-stack}/.nohelmdn +0 -0
  46. /package/src/helm-charts/{db-timescale-plain → cnpg-db-tsdb-basic}/.nohelm +0 -0
  47. /package/src/helm-charts/{db-timescale-plain → cnpg-db-tsdb-basic}/.nohelmdn +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.48.6",
3
+ "version": "2.50.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  "build-tools": "src/build-tools.mjs",
17
17
  "chart-to-registry": "src/chart-to-registry.mjs",
18
18
  "circleate": "src/circleate.sh",
19
- "cnpg-snapshot": "src/cnpg-snapshot.mjs",
19
+ "cnpg-backup": "src/cnpg-backup.mjs",
20
20
  "decrypt-secrets": "src/decrypt-secrets.sh",
21
21
  "dirty-git": "src/dirty-git.sh",
22
22
  "dockreate": "src/dockreate.sh",
@@ -54,7 +54,7 @@
54
54
  "author": "Leverege Devs",
55
55
  "license": "SEE LICENSE IN LICENSE.md",
56
56
  "dependencies": {
57
- "@google-cloud/artifact-registry": "^3.2.0",
57
+ "@google-cloud/artifact-registry": "^3.3.0",
58
58
  "ansi-colors": "^4.1.3",
59
59
  "chalk": "^5.3.0",
60
60
  "command-line-args": "^5.2.1",
@@ -62,23 +62,22 @@
62
62
  "deepmerge": "^4.3.1",
63
63
  "enquirer": "^2.4.1",
64
64
  "execa": "^8.0.1",
65
- "glob": "^10.3.10",
65
+ "glob": "^10.3.12",
66
66
  "handlebars": "^4.7.8",
67
- "inquirer": "^9.2.16",
67
+ "inquirer": "^9.2.18",
68
68
  "js-yaml": "^4.1.0",
69
69
  "ms": "^2.1.3",
70
- "npm-registry-fetch": "^16.1.0",
70
+ "npm-registry-fetch": "^16.2.1",
71
71
  "package-up": "^5.0.0",
72
72
  "parse-gitignore": "^2.0.0",
73
73
  "read-pkg": "^9.0.1",
74
74
  "readline-sync": "^1.4.10",
75
75
  "semver": "^7.6.0",
76
- "simple-git": "^3.22.0",
77
- "tempy": "^3.1.0",
78
- "zx": "^7.2.3"
76
+ "simple-git": "^3.24.0",
77
+ "zx": "^8.0.1"
79
78
  },
80
79
  "devDependencies": {
81
80
  "@leverege/eslint-config-leverege": "^4.2.0",
82
- "npm": "^10.5.0"
81
+ "npm": "^10.5.2"
83
82
  }
84
83
  }
@@ -0,0 +1,20 @@
1
+ registry:
2
+ - root: us-docker.pkg.dev
3
+ - repositories:
4
+ - name: stack
5
+ charts:
6
+ - api-server
7
+ - authz-server
8
+ - emailer
9
+ - message-processor
10
+ - name: leverege
11
+ charts:
12
+ - pubsub-pulse
13
+ - pusher
14
+ - overdose
15
+ - name: cox-health
16
+ charts:
17
+ - actions-server
18
+ - analytics-server
19
+ - centrak-healthz
20
+ - centrak-ingestor
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * chart-to-registry will...
4
+ */
5
+ import fs from 'node:fs'
6
+
7
+ import chalk from 'chalk'
8
+ import commandLineArgs from 'command-line-args'
9
+ import commandLineUsage from 'command-line-usage'
10
+ import { lt as semverLt } from 'semver'
11
+ import YAML from 'js-yaml'
12
+
13
+ import {
14
+ condir,
15
+ debug,
16
+ errorExit,
17
+ log,
18
+ warning,
19
+ getGitRootDirectory,
20
+ parsePackageJson,
21
+ parseHelmChart,
22
+ shellCmd } from './Utils.mjs'
23
+
24
+ const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
25
+ /* eslint-disable max-len */
26
+ {
27
+ name : 'location',
28
+ type : String,
29
+ description : '{green the location of the artifact registry the chart will be pushed to (default us-docker.pkg.dev)}',
30
+ },
31
+ {
32
+ name : 'project',
33
+ type : String,
34
+ description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
35
+ },
36
+ {
37
+ name : 'repository',
38
+ type : String,
39
+ description : '{green the target repository to receive the pushed chart}',
40
+ },
41
+ {
42
+ name : 'dry-run',
43
+ type : Boolean,
44
+ description : '{yellow perform everything except the actual chart push}',
45
+ },
46
+ {
47
+ name : 'help',
48
+ type : Boolean,
49
+ description : '{green display this help screen}',
50
+ },
51
+ /* eslint-enable max-len */
52
+ ]
53
+
54
+ const sections = [
55
+ {
56
+ header : 'Leverege Helm Chart Compass (for helmup)',
57
+ content : `{green This tool helps helmup navigate the helm charts stored in the
58
+ artifact-registries.}`
59
+ },
60
+ { header : 'Options',
61
+ optionList : commandLineOptions,
62
+ },
63
+ ]
64
+
65
+ const args = commandLineArgs( commandLineOptions, { camelCase : true, partial : true } )
66
+ const usage = commandLineUsage( sections )
67
+
68
+ if ( args.help ) {
69
+ log( usage )
70
+ process.exit( 0 )
71
+ }
72
+
73
+ /* eslint-disable no-underscore-dangle */
74
+ if ( args._unknown ) {
75
+ log( usage )
76
+ log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
77
+ process.exit( 1 )
78
+ }
79
+ /* eslint-enable no-underscore-dangle */
80
+
81
+ const minNodejsVersion = '18.0.0'
82
+ if ( semverLt( process.version, minNodejsVersion ) ) {
83
+ errorExit( `\n***ERROR: must be running at least node ${minNodejsVersion}\n` )
84
+ }
85
+
86
+ // First of all, fail if we are not in a git repository
87
+ let gitRoot
88
+ try {
89
+ gitRoot = await getGitRootDirectory()
90
+ } catch ( error ) {
91
+ errorExit( chalk.red.bold( error ), { errorCode : 5 } )
92
+ }
93
+
94
+ const chartCompass = YAML.load( fs.readFileSync( './registry-compass.yaml', 'utf8' ) )
95
+
96
+ condir( { chartCompass }, '<==Navigation' )
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {
4
+ log,
5
+ shellCmd,
6
+ } from './Utils.mjs'
7
+
8
+ const clusterName = process.argv[2]
9
+
10
+ await shellCmd( 'overwhelm' )
11
+ await shellCmd( `kubectl cnpg backup -m volumeSnapshot -n cnpg-operands ${clusterName}` )
12
+
13
+ log( '\nTo see backups run => kubectl get backups.postgresql.cnpg.io -n cnpg-operands\n' )
@@ -3,13 +3,13 @@
3
3
  apiVersion: postgresql.cnpg.io/v1
4
4
  kind: Cluster
5
5
  metadata:
6
- name: db-timescale-dense
6
+ name: cnpg-db-pgbench
7
7
  namespace: cnpg-operands
8
8
  spec:
9
9
  instances: 1
10
- logLevel: debug
10
+ logLevel: info # warning debug
11
11
 
12
- description: "Leverege Dense Timescale DB"
12
+ description: "Leverege PG Bench Timescale DB"
13
13
  imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.1-cnpg-tsdb2-beta.6
14
14
  bootstrap:
15
15
  initdb:
@@ -19,11 +19,11 @@ spec:
19
19
  database: imagine
20
20
  owner: imagine
21
21
  secret:
22
- name: db-timescale-dense-imagine-pw # imagine db pw
22
+ name: cnpg-db-pgbench-imagine-pw # imagine db pw
23
23
 
24
24
  enableSuperuserAccess: true
25
25
  superuserSecret:
26
- name: db-timescale-dense-postgres-pw # postgres db pw
26
+ name: cnpg-db-pgbench-postgres-pw # postgres db pw
27
27
 
28
28
  affinity:
29
29
  # enablePodAntiAffinity: true
@@ -70,51 +70,31 @@ spec:
70
70
  storage:
71
71
  storageClass: premium-rwo
72
72
  size: 50Gi
73
- walStorage:
74
- storageClass: premium-rwo
75
- size: 1Gi
76
73
 
77
74
  backup:
78
75
  volumeSnapshot:
79
76
  labels:
80
- snapshotOf: db-timescale-dense
77
+ snapshotOf: cnpg-db-pgbench
81
78
  className: cnpg-snapshotclass
82
79
  barmanObjectStore:
83
80
  destinationPath: gs://OVH:<PROJECT_ID>-barman
84
81
  googleCredentials:
85
82
  gkeEnvironment: true
86
83
  tags:
87
- cnpgCluster: db-timescale-dense
84
+ cnpgCluster: cnpg-db-pgbench
88
85
  wal:
89
86
  compression: gzip
90
87
  ---
91
88
  apiVersion: postgresql.cnpg.io/v1
92
- kind: Pooler
93
- metadata:
94
- name: db-timescale-dense-pool-rw
95
- namespace: cnpg-operands
96
- spec:
97
- cluster:
98
- name: db-timescale-dense
99
-
100
- instances: 1
101
- type: rw
102
- pgbouncer:
103
- poolMode: session
104
- parameters:
105
- max_client_conn: "500"
106
- default_pool_size: "10"
107
- ---
108
- apiVersion: postgresql.cnpg.io/v1
109
89
  kind: ScheduledBackup
110
90
  metadata:
111
- name: db-timescale-dense-backup
91
+ name: cnpg-db-pgbench-backup
112
92
  namespace: cnpg-operands
113
93
  spec:
114
94
  # https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
115
95
  schedule: "0 0 * * * *"
116
96
  cluster:
117
- name: db-timescale-dense
97
+ name: cnpg-db-pgbench
118
98
  method: volumeSnapshot
119
99
  backupOwnerReference: self
120
100
  immediate: true
@@ -0,0 +1,2 @@
1
+ *.swp
2
+ cnpg-db-pgbench.yaml
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ #
3
+ # We only want to hibernate unless the intent is to really delete EVERYTHING
4
+ # which includes PVCs and volume snapshots.
5
+ #
6
+ printf "\nHibernating the cnpg-db-pgbench cluster...\n"
7
+ kubectl cnpg hibernate on -n cnpg-operands cnpg-db-pgbench
8
+
9
+ # *** DANGER ***
10
+ # kubectl delete will destroy the cluster pods and PVCs!!!!!
11
+ # *** DANGER ***
12
+ # kubectl do-not-do-this-delete -f cnpg-db-pgbench/cnpg-db-pgbench.yaml $K8S_WHAT
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ #
3
+ kubectl apply -f cnpg-db-pgbench/cluster.yaml $K8S_WHAT
@@ -0,0 +1,16 @@
1
+ apiVersion: postgresql.cnpg.io/v1
2
+ kind: Pooler
3
+ metadata:
4
+ name: cnpg-db-pgbench-pool-rw
5
+ namespace: cnpg-operands
6
+ spec:
7
+ cluster:
8
+ name: cnpg-db-pgbench
9
+
10
+ instances: 1
11
+ type: rw
12
+ pgbouncer:
13
+ poolMode: session
14
+ parameters:
15
+ max_client_conn: "500"
16
+ default_pool_size: "10"
@@ -3,24 +3,24 @@
3
3
  apiVersion: postgresql.cnpg.io/v1
4
4
  kind: Cluster
5
5
  metadata:
6
- name: db-postgres-stack
6
+ name: cnpg-db-psql-stack
7
7
  namespace: cnpg-operands
8
8
  spec:
9
9
  instances: 1
10
10
  # logLevel: debug
11
11
 
12
12
  description: "Leverege Stack PostgreSQL DB"
13
- imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.1-cnpg-tsdb2-beta.10
13
+ imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.2-cnpg-tsdb2-beta.4
14
14
  bootstrap:
15
15
  initdb:
16
16
  database: imagine
17
17
  owner: imagine
18
18
  secret:
19
- name: db-postgres-stack-imagine-pw # imagine db pw
19
+ name: cnpg-db-psql-stack-imagine-pw # imagine db pw
20
20
 
21
21
  enableSuperuserAccess: true
22
22
  superuserSecret:
23
- name: db-postgres-stack-postgres-pw # postgres db pw
23
+ name: cnpg-db-psql-stack-postgres-pw # postgres db pw
24
24
 
25
25
  affinity:
26
26
  # enablePodAntiAffinity: true
@@ -35,10 +35,10 @@ spec:
35
35
  # to the default ones to make the cluster work
36
36
  postgresql:
37
37
  parameters:
38
+ max_connections: "123"
38
39
  # max_worker_processes: "60"
39
40
  # max_worker_processes: "8"
40
41
  # max_parallel_workers: "8"
41
- max_connections: "500"
42
42
  # shared_buffers: 2GB
43
43
  # effective_cache_size: 6GB
44
44
  # maintenance_work_mem: 1GB
@@ -67,44 +67,40 @@ spec:
67
67
  retentionPolicy: 30d
68
68
  volumeSnapshot:
69
69
  labels:
70
- snapshotOf: db-postgres-stack
70
+ snapshotOf: cnpg-db-psql-stack
71
71
  className: cnpg-snapshotclass
72
72
  barmanObjectStore:
73
73
  destinationPath: gs://OVH:<PROJECT_ID>-barman
74
74
  googleCredentials:
75
75
  gkeEnvironment: true
76
76
  tags:
77
- cnpgCluster: db-postgres-stack
77
+ cnpgCluster: cnpg-db-psql-stack
78
78
  wal:
79
79
  compression: gzip
80
- #---
81
- #apiVersion: postgresql.cnpg.io/v1
82
- #kind: Pooler
83
- #metadata:
84
- # name: db-postgres-stack-pool-rw
85
- # namespace: cnpg-operands
86
- #spec:
87
- # cluster:
88
- # name: db-postgres-stack
89
- #
90
- # instances: 1
91
- # type: rw
92
- # pgbouncer:
93
- # poolMode: session
94
- # parameters:
95
- # max_client_conn: "500"
96
- # default_pool_size: "10"
97
80
  ---
98
81
  apiVersion: postgresql.cnpg.io/v1
99
82
  kind: ScheduledBackup
100
83
  metadata:
101
- name: db-postgres-stack-backup
84
+ name: cnpg-db-psql-stack-backup
102
85
  namespace: cnpg-operands
103
86
  spec:
104
87
  # https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
105
88
  schedule: "0 0 * * * *"
106
89
  cluster:
107
- name: db-postgres-stack
90
+ method: volumeSnapshot
91
+ backupOwnerReference: self
92
+ immediate: true
93
+ ---
94
+ apiVersion: postgresql.cnpg.io/v1
95
+ kind: ScheduledBackup
96
+ metadata:
97
+ name: cnpg-db-psql-stack-volsnap
98
+ namespace: cnpg-operands
99
+ spec:
100
+ # https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
101
+ schedule: "0 0 */4 * * *"
102
+ cluster:
103
+ name: cnpg-db-psql-stack
108
104
  method: volumeSnapshot
109
105
  backupOwnerReference: self
110
106
  immediate: true
@@ -0,0 +1,2 @@
1
+ *.swp
2
+ cnpg-db-psql-stack.yaml
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ #
3
+ # We only want to hibernate unless the intent is to really delete EVERYTHING
4
+ # which includes PVCs and volume snapshots.
5
+ #
6
+ printf "\nHibernating the cnpg-db-psql-stack cluster...\n"
7
+ kubectl cnpg hibernate on -n cnpg-operands cnpg-db-psql-stack
8
+
9
+ # *** DANGER ***
10
+ # kubectl delete will destroy the cluster
11
+ # *** DANGER ***
12
+ # kubectl delete -f cnpg-db-psql-stack/cnpg-db-psql-stack.yaml $K8S_WHAT
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ kubectl apply -f cnpg-db-psql-stack/cluster.yaml $K8S_WHAT
@@ -0,0 +1,16 @@
1
+ apiVersion: postgresql.cnpg.io/v1
2
+ kind: Pooler
3
+ metadata:
4
+ name: cnpg-db-psql-stack-pool-rw
5
+ namespace: cnpg-operands
6
+ spec:
7
+ cluster:
8
+ name: cnpg-db-psql-stack
9
+
10
+ instances: 1
11
+ type: rw
12
+ pgbouncer:
13
+ poolMode: session
14
+ parameters:
15
+ max_client_conn: "500"
16
+ default_pool_size: "10"
@@ -0,0 +1,110 @@
1
+ # Artifact Chart => https://artifacthub.io/packages/helm/cloudnative-pg/cloudnative-pg
2
+ # Examples Charts => https://cloudnative-pg.io/documentation/current/samples/
3
+ apiVersion: postgresql.cnpg.io/v1
4
+ kind: Cluster
5
+ metadata:
6
+ name: cnpg-db-tsdb-basic
7
+ namespace: cnpg-operands
8
+ spec:
9
+ instances: 1
10
+ logLevel: info # warning debug
11
+
12
+ monitoring:
13
+ enablePodMonitor: false # set true once monitoring is setup
14
+
15
+ description: "Leverege Plain Timescale DB"
16
+ imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.2-cnpg-tsdb2-beta.4
17
+ bootstrap:
18
+ initdb:
19
+ postInitTemplateSQL:
20
+ - CREATE EXTENSION timescaledb;
21
+ - CREATE EXTENSION jsquery;
22
+ database: imagine
23
+ owner: imagine
24
+ secret:
25
+ name: cnpg-db-tsdb-basic-imagine-pw # imagine db pw
26
+
27
+ enableSuperuserAccess: true
28
+ superuserSecret:
29
+ name: cnpg-db-tsdb-basic-postgres-pw # postgres db pw
30
+
31
+ affinity:
32
+ enablePodAntiAffinity: true
33
+ topologyKey: failure-domain.beta.kubernetes.io/zone
34
+ nodeAffinity:
35
+ requiredDuringSchedulingIgnoredDuringExecution:
36
+ nodeSelectorTerms:
37
+ - matchExpressions:
38
+ - key: target-env
39
+ operator: In
40
+ values:
41
+ - database
42
+ tolerations:
43
+ - key: "database"
44
+ operator: "Equal"
45
+ value: "true"
46
+ effect: "NoSchedule"
47
+
48
+ # Parameters and pg_hba configuration will be append
49
+ # to the default ones to make the cluster work
50
+ postgresql:
51
+ shared_preload_libraries:
52
+ - timescaledb
53
+ - jsquery
54
+ parameters:
55
+ max_connections: "123"
56
+ # max_worker_processes: "60"
57
+ # max_worker_processes: "8"
58
+ # max_parallel_workers: "8"
59
+ # shared_buffers: 2GB
60
+ # effective_cache_size: 6GB
61
+ # maintenance_work_mem: 1GB
62
+ # work_mem: 20MB
63
+ pg_hba:
64
+ # To access through TCP/IP you will need to get username
65
+ # and password from the secret cluster-example-custom-app
66
+ - host all all all md5
67
+
68
+ # Example of rolling update strategy:
69
+ # - unsupervised: automated update of the primary once all
70
+ # replicas have been upgraded (default)
71
+ # - supervised: requires manual supervision to perform
72
+ # the switchover of the primary
73
+ primaryUpdateStrategy: unsupervised
74
+
75
+ serviceAccountTemplate:
76
+ metadata:
77
+ annotations:
78
+ iam.gke.io/gcp-service-account: cnpg-operands-sa@OVH:<PROJECT_ID>.iam.gserviceaccount.com
79
+
80
+ storage:
81
+ storageClass: premium-rwo
82
+ size: 76Gi
83
+
84
+ backup:
85
+ volumeSnapshot:
86
+ labels:
87
+ snapshotOf: cnpg-db-tsdb-basic
88
+ className: cnpg-snapshotclass
89
+ barmanObjectStore:
90
+ destinationPath: gs://OVH:<PROJECT_ID>-barman
91
+ googleCredentials:
92
+ gkeEnvironment: true
93
+ tags:
94
+ cnpgCluster: cnpg-db-tsdb-basic
95
+ wal:
96
+ compression: gzip
97
+ ---
98
+ apiVersion: postgresql.cnpg.io/v1
99
+ kind: ScheduledBackup
100
+ metadata:
101
+ name: cnpg-db-tsdb-basic-volsnap
102
+ namespace: cnpg-operands
103
+ spec:
104
+ # https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
105
+ schedule: "0 0 */8 * * *"
106
+ cluster:
107
+ name: cnpg-db-tsdb-basic
108
+ method: volumeSnapshot
109
+ backupOwnerReference: self
110
+ immediate: true
@@ -0,0 +1,2 @@
1
+ *.swp
2
+ cnpg-db-tsdb-basic.yaml
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+ #
3
+ # We only want to hibernate unless the intent is to really delete EVERYTHING
4
+ # which includes PVCs and volume snapshots.
5
+ #
6
+ printf "\nHibernating the cnpg-db-tsdb-basic cluster...\n"
7
+ kubectl cnpg hibernate on -n cnpg-operands cnpg-db-tsdb-basic
8
+
9
+ # *** DANGER ***
10
+ # kubectl delete will destroy the cluster pods and PVCs!!!!!
11
+ # *** DANGER ***
12
+ # kubectl do-not-do-this-delete -f cnpg-db-tsdb-basic/cnpg-db-tsdb-basic.yaml $K8S_WHAT
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ #
3
+ kubectl apply -f cnpg-db-tsdb-basic/cluster.yaml $K8S_WHAT
@@ -0,0 +1,16 @@
1
+ apiVersion: postgresql.cnpg.io/v1
2
+ kind: Pooler
3
+ metadata:
4
+ name: cnpg-db-tsdb-basic-pool-rw
5
+ namespace: cnpg-operands
6
+ spec:
7
+ cluster:
8
+ name: cnpg-db-tsdb-basic
9
+
10
+ instances: 1
11
+ type: rw
12
+ pgbouncer:
13
+ poolMode: session
14
+ parameters:
15
+ max_client_conn: "500"
16
+ default_pool_size: "10"
File without changes
File without changes