@leverege/build-tools 2.48.6 → 2.49.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 +3 -4
- package/registry-compass.yaml +20 -0
- package/src/chart-compass.mjs +96 -0
- package/src/cnpg-snapshot.mjs +4 -29
- package/src/helm-charts/cnpg-db-pgbench/cnpg-db-pgbench.yaml.ovh +100 -0
- package/src/helm-charts/cnpg-db-pgbench/gitignore +2 -0
- package/src/helm-charts/cnpg-db-pgbench/helmdn.plugin +12 -0
- package/src/helm-charts/cnpg-db-pgbench/helmup.plugin +3 -0
- package/src/helm-charts/cnpg-db-pgbench/pooler.yaml +16 -0
- package/src/helm-charts/{db-postgres-stack/db-postgres-stack.yaml.ovh → cnpg-db-psql-stack/cnpg-db-psql-stack.yaml.ovh} +6 -24
- package/src/helm-charts/cnpg-db-psql-stack/gitignore +2 -0
- package/src/helm-charts/cnpg-db-psql-stack/helmdn.plugin +12 -0
- package/src/helm-charts/cnpg-db-psql-stack/helmup.plugin +3 -0
- package/src/helm-charts/cnpg-db-psql-stack/pooler.yaml +16 -0
- package/src/helm-charts/{db-timescale-plain/db-timescale-plain.yaml.ovh → cnpg-db-tsdb-basic/cnpg-db-tsdb-basic.yaml.ovh} +8 -28
- package/src/helm-charts/cnpg-db-tsdb-basic/gitignore +2 -0
- package/src/helm-charts/cnpg-db-tsdb-basic/helmdn.plugin +12 -0
- package/src/helm-charts/cnpg-db-tsdb-basic/helmup.plugin +3 -0
- package/src/helm-charts/cnpg-db-tsdb-basic/pooler.yaml +16 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/.nohelm +0 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/.nohelmdn +0 -0
- package/src/helm-charts/{db-timescale-dense/db-timescale-dense.yaml.ovh → cnpg-db-tsdb-dense/cnpg-db-tsdb-dense.yaml.ovh} +7 -27
- package/src/helm-charts/cnpg-db-tsdb-dense/gitignore +2 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/helmdn.plugin +12 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/helmup.plugin +5 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/pooler.yaml +16 -0
- package/src/helm-charts/elasticsearch8/helmup.plugin +4 -5
- package/src/helm-charts/kube-prometheus-stack/helmup.plugin +13 -0
- package/src/helm-charts/kube-prometheus-stack/old-values-local.yaml +764 -0
- package/src/helm-charts/pusher/values-local.yaml +2 -2
- package/src/helmup.sh +14 -25
- package/src/helm-charts/db-postgres-stack/gitignore +0 -1
- package/src/helm-charts/db-postgres-stack/helmdn.plugin +0 -3
- package/src/helm-charts/db-postgres-stack/helmup.plugin +0 -3
- package/src/helm-charts/db-timescale-dense/gitignore +0 -1
- package/src/helm-charts/db-timescale-dense/helmdn.plugin +0 -9
- package/src/helm-charts/db-timescale-dense/helmup.plugin +0 -5
- package/src/helm-charts/db-timescale-plain/gitignore +0 -1
- package/src/helm-charts/db-timescale-plain/helmdn.plugin +0 -3
- package/src/helm-charts/db-timescale-plain/helmup.plugin +0 -3
- /package/src/helm-charts/{db-postgres-stack → cnpg-db-pgbench}/.nohelm +0 -0
- /package/src/helm-charts/{db-postgres-stack → cnpg-db-pgbench}/.nohelmdn +0 -0
- /package/src/helm-charts/{db-timescale-dense → cnpg-db-psql-stack}/.nohelm +0 -0
- /package/src/helm-charts/{db-timescale-dense → cnpg-db-psql-stack}/.nohelmdn +0 -0
- /package/src/helm-charts/{db-timescale-plain → cnpg-db-tsdb-basic}/.nohelm +0 -0
- /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.
|
|
3
|
+
"version": "2.49.0",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"deepmerge": "^4.3.1",
|
|
63
63
|
"enquirer": "^2.4.1",
|
|
64
64
|
"execa": "^8.0.1",
|
|
65
|
-
"glob": "^10.3.
|
|
65
|
+
"glob": "^10.3.12",
|
|
66
66
|
"handlebars": "^4.7.8",
|
|
67
67
|
"inquirer": "^9.2.16",
|
|
68
68
|
"js-yaml": "^4.1.0",
|
|
@@ -73,8 +73,7 @@
|
|
|
73
73
|
"read-pkg": "^9.0.1",
|
|
74
74
|
"readline-sync": "^1.4.10",
|
|
75
75
|
"semver": "^7.6.0",
|
|
76
|
-
"simple-git": "^3.
|
|
77
|
-
"tempy": "^3.1.0",
|
|
76
|
+
"simple-git": "^3.24.0",
|
|
78
77
|
"zx": "^7.2.3"
|
|
79
78
|
},
|
|
80
79
|
"devDependencies": {
|
|
@@ -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' )
|
package/src/cnpg-snapshot.mjs
CHANGED
|
@@ -1,38 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import fs from 'node:fs'
|
|
4
|
-
|
|
5
|
-
import handlebars from 'handlebars'
|
|
6
|
-
import { temporaryFile } from 'tempy'
|
|
7
|
-
|
|
8
3
|
import {
|
|
9
|
-
|
|
10
|
-
debug,
|
|
4
|
+
log,
|
|
11
5
|
shellCmd,
|
|
12
6
|
} from './Utils.mjs'
|
|
13
7
|
|
|
14
|
-
const backup = `
|
|
15
|
-
apiVersion: postgresql.cnpg.io/v1
|
|
16
|
-
kind: Backup
|
|
17
|
-
metadata:
|
|
18
|
-
name: {{clusterName}}-snapshot-{{dateTimestamp}}
|
|
19
|
-
namespace: cnpg-operands
|
|
20
|
-
labels:
|
|
21
|
-
cnpg-backup: manual
|
|
22
|
-
cnpg-operand: {{clusterName}}
|
|
23
|
-
spec:
|
|
24
|
-
method: volumeSnapshot
|
|
25
|
-
cluster:
|
|
26
|
-
name: {{clusterName}}`
|
|
27
|
-
|
|
28
|
-
const dateTimestamp = getDateTimestamp()
|
|
29
8
|
const clusterName = process.argv[2]
|
|
30
|
-
const compiled = handlebars.compile( backup )
|
|
31
|
-
const replaced = compiled( { dateTimestamp, clusterName } )
|
|
32
|
-
const tmpfile = temporaryFile()
|
|
33
9
|
|
|
34
|
-
debug( { replaced, tmpfile }, '<==Apply That' )
|
|
35
|
-
|
|
36
|
-
fs.writeFileSync( tmpfile, replaced ) // eslint-disable-line security/detect-non-literal-fs-filename
|
|
37
10
|
await shellCmd( 'overwhelm' )
|
|
38
|
-
await shellCmd( `kubectl
|
|
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' )
|
|
@@ -0,0 +1,100 @@
|
|
|
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-pgbench
|
|
7
|
+
namespace: cnpg-operands
|
|
8
|
+
spec:
|
|
9
|
+
instances: 1
|
|
10
|
+
logLevel: info # warning debug
|
|
11
|
+
|
|
12
|
+
description: "Leverege PG Bench Timescale DB"
|
|
13
|
+
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.1-cnpg-tsdb2-beta.6
|
|
14
|
+
bootstrap:
|
|
15
|
+
initdb:
|
|
16
|
+
postInitTemplateSQL:
|
|
17
|
+
- CREATE EXTENSION timescaledb;
|
|
18
|
+
- CREATE EXTENSION jsquery;
|
|
19
|
+
database: imagine
|
|
20
|
+
owner: imagine
|
|
21
|
+
secret:
|
|
22
|
+
name: cnpg-db-pgbench-imagine-pw # imagine db pw
|
|
23
|
+
|
|
24
|
+
enableSuperuserAccess: true
|
|
25
|
+
superuserSecret:
|
|
26
|
+
name: cnpg-db-pgbench-postgres-pw # postgres db pw
|
|
27
|
+
|
|
28
|
+
affinity:
|
|
29
|
+
# enablePodAntiAffinity: true
|
|
30
|
+
# topologyKey: failure-domain.beta.kubernetes.io/zone
|
|
31
|
+
tolerations:
|
|
32
|
+
- key: "database"
|
|
33
|
+
operator: "Equal"
|
|
34
|
+
value: "true"
|
|
35
|
+
effect: "NoSchedule"
|
|
36
|
+
|
|
37
|
+
# Parameters and pg_hba configuration will be append
|
|
38
|
+
# to the default ones to make the cluster work
|
|
39
|
+
postgresql:
|
|
40
|
+
shared_preload_libraries:
|
|
41
|
+
- timescaledb
|
|
42
|
+
- jsquery
|
|
43
|
+
parameters:
|
|
44
|
+
# max_worker_processes: "60"
|
|
45
|
+
max_worker_processes: "8"
|
|
46
|
+
max_parallel_workers: "8"
|
|
47
|
+
shared_buffers: 2GB
|
|
48
|
+
effective_cache_size: 6GB
|
|
49
|
+
maintenance_work_mem: 1GB
|
|
50
|
+
work_mem: 20MB
|
|
51
|
+
pg_hba:
|
|
52
|
+
# To access through TCP/IP you will need to get username
|
|
53
|
+
# and password from the secret cluster-example-custom-app
|
|
54
|
+
- host all all all md5
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# Example of rolling update strategy:
|
|
58
|
+
# - unsupervised: automated update of the primary once all
|
|
59
|
+
# replicas have been upgraded (default)
|
|
60
|
+
# - supervised: requires manual supervision to perform
|
|
61
|
+
# the switchover of the primary
|
|
62
|
+
primaryUpdateStrategy: unsupervised
|
|
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
|
+
# Require 50Gi of space per instance using ssd storage class
|
|
70
|
+
storage:
|
|
71
|
+
storageClass: premium-rwo
|
|
72
|
+
size: 50Gi
|
|
73
|
+
|
|
74
|
+
backup:
|
|
75
|
+
volumeSnapshot:
|
|
76
|
+
labels:
|
|
77
|
+
snapshotOf: cnpg-db-pgbench
|
|
78
|
+
className: cnpg-snapshotclass
|
|
79
|
+
barmanObjectStore:
|
|
80
|
+
destinationPath: gs://OVH:<PROJECT_ID>-barman
|
|
81
|
+
googleCredentials:
|
|
82
|
+
gkeEnvironment: true
|
|
83
|
+
tags:
|
|
84
|
+
cnpgCluster: cnpg-db-pgbench
|
|
85
|
+
wal:
|
|
86
|
+
compression: gzip
|
|
87
|
+
---
|
|
88
|
+
apiVersion: postgresql.cnpg.io/v1
|
|
89
|
+
kind: ScheduledBackup
|
|
90
|
+
metadata:
|
|
91
|
+
name: cnpg-db-pgbench-backup
|
|
92
|
+
namespace: cnpg-operands
|
|
93
|
+
spec:
|
|
94
|
+
# https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
|
|
95
|
+
schedule: "0 0 * * * *"
|
|
96
|
+
cluster:
|
|
97
|
+
name: cnpg-db-pgbench
|
|
98
|
+
method: volumeSnapshot
|
|
99
|
+
backupOwnerReference: self
|
|
100
|
+
immediate: true
|
|
@@ -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,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,7 +3,7 @@
|
|
|
3
3
|
apiVersion: postgresql.cnpg.io/v1
|
|
4
4
|
kind: Cluster
|
|
5
5
|
metadata:
|
|
6
|
-
name: db-
|
|
6
|
+
name: cnpg-db-psql-stack
|
|
7
7
|
namespace: cnpg-operands
|
|
8
8
|
spec:
|
|
9
9
|
instances: 1
|
|
@@ -16,11 +16,11 @@ spec:
|
|
|
16
16
|
database: imagine
|
|
17
17
|
owner: imagine
|
|
18
18
|
secret:
|
|
19
|
-
name: db-
|
|
19
|
+
name: cnpg-db-psql-stack-imagine-pw # imagine db pw
|
|
20
20
|
|
|
21
21
|
enableSuperuserAccess: true
|
|
22
22
|
superuserSecret:
|
|
23
|
-
name: db-
|
|
23
|
+
name: cnpg-db-psql-stack-postgres-pw # postgres db pw
|
|
24
24
|
|
|
25
25
|
affinity:
|
|
26
26
|
# enablePodAntiAffinity: true
|
|
@@ -67,44 +67,26 @@ spec:
|
|
|
67
67
|
retentionPolicy: 30d
|
|
68
68
|
volumeSnapshot:
|
|
69
69
|
labels:
|
|
70
|
-
snapshotOf: db-
|
|
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-
|
|
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-
|
|
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
|
|
108
90
|
method: volumeSnapshot
|
|
109
91
|
backupOwnerReference: self
|
|
110
92
|
immediate: true
|
|
@@ -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,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"
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
apiVersion: postgresql.cnpg.io/v1
|
|
4
4
|
kind: Cluster
|
|
5
5
|
metadata:
|
|
6
|
-
name: db-
|
|
6
|
+
name: cnpg-db-tsdb-basic
|
|
7
7
|
namespace: cnpg-operands
|
|
8
8
|
spec:
|
|
9
9
|
instances: 1
|
|
10
|
-
logLevel: debug
|
|
10
|
+
logLevel: info # warning debug
|
|
11
11
|
|
|
12
12
|
description: "Leverege Plain Timescale DB"
|
|
13
13
|
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.1-cnpg-tsdb2-beta.6
|
|
@@ -19,11 +19,11 @@ spec:
|
|
|
19
19
|
database: imagine
|
|
20
20
|
owner: imagine
|
|
21
21
|
secret:
|
|
22
|
-
name: db-
|
|
22
|
+
name: cnpg-db-tsdb-basic-imagine-pw # imagine db pw
|
|
23
23
|
|
|
24
24
|
enableSuperuserAccess: true
|
|
25
25
|
superuserSecret:
|
|
26
|
-
name: db-
|
|
26
|
+
name: cnpg-db-tsdb-basic-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-
|
|
77
|
+
snapshotOf: cnpg-db-tsdb-basic
|
|
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-
|
|
84
|
+
cnpgCluster: cnpg-db-tsdb-basic
|
|
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-plain-pool-rw
|
|
95
|
-
namespace: cnpg-operands
|
|
96
|
-
spec:
|
|
97
|
-
cluster:
|
|
98
|
-
name: db-timescale-plain
|
|
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-
|
|
91
|
+
name: cnpg-db-tsdb-basic-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-
|
|
97
|
+
name: cnpg-db-tsdb-basic
|
|
118
98
|
method: volumeSnapshot
|
|
119
99
|
backupOwnerReference: self
|
|
120
100
|
immediate: true
|
|
@@ -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,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
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
apiVersion: postgresql.cnpg.io/v1
|
|
4
4
|
kind: Cluster
|
|
5
5
|
metadata:
|
|
6
|
-
name: db-
|
|
6
|
+
name: cnpg-db-tsdb-dense
|
|
7
7
|
namespace: cnpg-operands
|
|
8
8
|
spec:
|
|
9
9
|
instances: 1
|
|
@@ -19,11 +19,11 @@ spec:
|
|
|
19
19
|
database: imagine
|
|
20
20
|
owner: imagine
|
|
21
21
|
secret:
|
|
22
|
-
name: db-
|
|
22
|
+
name: cnpg-db-tsdb-dense-imagine-pw # imagine db pw
|
|
23
23
|
|
|
24
24
|
enableSuperuserAccess: true
|
|
25
25
|
superuserSecret:
|
|
26
|
-
name: db-
|
|
26
|
+
name: cnpg-db-tsdb-dense-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-
|
|
77
|
+
snapshotOf: cnpg-db-tsdb-dense
|
|
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-
|
|
84
|
+
cnpgCluster: cnpg-db-tsdb-dense
|
|
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-
|
|
91
|
+
name: cnpg-db-tsdb-dense-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-
|
|
97
|
+
name: cnpg-db-tsdb-dense
|
|
118
98
|
method: volumeSnapshot
|
|
119
99
|
backupOwnerReference: self
|
|
120
100
|
immediate: true
|
|
@@ -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-dense cluster...\n"
|
|
7
|
+
kubectl cnpg hibernate on -n cnpg-operands cnpg-db-tsdb-dense
|
|
8
|
+
|
|
9
|
+
# *** DANGER ***
|
|
10
|
+
# kubectl delete will destroy the cluster
|
|
11
|
+
# *** DANGER ***
|
|
12
|
+
# kubectl delete -f cnpg-db-tsdb-dense/cnpg-db-tsdb-dense.yaml $K8S_WHAT
|