@leverege/build-tools 2.96.8 → 2.97.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/.vscode/launch.json +21 -1
- package/package.json +10 -10
- package/src/Utils.mjs +6 -1
- package/src/artifacts/Utils.mjs +5 -2
- package/src/build-cnpg-image.mjs +0 -1
- package/src/chart-compass.yaml +1 -1
- package/src/chart-to-registry.mjs +10 -1
- package/src/helm-charts/api-server/values-local.yaml +3 -0
- package/src/helm-charts/cnpg-db-psql-stack/cluster.yaml.ovh +37 -32
- package/src/helm-charts/cnpg-db-psql-stack/pooler.yaml +2 -0
- package/src/helm-charts/cnpg-db-recovery/cluster.yaml.ovh +1 -1
- package/src/helm-charts/cnpg-db-tsdb-basic/cluster.yaml.ovh +50 -46
- package/src/helm-charts/cnpg-db-tsdb-basic/pooler.yaml +2 -0
- package/src/helm-charts/cnpg-db-tsdb-dense/cluster.yaml.ovh +55 -47
- package/src/helm-charts/cnpg-db-tsdb-dense/pooler.yaml +2 -0
- package/src/helm-charts/cnpg-operator/helmup.bootstrap +8 -0
- package/src/helm-charts/cnpg-operator/helmup.plugin +29 -4
- package/src/helm-charts/db-curator/values-local.yaml +9 -1
- package/src/helm-charts/elasticsearch8/elasticsearch-local.yaml +54 -51
- package/src/helm-charts/emailer/values-local.yaml +4 -1
- package/src/helm-charts/messenger/values-local.yaml +1 -5
- package/src/helm-charts/pgbouncer/values-local.yaml +8 -3
- package/src/helm-charts/prom-operator/helmup.bootstrap +8 -5
- package/src/helm-charts/prom-operator/helmup.plugin +1 -1
- package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +51 -11
- package/src/helm-charts/prom-operator/rules/elasticsearch-rules.yaml +1 -1
- package/src/helm-charts/prom-operator/rules/kubestate-rules.yaml +1 -1
- package/src/helm-charts/push-notifier/values-local.yaml +8 -0
- package/src/helm-charts/redis/values-local.yaml +2 -1
- package/src/helm-charts/traefik/values-local.yaml +1 -1
- package/src/helm-charts/transponder-dh/values-local.yaml +1 -0
- package/src/helm-charts/transponder-tsdb/values-local.yaml +1 -0
- package/src/helm-charts/velero/helmup.plugin +2 -2
- package/src/helm-charts/velero/values-local.yaml +17 -15
- package/src/helmdn.sh +1 -1
- package/src/helmup.sh +3 -3
- package/src/init-my-chart/Chartwright.mjs +69 -0
- package/src/init-my-chart/init-my-chart-v1.mjs +124 -0
- package/src/init-my-chart/init-my-chart.mjs +80 -0
- package/src/init-my-chart/leaf-chart-templates/Chart.yaml.hbs +10 -0
- package/src/init-my-chart/leaf-chart-templates/templates/configmap.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/templates/deployment.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/templates/hpa.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/templates/pdb.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/templates/service.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/templates/serviceaccount.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/templates/servicemonitor.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/values.schema.json +623 -0
- package/src/init-my-chart/leaf-chart-templates/values.yaml.hbs +135 -0
- package/src/init-my-chart/legacy-helm-template/Chart.yaml +5 -0
- package/src/init-my-chart/legacy-helm-template/templates/NOTES.txt +5 -0
- package/src/init-my-chart/legacy-helm-template/templates/_helpers.tpl +135 -0
- package/src/init-my-chart/legacy-helm-template/templates/configmap.yaml +10 -0
- package/src/init-my-chart/legacy-helm-template/templates/deployment.yaml +125 -0
- package/src/init-my-chart/legacy-helm-template/templates/hpa.yaml +26 -0
- package/src/init-my-chart/legacy-helm-template/templates/ingressroute.yaml +18 -0
- package/src/init-my-chart/legacy-helm-template/templates/pdb.yaml +22 -0
- package/src/init-my-chart/legacy-helm-template/templates/service.yaml +15 -0
- package/src/init-my-chart/legacy-helm-template/templates/serviceaccount.yaml +13 -0
- package/src/init-my-chart/legacy-helm-template/templates/servicemonitor.yaml +23 -0
- package/src/init-my-chart/legacy-helm-template/values.yaml +152 -0
- package/src/testOauthLogic.mjs +12 -0
- package/leverege-build-tools-2.21.13.tgz +0 -0
- package/lib/server/build-tools.js +0 -138
- package/lib/server/firebaseDeploy.js +0 -195
- package/lib/server/firebaseServe.js +0 -116
- package/lib/server/getfbcfg.js +0 -25
- package/lib/server/getjson.js +0 -70
- package/lib/server/overwhelm.js +0 -447
- package/lib/server/push-my-chart.js +0 -18
- package/lib/server/refresh-npm-token.js +0 -135
- package/lib/server/tag-release.js +0 -681
- package/lib/server/unleash.js +0 -50
- package/lib/web/build-tools.js +0 -138
- package/lib/web/firebaseDeploy.js +0 -195
- package/lib/web/firebaseServe.js +0 -116
- package/lib/web/getfbcfg.js +0 -25
- package/lib/web/getjson.js +0 -70
- package/lib/web/overwhelm.js +0 -447
- package/lib/web/push-my-chart.js +0 -18
- package/lib/web/refresh-npm-token.js +0 -135
- package/lib/web/tag-release.js +0 -681
- package/lib/web/unleash.js +0 -50
- package/src/helm-charts/prom-operator/rules/awesome-base/elasticsearch-rules.yaml +0 -219
- package/src/helm-charts/prom-operator/rules/awesome-base/google-cadvisor.yaml +0 -108
- package/src/helm-charts/prom-operator/rules/awesome-base/kubestate-exporter.yaml +0 -394
- package/src/helm-charts/prom-operator/rules/awesome-base/prometheus-rules.yaml +0 -318
- package/src/helm-charts/prom-operator/rules/awesome-base/redis-rules.yaml +0 -142
- package/src/helm-charts/prom-operator/rules/awesome-base/traefik-rules.yaml +0 -43
- package/src/init-my-chart.mjs +0 -18
package/.vscode/launch.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": "0.2.0",
|
|
3
3
|
"configurations": [
|
|
4
4
|
{
|
|
5
|
+
"name": "Units Tests",
|
|
5
6
|
"type": "node",
|
|
6
7
|
"request": "launch",
|
|
7
|
-
"name": "Test",
|
|
8
8
|
"runtimeExecutable": "npm",
|
|
9
9
|
"runtimeArgs": [
|
|
10
10
|
"run",
|
|
@@ -18,6 +18,26 @@
|
|
|
18
18
|
},
|
|
19
19
|
"outputCapture": "std"
|
|
20
20
|
},
|
|
21
|
+
{
|
|
22
|
+
"name": "init-my-chart pubsub-pulse",
|
|
23
|
+
"type": "node",
|
|
24
|
+
"request": "launch",
|
|
25
|
+
"program": "${workspaceFolder}/src/init-my-chart/init-my-chart.mjs",
|
|
26
|
+
"args": ["--dry-run"],
|
|
27
|
+
"cwd": "/Users/john/Work/leverege/cicd/@srv/pubsub-pulse",
|
|
28
|
+
"runtimeExecutable": "node",
|
|
29
|
+
"console": "integratedTerminal"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "init-my-chart no helm dir",
|
|
33
|
+
"type": "node",
|
|
34
|
+
"request": "launch",
|
|
35
|
+
"program": "${workspaceFolder}/src/init-my-chart/init-my-chart.mjs",
|
|
36
|
+
"args": ["--dry-run"],
|
|
37
|
+
"cwd": "/Users/john/Work/leverege/cicd/@tst/iggy-pop",
|
|
38
|
+
"runtimeExecutable": "node",
|
|
39
|
+
"console": "integratedTerminal"
|
|
40
|
+
},
|
|
21
41
|
{
|
|
22
42
|
"name": "service-man (launch)",
|
|
23
43
|
"type": "node",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.97.0",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -84,27 +84,27 @@
|
|
|
84
84
|
"chalk": "^5.6.2",
|
|
85
85
|
"command-line-args": "^6.0.1",
|
|
86
86
|
"command-line-usage": "^7.0.3",
|
|
87
|
-
"commander": "^14.0.
|
|
87
|
+
"commander": "^14.0.3",
|
|
88
88
|
"deepmerge": "^4.3.1",
|
|
89
89
|
"enquirer": "^2.4.1",
|
|
90
90
|
"execa": "^9.6.1",
|
|
91
91
|
"find-yarn-workspace-root": "^2.0.0",
|
|
92
|
-
"glob": "^13.0.
|
|
93
|
-
"googleapis": "^
|
|
92
|
+
"glob": "^13.0.6",
|
|
93
|
+
"googleapis": "^171.4.0",
|
|
94
94
|
"handlebars": "^4.7.8",
|
|
95
95
|
"ignore": "^7.0.5",
|
|
96
|
-
"inquirer": "^13.2.
|
|
96
|
+
"inquirer": "^13.2.5",
|
|
97
97
|
"js-yaml": "^4.1.1",
|
|
98
98
|
"jsdoc": "^4.0.5",
|
|
99
99
|
"ms": "^2.1.3",
|
|
100
100
|
"npm-registry-fetch": "^19.1.1",
|
|
101
|
-
"ora": "^9.
|
|
102
|
-
"p-limit": "^7.
|
|
101
|
+
"ora": "^9.3.0",
|
|
102
|
+
"p-limit": "^7.3.0",
|
|
103
103
|
"package-up": "^5.0.0",
|
|
104
104
|
"readline-sync": "^1.4.10",
|
|
105
|
-
"semver": "^7.7.
|
|
105
|
+
"semver": "^7.7.4",
|
|
106
106
|
"shell-quote": "^1.8.3",
|
|
107
|
-
"simple-git": "^3.
|
|
107
|
+
"simple-git": "^3.31.1",
|
|
108
108
|
"sloc": "^0.3.2",
|
|
109
109
|
"superstruct": "^2.0.2",
|
|
110
110
|
"tmp": "^0.2.5",
|
|
@@ -115,6 +115,6 @@
|
|
|
115
115
|
"@leverege/eslint-config-leverege": "^5.1.2",
|
|
116
116
|
"chai": "^6.2.2",
|
|
117
117
|
"mocha": "^11.7.5",
|
|
118
|
-
"npm": "^11.
|
|
118
|
+
"npm": "^11.10.1"
|
|
119
119
|
}
|
|
120
120
|
}
|
package/src/Utils.mjs
CHANGED
|
@@ -570,7 +570,9 @@ export const parseHelmChart = async ( helmroot = './helm' ) => {
|
|
|
570
570
|
registryProject : registryComponents[1],
|
|
571
571
|
registryRepository : registryComponents[2],
|
|
572
572
|
files : chartFiles,
|
|
573
|
-
|
|
573
|
+
Chart : chartYaml,
|
|
574
|
+
Values : valuesYaml,
|
|
575
|
+
yaml : { // DEPRECATED
|
|
574
576
|
'Chart.yaml' : chartYaml,
|
|
575
577
|
'values.yaml' : valuesYaml,
|
|
576
578
|
}
|
|
@@ -612,6 +614,7 @@ export const analyzeRepository = async ( giveGuidance ) => {
|
|
|
612
614
|
gitRoot,
|
|
613
615
|
subPkgs,
|
|
614
616
|
helmChart,
|
|
617
|
+
isGitRepo,
|
|
615
618
|
isMonoRepo,
|
|
616
619
|
isNodeJsProject,
|
|
617
620
|
isPythonProject,
|
|
@@ -717,6 +720,7 @@ export const analyzeRepository = async ( giveGuidance ) => {
|
|
|
717
720
|
gitRoot,
|
|
718
721
|
gitRemote,
|
|
719
722
|
helmChart,
|
|
723
|
+
isGitRepo,
|
|
720
724
|
isMonoRepo,
|
|
721
725
|
isNpmWorkspace,
|
|
722
726
|
isNodeJsProject,
|
|
@@ -754,6 +758,7 @@ export function getSecretsDir() {
|
|
|
754
758
|
}
|
|
755
759
|
|
|
756
760
|
export function getIsYarnProject( gitRoot ) {
|
|
761
|
+
if ( !gitRoot ) { return false }
|
|
757
762
|
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
758
763
|
return fs.existsSync( path.join( gitRoot, 'yarn.lock' ) ) || isDir( path.join( gitRoot, '.yarn' ) )
|
|
759
764
|
}
|
package/src/artifacts/Utils.mjs
CHANGED
|
@@ -160,7 +160,7 @@ const parseGenericArtifactSchemaToArtifactName = ( genericArtifactSchema ) => {
|
|
|
160
160
|
const calculateHash = async ( path ) => {
|
|
161
161
|
try {
|
|
162
162
|
const hash = crypto.createHash( 'sha256' )
|
|
163
|
-
hash.update( await fs.promises.readFile( path ) )
|
|
163
|
+
hash.update( await fs.promises.readFile( path ) ) // eslint-disable-line security/detect-non-literal-fs-filename
|
|
164
164
|
return `${hash.digest( 'base64url' )}=`
|
|
165
165
|
} catch ( error ) {
|
|
166
166
|
throw new Error( `Failed to calculate hash for artifact ${path}: ${error.message}` )
|
|
@@ -200,6 +200,7 @@ const getMissingRemoteFiles = async ( genericArtifactFiles, genericArtifactSchem
|
|
|
200
200
|
actualFiles.add( { remoteFilePath : actualRemoteFilePath, remoteFileHash : actualRemoteFileHash } )
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
/* eslint-disable security/detect-non-literal-fs-filename */
|
|
203
204
|
if ( ( await fs.promises.stat( expectedLocalRelativePath ) ).isDirectory() ) {
|
|
204
205
|
const localFiles = await fs.promises.readdir( expectedLocalRelativePath, { withFileTypes : true, recursive : true } )
|
|
205
206
|
for ( const localFile of localFiles ) {
|
|
@@ -209,6 +210,7 @@ const getMissingRemoteFiles = async ( genericArtifactFiles, genericArtifactSchem
|
|
|
209
210
|
|
|
210
211
|
const expectedRemoteFilePath = path.join( expectedRemoteRelativePath, localFile.path.replace( expectedLocalRelativePath, '' ), localFile.name )
|
|
211
212
|
const expectedLocalFilePath = path.join( localFile.path, localFile.name )
|
|
213
|
+
// eslint-disable-next-line no-await-in-loop
|
|
212
214
|
expectedFiles.add( { remoteFilePath : expectedRemoteFilePath, remoteFileHash : await calculateHash( expectedLocalFilePath ) } )
|
|
213
215
|
}
|
|
214
216
|
} else {
|
|
@@ -216,6 +218,7 @@ const getMissingRemoteFiles = async ( genericArtifactFiles, genericArtifactSchem
|
|
|
216
218
|
const expectedLocalFilePath = expectedLocalRelativePath
|
|
217
219
|
expectedFiles.add( { remoteFilePath : expectedRemoteFilePath, remoteFileHash : await calculateHash( expectedLocalFilePath ) } )
|
|
218
220
|
}
|
|
221
|
+
/* eslint-enable security/detect-non-literal-fs-filename */
|
|
219
222
|
|
|
220
223
|
const actualArray = Array.from( actualFiles )
|
|
221
224
|
const expectedArray = Array.from( expectedFiles )
|
|
@@ -243,7 +246,7 @@ const shouldUseIgnoreConfiguration = async () => {
|
|
|
243
246
|
const findIgnoreFilePath = async ( relativePath ) => {
|
|
244
247
|
if ( relativePath ) {
|
|
245
248
|
const ignoreFilePath = path.join( relativePath, '.gcloudignore' )
|
|
246
|
-
if ( fs.existsSync( ignoreFilePath ) ) {
|
|
249
|
+
if ( fs.existsSync( ignoreFilePath ) ) { // eslint-disable-line security/detect-non-literal-fs-filename
|
|
247
250
|
return ignoreFilePath
|
|
248
251
|
}
|
|
249
252
|
}
|
package/src/build-cnpg-image.mjs
CHANGED
|
@@ -102,7 +102,6 @@ RUN set -xe; \\
|
|
|
102
102
|
apt-get update; \\
|
|
103
103
|
apt-get install -y --no-install-recommends \\
|
|
104
104
|
"postgresql-\${PG_MAJOR}-jsquery" \\
|
|
105
|
-
"postgresql-\${PG_MAJOR}-repack" \\
|
|
106
105
|
"postgresql-\${PG_MAJOR}-squeeze"; \\
|
|
107
106
|
ln -s /usr/lib/postgresql/\${PG_MAJOR}/bin/pg_repack /usr/local/bin/pg_repack || true; \\
|
|
108
107
|
rm -fr /tmp/*; \\
|
package/src/chart-compass.yaml
CHANGED
|
@@ -41,6 +41,11 @@ const commandLineOptions = [ // Use commandLineOptions to tie into the Usage sta
|
|
|
41
41
|
type : String,
|
|
42
42
|
description : '{green the target repository to receive the pushed chart}',
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
name : 'auth-only',
|
|
46
|
+
type : Boolean,
|
|
47
|
+
description : '{green update artifact registry auth token and exit}',
|
|
48
|
+
},
|
|
44
49
|
{
|
|
45
50
|
name : 'dry-run',
|
|
46
51
|
type : Boolean,
|
|
@@ -100,7 +105,11 @@ const registryProject = args.project || helmChart.registryProject
|
|
|
100
105
|
const registryRepository = args.repository || helmChart.registryRepository
|
|
101
106
|
|
|
102
107
|
// deal with oauth token shenanigans
|
|
103
|
-
await establishOauthAccess( registryLocation )
|
|
108
|
+
const oauthResults = await establishOauthAccess( registryLocation )
|
|
109
|
+
debug( { oauthResults, registryLocation }, '<===OAuth Login' )
|
|
110
|
+
if ( args.authOnly ) {
|
|
111
|
+
process.exit( 0 )
|
|
112
|
+
}
|
|
104
113
|
|
|
105
114
|
let ociPushEndpoint = `oci://${registryLocation}/${registryProject}/${registryRepository}`
|
|
106
115
|
// charts that are type "library" are base charts used via chart dependencies, however if
|
|
@@ -16,6 +16,9 @@ config:
|
|
|
16
16
|
PG_MODELS_HOST: "cnpg-db-psql-stack-rw.cnpg-operands"
|
|
17
17
|
# timescale
|
|
18
18
|
PG_HOST: "cnpg-db-tsdb-basic-r.cnpg-operands"
|
|
19
|
+
# imagine db is legacy - newer setups use timescale as the db name
|
|
20
|
+
PG_DATABASE: "timescale"
|
|
21
|
+
PG_DENSE_HISTORY_DATABASE: "timescale"
|
|
19
22
|
|
|
20
23
|
# The settings on the left are for the "standard" legacy chart settings which
|
|
21
24
|
# specifiy the old k8s secrets setups and are the defaults values from the
|
|
@@ -4,22 +4,21 @@ 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
|
|
8
7
|
instances: 1
|
|
9
8
|
logLevel: info # warning debug
|
|
10
9
|
|
|
11
10
|
monitoring:
|
|
12
|
-
enablePodMonitor:
|
|
11
|
+
enablePodMonitor: true # set true once monitoring is setup
|
|
13
12
|
|
|
14
|
-
# https://console.cloud.google.com/artifacts/docker/leverege-registry/us/system/images%2Fleverege-pgsql?project=leverege-registry
|
|
15
|
-
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.5-cnpg-lvrg-rel.1
|
|
16
13
|
description: "Leverege Stack PostgreSQL DB"
|
|
14
|
+
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.6-cnpg-lvrg-final
|
|
17
15
|
bootstrap:
|
|
18
16
|
initdb:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# create the extensions
|
|
17
|
+
postInitTemplateSQL:
|
|
18
|
+
# load necessary extensions for stack psql
|
|
22
19
|
- CREATE EXTENSION pg_stat_statements;
|
|
20
|
+
- CREATE EXTENSION pg_squeeze;
|
|
21
|
+
|
|
23
22
|
# create the stack databases
|
|
24
23
|
- CREATE DATABASE authz;
|
|
25
24
|
- CREATE DATABASE fota;
|
|
@@ -27,23 +26,18 @@ spec:
|
|
|
27
26
|
- CREATE DATABASE models;
|
|
28
27
|
- CREATE DATABASE scheduler;
|
|
29
28
|
|
|
30
|
-
#
|
|
29
|
+
# TODO: move away from superuser access
|
|
31
30
|
enableSuperuserAccess: true
|
|
32
31
|
superuserSecret:
|
|
33
32
|
name: cnpg-db-psql-stack-postgres-pw # postgres db pw created by helmup
|
|
34
33
|
|
|
35
|
-
#
|
|
36
|
-
storage:
|
|
37
|
-
storageClass: premium-rwo
|
|
38
|
-
size: 50Gi
|
|
39
|
-
# walStorage:
|
|
40
|
-
# storageClass: premium-rwo
|
|
41
|
-
# size: 1Gi
|
|
42
|
-
|
|
43
|
-
# customize psql settings - be careful - should be tuned
|
|
34
|
+
# Parameters will be merged with defaults
|
|
44
35
|
postgresql:
|
|
36
|
+
shared_preload_libraries:
|
|
37
|
+
- pg_stat_statements
|
|
38
|
+
- pg_squeeze
|
|
45
39
|
parameters:
|
|
46
|
-
|
|
40
|
+
max_connections: "64" # def: 100
|
|
47
41
|
# max_worker_processes: "60"
|
|
48
42
|
# max_worker_processes: "8"
|
|
49
43
|
# max_parallel_workers: "8"
|
|
@@ -52,12 +46,32 @@ spec:
|
|
|
52
46
|
# maintenance_work_mem: 1GB
|
|
53
47
|
# work_mem: 20MB
|
|
54
48
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
# define main PVC storage class and size, plus WAL storage
|
|
50
|
+
storage:
|
|
51
|
+
storageClass: premium-rwo
|
|
52
|
+
size: 64Gi
|
|
53
|
+
walStorage:
|
|
54
|
+
storageClass: premium-rwo
|
|
55
|
+
size: 16Gi
|
|
56
|
+
|
|
57
|
+
resources:
|
|
58
|
+
# limit:
|
|
59
|
+
# cpu: 1000m
|
|
60
|
+
# memory: 8Gi
|
|
61
|
+
requests:
|
|
62
|
+
cpu: 500m
|
|
63
|
+
memory: 1Gi
|
|
64
|
+
|
|
65
|
+
# See Rolling Update section in docs https://cloudnative-pg.io/docs/1.27/rolling_update
|
|
66
|
+
primaryUpdateStrategy: unsupervised
|
|
67
|
+
primaryUpdateMethod: switchover
|
|
68
|
+
|
|
69
|
+
serviceAccountTemplate:
|
|
70
|
+
metadata:
|
|
71
|
+
annotations:
|
|
72
|
+
iam.gke.io/gcp-service-account: cnpg-operands-sa@${PROJECT_ID}.iam.gserviceaccount.com
|
|
58
73
|
|
|
59
74
|
backup:
|
|
60
|
-
retentionPolicy: 7d # don't think this does anything?
|
|
61
75
|
volumeSnapshot:
|
|
62
76
|
labels:
|
|
63
77
|
snapshotOf: cnpg-db-psql-stack
|
|
@@ -72,16 +86,7 @@ spec:
|
|
|
72
86
|
compression: gzip
|
|
73
87
|
maxParallel: 4
|
|
74
88
|
|
|
75
|
-
#
|
|
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
|
|
89
|
+
# affinity and toleration to control pod placement
|
|
85
90
|
affinity:
|
|
86
91
|
enablePodAntiAffinity: true
|
|
87
92
|
topologyKey: kubernetes.io/hostname # default value
|
|
@@ -8,7 +8,7 @@ spec:
|
|
|
8
8
|
logLevel: info # warning debug
|
|
9
9
|
|
|
10
10
|
monitoring:
|
|
11
|
-
enablePodMonitor:
|
|
11
|
+
enablePodMonitor: true # set true once monitoring is setup
|
|
12
12
|
|
|
13
13
|
description: "Leverege CNPG DB (recovered)"
|
|
14
14
|
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.2-cnpg-lvrg-rel.2
|
|
@@ -8,54 +8,36 @@ spec:
|
|
|
8
8
|
logLevel: info # warning debug
|
|
9
9
|
|
|
10
10
|
monitoring:
|
|
11
|
-
enablePodMonitor:
|
|
11
|
+
enablePodMonitor: true # set true once monitoring is setup
|
|
12
12
|
|
|
13
13
|
description: "Leverege Plain Timescale DB"
|
|
14
|
-
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.
|
|
14
|
+
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.6-cnpg-lvrg-final
|
|
15
15
|
bootstrap:
|
|
16
16
|
initdb:
|
|
17
|
-
# database: imagine # let it default to cnpg app db
|
|
18
17
|
postInitTemplateSQL:
|
|
18
|
+
# load necessary extensions for timescale
|
|
19
|
+
- CREATE EXTENSION pg_stat_statements;
|
|
20
|
+
- CREATE EXTENSION pg_squeeze;
|
|
19
21
|
- CREATE EXTENSION timescaledb;
|
|
20
22
|
- CREATE EXTENSION jsquery;
|
|
21
|
-
- CREATE EXTENSION pg_stat_statements;
|
|
22
|
-
- CREATE DATABASE imagine;
|
|
23
|
-
# - CREATE DATABASE app; # for the operator restores
|
|
24
|
-
# - CREATE ROLE app; # same
|
|
25
|
-
# owner: imagine
|
|
26
|
-
# secret:
|
|
27
|
-
# name: cnpg-db-tsdb-basic-imagine-pw # imagine db pw
|
|
28
23
|
|
|
24
|
+
# we only need the timescale database
|
|
25
|
+
- CREATE DATABASE timescale;
|
|
26
|
+
|
|
27
|
+
# TODO: move away from superuser access
|
|
29
28
|
enableSuperuserAccess: true
|
|
30
29
|
superuserSecret:
|
|
31
30
|
name: cnpg-db-tsdb-basic-postgres-pw # postgres db pw
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
enablePodAntiAffinity: true
|
|
35
|
-
topologyKey: kubernetes.io/hostname # default value
|
|
36
|
-
nodeAffinity:
|
|
37
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
38
|
-
nodeSelectorTerms:
|
|
39
|
-
- matchExpressions:
|
|
40
|
-
- key: target-env
|
|
41
|
-
operator: In
|
|
42
|
-
values:
|
|
43
|
-
- database
|
|
44
|
-
tolerations:
|
|
45
|
-
- key: "database"
|
|
46
|
-
operator: "Equal"
|
|
47
|
-
value: "true"
|
|
48
|
-
effect: "NoSchedule"
|
|
49
|
-
|
|
50
|
-
# Parameters and pg_hba configuration will be append
|
|
51
|
-
# to the default ones to make the cluster work
|
|
32
|
+
# Parameters will be merged with defaults
|
|
52
33
|
postgresql:
|
|
53
34
|
shared_preload_libraries:
|
|
35
|
+
- pg_stat_statements
|
|
36
|
+
- pg_squeeze
|
|
54
37
|
- timescaledb
|
|
55
38
|
- jsquery
|
|
56
|
-
- pg_stat_statements
|
|
57
39
|
parameters:
|
|
58
|
-
|
|
40
|
+
max_connections: "64" # def: 100
|
|
59
41
|
# max_worker_processes: "60"
|
|
60
42
|
# max_worker_processes: "8"
|
|
61
43
|
# max_parallel_workers: "8"
|
|
@@ -63,27 +45,31 @@ spec:
|
|
|
63
45
|
# effective_cache_size: 6GB
|
|
64
46
|
# maintenance_work_mem: 1GB
|
|
65
47
|
# work_mem: 20MB
|
|
66
|
-
pg_hba:
|
|
67
|
-
# To access through TCP/IP you will need to get username
|
|
68
|
-
# and password from the secret cluster-example-custom-app
|
|
69
|
-
- host all all all md5
|
|
70
48
|
|
|
71
|
-
#
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
49
|
+
# define main PVC storage class and size, plus WAL storage
|
|
50
|
+
storage:
|
|
51
|
+
storageClass: premium-rwo
|
|
52
|
+
size: 64Gi
|
|
53
|
+
walStorage:
|
|
54
|
+
storageClass: premium-rwo
|
|
55
|
+
size: 16Gi
|
|
56
|
+
|
|
57
|
+
resources:
|
|
58
|
+
# limit:
|
|
59
|
+
# cpu: 1000m
|
|
60
|
+
# memory: 8Gi
|
|
61
|
+
requests:
|
|
62
|
+
cpu: 500m
|
|
63
|
+
memory: 1Gi
|
|
64
|
+
|
|
65
|
+
# See Rolling Update section in docs https://cloudnative-pg.io/docs/1.27/rolling_update
|
|
76
66
|
primaryUpdateStrategy: unsupervised
|
|
77
67
|
primaryUpdateMethod: switchover
|
|
78
68
|
|
|
79
69
|
serviceAccountTemplate:
|
|
80
70
|
metadata:
|
|
81
71
|
annotations:
|
|
82
|
-
iam.gke.io/gcp-service-account: cnpg-operands-sa
|
|
83
|
-
|
|
84
|
-
storage:
|
|
85
|
-
storageClass: premium-rwo
|
|
86
|
-
size: 76Gi
|
|
72
|
+
iam.gke.io/gcp-service-account: cnpg-operands-sa@${PROJECT_ID}.iam.gserviceaccount.com
|
|
87
73
|
|
|
88
74
|
backup:
|
|
89
75
|
volumeSnapshot:
|
|
@@ -91,7 +77,7 @@ spec:
|
|
|
91
77
|
snapshotOf: cnpg-db-tsdb-basic
|
|
92
78
|
className: cnpg-snapshotclass
|
|
93
79
|
barmanObjectStore:
|
|
94
|
-
destinationPath: gs
|
|
80
|
+
destinationPath: gs://${PROJECT_ID}-barman
|
|
95
81
|
googleCredentials:
|
|
96
82
|
gkeEnvironment: true
|
|
97
83
|
tags:
|
|
@@ -99,6 +85,24 @@ spec:
|
|
|
99
85
|
wal:
|
|
100
86
|
compression: gzip
|
|
101
87
|
maxParallel: 4
|
|
88
|
+
|
|
89
|
+
# affinitiy and toleration to control pod placement
|
|
90
|
+
affinity:
|
|
91
|
+
enablePodAntiAffinity: true
|
|
92
|
+
topologyKey: kubernetes.io/hostname # default value
|
|
93
|
+
nodeAffinity:
|
|
94
|
+
requiredDuringSchedulingIgnoredDuringExecution:
|
|
95
|
+
nodeSelectorTerms:
|
|
96
|
+
- matchExpressions:
|
|
97
|
+
- key: target-env
|
|
98
|
+
operator: In
|
|
99
|
+
values:
|
|
100
|
+
- database
|
|
101
|
+
tolerations:
|
|
102
|
+
- key: "database"
|
|
103
|
+
operator: "Equal"
|
|
104
|
+
value: "true"
|
|
105
|
+
effect: "NoSchedule"
|
|
102
106
|
---
|
|
103
107
|
apiVersion: postgresql.cnpg.io/v1
|
|
104
108
|
kind: ScheduledBackup
|
|
@@ -8,77 +8,67 @@ spec:
|
|
|
8
8
|
logLevel: info # warning debug
|
|
9
9
|
|
|
10
10
|
monitoring:
|
|
11
|
-
enablePodMonitor:
|
|
11
|
+
enablePodMonitor: true # set true once monitoring is setup
|
|
12
12
|
|
|
13
13
|
description: "Leverege Dense Timescale DB"
|
|
14
|
-
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.
|
|
14
|
+
imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:17.6-cnpg-lvrg-final
|
|
15
15
|
bootstrap:
|
|
16
16
|
initdb:
|
|
17
17
|
postInitTemplateSQL:
|
|
18
|
+
- CREATE EXTENSION pg_stat_statements;
|
|
19
|
+
- CREATE EXTENSION pg_squeeze;
|
|
18
20
|
- CREATE EXTENSION timescaledb;
|
|
19
21
|
- CREATE EXTENSION jsquery;
|
|
20
|
-
- CREATE EXTENSION pg_stat_statements;
|
|
21
|
-
- CREATE DATABASE imagine; # leverege tsdb db
|
|
22
|
-
# secret:
|
|
23
|
-
# name: cnpg-db-tsdb-dense-imagine-pw # imagine db pw
|
|
24
22
|
|
|
23
|
+
# we only need the timescale database
|
|
24
|
+
- CREATE DATABASE timescale;
|
|
25
|
+
|
|
26
|
+
# TODO: move away from superuser access
|
|
25
27
|
enableSuperuserAccess: true
|
|
26
28
|
superuserSecret:
|
|
27
29
|
name: cnpg-db-tsdb-dense-postgres-pw # postgres db pw
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
enablePodAntiAffinity: true
|
|
31
|
-
topologyKey: kubernetes.io/hostname # default value
|
|
32
|
-
nodeAffinity:
|
|
33
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
34
|
-
nodeSelectorTerms:
|
|
35
|
-
- matchExpressions:
|
|
36
|
-
- key: target-env
|
|
37
|
-
operator: In
|
|
38
|
-
values:
|
|
39
|
-
- database
|
|
40
|
-
tolerations:
|
|
41
|
-
- key: "database"
|
|
42
|
-
operator: "Equal"
|
|
43
|
-
value: "true"
|
|
44
|
-
effect: "NoSchedule"
|
|
45
|
-
|
|
46
|
-
# Parameters and pg_hba configuration will be append
|
|
47
|
-
# to the default ones to make the cluster work
|
|
31
|
+
# Parameters will be merged with defaults
|
|
48
32
|
postgresql:
|
|
49
33
|
shared_preload_libraries:
|
|
34
|
+
- pg_stat_statements
|
|
35
|
+
- pg_squeeze
|
|
50
36
|
- timescaledb
|
|
51
37
|
- jsquery
|
|
52
|
-
- pg_stat_statements
|
|
53
38
|
parameters:
|
|
39
|
+
max_connections: "64" # def: 100
|
|
54
40
|
# max_worker_processes: "60"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
pg_hba:
|
|
62
|
-
# To access through TCP/IP you will need to get username
|
|
63
|
-
# and password from the secret cluster-example-custom-app
|
|
64
|
-
- host all all all md5
|
|
41
|
+
# max_worker_processes: "8"
|
|
42
|
+
# max_parallel_workers: "8"
|
|
43
|
+
# shared_buffers: 2GB
|
|
44
|
+
# effective_cache_size: 6GB
|
|
45
|
+
# maintenance_work_mem: 1GB
|
|
46
|
+
# work_mem: 20MB
|
|
65
47
|
|
|
66
|
-
#
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
48
|
+
# define main PVC storage class and size, plus WAL storage
|
|
49
|
+
storage:
|
|
50
|
+
storageClass: premium-rwo
|
|
51
|
+
size: 96Gi
|
|
52
|
+
walStorage:
|
|
53
|
+
storageClass: premium-rwo
|
|
54
|
+
size: 16Gi
|
|
55
|
+
|
|
56
|
+
resources:
|
|
57
|
+
# limit:
|
|
58
|
+
# cpu: 1000m
|
|
59
|
+
# memory: 8Gi
|
|
60
|
+
requests:
|
|
61
|
+
cpu: 500m
|
|
62
|
+
memory: 1Gi
|
|
63
|
+
|
|
64
|
+
# See Rolling Update section in docs https://cloudnative-pg.io/docs/1.27/rolling_update
|
|
71
65
|
primaryUpdateStrategy: unsupervised
|
|
72
66
|
primaryUpdateMethod: switchover
|
|
73
67
|
|
|
74
68
|
serviceAccountTemplate:
|
|
75
69
|
metadata:
|
|
76
70
|
annotations:
|
|
77
|
-
iam.gke.io/gcp-service-account: cnpg-operands-sa
|
|
78
|
-
|
|
79
|
-
storage:
|
|
80
|
-
storageClass: premium-rwo
|
|
81
|
-
size: 77Gi
|
|
71
|
+
iam.gke.io/gcp-service-account: cnpg-operands-sa@${PROJECT_ID}.iam.gserviceaccount.com
|
|
82
72
|
|
|
83
73
|
backup:
|
|
84
74
|
volumeSnapshot:
|
|
@@ -86,7 +76,7 @@ spec:
|
|
|
86
76
|
snapshotOf: cnpg-db-tsdb-dense
|
|
87
77
|
className: cnpg-snapshotclass
|
|
88
78
|
barmanObjectStore:
|
|
89
|
-
destinationPath: gs
|
|
79
|
+
destinationPath: gs://${PROJECT_ID}-barman
|
|
90
80
|
googleCredentials:
|
|
91
81
|
gkeEnvironment: true
|
|
92
82
|
tags:
|
|
@@ -94,6 +84,24 @@ spec:
|
|
|
94
84
|
wal:
|
|
95
85
|
compression: gzip
|
|
96
86
|
maxParallel: 4
|
|
87
|
+
|
|
88
|
+
# affinity and tolerations to control pod placement
|
|
89
|
+
affinity:
|
|
90
|
+
enablePodAntiAffinity: true
|
|
91
|
+
topologyKey: kubernetes.io/hostname # default value
|
|
92
|
+
nodeAffinity:
|
|
93
|
+
requiredDuringSchedulingIgnoredDuringExecution:
|
|
94
|
+
nodeSelectorTerms:
|
|
95
|
+
- matchExpressions:
|
|
96
|
+
- key: target-env
|
|
97
|
+
operator: In
|
|
98
|
+
values:
|
|
99
|
+
- database
|
|
100
|
+
tolerations:
|
|
101
|
+
- key: "database"
|
|
102
|
+
operator: "Equal"
|
|
103
|
+
value: "true"
|
|
104
|
+
effect: "NoSchedule"
|
|
97
105
|
---
|
|
98
106
|
apiVersion: postgresql.cnpg.io/v1
|
|
99
107
|
kind: ScheduledBackup
|
|
@@ -207,3 +207,11 @@ CNPG_CLEANUP_CRONJOB_APPLY
|
|
|
207
207
|
# Run it!
|
|
208
208
|
installCnpgOperatorEnvironment
|
|
209
209
|
installCnpgCleanupCronjob
|
|
210
|
+
|
|
211
|
+
# --- cert-manager (cluster-wide dependency for barman plugin) ---
|
|
212
|
+
CM_VER="1.14.5"
|
|
213
|
+
kubectl apply -f "https://github.com/cert-manager/cert-manager/releases/download/v${CM_VER}/cert-manager.yaml"
|
|
214
|
+
|
|
215
|
+
kubectl rollout status deployment -n cert-manager cert-manager
|
|
216
|
+
kubectl rollout status deployment -n cert-manager cert-manager-webhook
|
|
217
|
+
kubectl rollout status deployment -n cert-manager cert-manager-cainjector
|