@leverege/build-tools 2.55.4-pedro.1 → 2.56.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 +1 -1
- package/registry-compass.yaml +20 -0
- package/src/Utils.mjs +8 -0
- package/src/chart-compass.mjs +96 -0
- package/src/helm-charts/elasticsearch8/helmup.plugin +1 -4
- package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +18 -1
- package/src/helm-charts/traefik/traefik-local.yaml +7 -0
- package/src/helmup.sh +1 -1
- package/src/overwhelm.mjs +22 -2
package/package.json
CHANGED
|
@@ -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
|
package/src/Utils.mjs
CHANGED
|
@@ -35,6 +35,14 @@ export const errorExit = ( error, opts = { errorCode : 1 } ) => {
|
|
|
35
35
|
}
|
|
36
36
|
/* eslint-enable no-console */
|
|
37
37
|
|
|
38
|
+
export const isHex = ( hex ) => {
|
|
39
|
+
return hex instanceof Buffer || /^[0-9a-f]+$/i.test( hex )
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const isString = ( s ) => {
|
|
43
|
+
return typeof s === 'string' || s instanceof String
|
|
44
|
+
}
|
|
45
|
+
|
|
38
46
|
/**
|
|
39
47
|
* General "yes" to proceed function.
|
|
40
48
|
*/
|
|
@@ -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' )
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
#
|
|
3
3
|
showInstalling "Elastic Search 8"
|
|
4
4
|
|
|
5
|
-
[ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.3.
|
|
5
|
+
[ -z "$ELASTIC_CHART_VERSION" ] && ELASTIC_CHART_VERSION="21.3.22"
|
|
6
6
|
|
|
7
7
|
OCI_CHART="oci://registry-1.docker.io/bitnamicharts/elasticsearch"
|
|
8
8
|
|
|
@@ -14,6 +14,3 @@ helm upgrade --install elasticsearch8 $OCI_CHART \
|
|
|
14
14
|
--namespace elastic --create-namespace \
|
|
15
15
|
--values $LOCAL_ES_VALUES \
|
|
16
16
|
--version $ELASTIC_CHART_VERSION $HELM_WHAT
|
|
17
|
-
|
|
18
|
-
## Installing ES8 exporter into monitoring namespace
|
|
19
|
-
installElasticsearchExporter
|
|
@@ -68,7 +68,7 @@ grafana:
|
|
|
68
68
|
entryPoints:
|
|
69
69
|
- websecure
|
|
70
70
|
routes:
|
|
71
|
-
- match: Host(`OVH:<PROJECT_NAME>-
|
|
71
|
+
- match: Host(`OVH:<PROJECT_NAME>-promop.OVH:<HOST>.com`)
|
|
72
72
|
kind: Rule
|
|
73
73
|
services:
|
|
74
74
|
- name: prometheus-stack-grafana
|
|
@@ -111,6 +111,20 @@ alertmanager:
|
|
|
111
111
|
*Description:* {{ .Annotations.description }}
|
|
112
112
|
*Dashboard:* {{ .Annotations.dashboard }}
|
|
113
113
|
{{ end }}
|
|
114
|
+
- name: slack-watchdog
|
|
115
|
+
slack_configs:
|
|
116
|
+
- channel: "#dead-mans-snitch_notifications"
|
|
117
|
+
api_url: "OVH:<SLACK_HOOK_URL>"
|
|
118
|
+
username: "OVH:<PROJECT_NAME>"
|
|
119
|
+
fallback: "OVH:<PROJECT_NAME> - {{ .CommonAnnotations.summary }}"
|
|
120
|
+
title: "Watchdog Alert - Dead Man's Snitch"
|
|
121
|
+
# text: "This is a periodic test alert to confirm the alert pipeline is functional."
|
|
122
|
+
text: |-
|
|
123
|
+
{{ range .Alerts }}
|
|
124
|
+
*Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
|
|
125
|
+
*Description:* {{ .Annotations.description }}
|
|
126
|
+
*Dashboard:* {{ .Annotations.dashboard }}
|
|
127
|
+
{{ end }}
|
|
114
128
|
- name: opsgenie
|
|
115
129
|
opsgenie_configs:
|
|
116
130
|
- api_key: "OVH:<OPSGENIE_APIKEY>"
|
|
@@ -131,6 +145,9 @@ alertmanager:
|
|
|
131
145
|
- cluster
|
|
132
146
|
receiver: slack
|
|
133
147
|
routes:
|
|
148
|
+
- match:
|
|
149
|
+
alertname: "Watchdog"
|
|
150
|
+
receiver: slack-watchdog
|
|
134
151
|
- match:
|
|
135
152
|
severity: page
|
|
136
153
|
receiver: opsgenie
|
|
@@ -24,6 +24,13 @@ resources:
|
|
|
24
24
|
cpu: "100m"
|
|
25
25
|
memory: "50Mi"
|
|
26
26
|
|
|
27
|
+
metrics:
|
|
28
|
+
prometheus:
|
|
29
|
+
serviceMonitor:
|
|
30
|
+
enabled: false
|
|
31
|
+
interval: 30s
|
|
32
|
+
namespace: prometheus
|
|
33
|
+
|
|
27
34
|
# Custom entry points may be added here - the first two are port definitions
|
|
28
35
|
# for both unsecured and secured MQTT ports used by connect. Note that the
|
|
29
36
|
# mqtts port has TLS termination performed by traefik and both ports are then
|
package/src/helmup.sh
CHANGED
|
@@ -238,7 +238,7 @@ MISSING_HELMUP_PLUGIN
|
|
|
238
238
|
|
|
239
239
|
cp -a $SERVICE_CHART .
|
|
240
240
|
# because npm tends to not allow .gitinore files the easy way...
|
|
241
|
-
|
|
241
|
+
find $SERVICE -type f -name "gitignore" -execdir mv {} .gitignore \;
|
|
242
242
|
git add $SERVICE
|
|
243
243
|
overwhelm --genvals
|
|
244
244
|
ifPluggedIn $SERVICE
|
package/src/overwhelm.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import parse from 'parse-gitignore'
|
|
|
15
15
|
import ask from 'readline-sync'
|
|
16
16
|
import YAML from 'js-yaml'
|
|
17
17
|
|
|
18
|
-
import { debug, disableDebug, err, log, shellCmd } from './Utils.mjs'
|
|
18
|
+
import { debug, disableDebug, err, errorExit, isString, log, shellCmd } from './Utils.mjs'
|
|
19
19
|
|
|
20
20
|
const optionsDefinitions = [
|
|
21
21
|
/* eslint-disable no-multi-spaces */
|
|
@@ -264,6 +264,26 @@ const opt = {
|
|
|
264
264
|
|
|
265
265
|
const ahoy = glob.sync( '*/', opt )
|
|
266
266
|
|
|
267
|
+
// Verifies that all values in a config block are quoted
|
|
268
|
+
const validValuesLocalConfig = ( vlf ) => {
|
|
269
|
+
if ( ! fs.existsSync( vlf ) ) { return undefined }
|
|
270
|
+
|
|
271
|
+
const valuesLocal = YAML.load( fs.readFileSync( vlf, { encoding : 'utf-8' } ) )
|
|
272
|
+
const configBlock = valuesLocal.config
|
|
273
|
+
|
|
274
|
+
// only care about validating config at this time
|
|
275
|
+
if ( configBlock ) {
|
|
276
|
+
for ( const [ key, value ] of Object.entries( configBlock ) ) {
|
|
277
|
+
if( ! isString( value ) ) {
|
|
278
|
+
err( { configBlock }, '***Bad config block' )
|
|
279
|
+
errorExit( `Is ${key} missing quotes around ${value} in ${vlf}?` )
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return true // TODO: return the already read valuesLocal info?
|
|
285
|
+
}
|
|
286
|
+
|
|
267
287
|
// .nohelm = skips generation of values.yaml but allows helmup to run
|
|
268
288
|
ahoy.forEach( ( dir ) => {
|
|
269
289
|
if ( !fs.existsSync( `${dir}/.nohelm` ) ) {
|
|
@@ -274,7 +294,7 @@ ahoy.forEach( ( dir ) => {
|
|
|
274
294
|
// Add support for localized values for things like keel (or whatever)
|
|
275
295
|
const valuesLocal = `${dir}/values-local.yaml`
|
|
276
296
|
|
|
277
|
-
if (
|
|
297
|
+
if ( validValuesLocalConfig( valuesLocal ) ) {
|
|
278
298
|
debug( { valuesLocal }, 'rendering values.yaml' )
|
|
279
299
|
valuesOut += '\n# OVERWHELM => values-local.yaml\n\n'
|
|
280
300
|
valuesOut += fs.readFileSync( valuesLocal, { encoding : 'utf-8' } )
|