@leverege/build-tools 2.42.3 → 2.43.1
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 +2 -1
- package/src/chart-to-registry.mjs +69 -0
- package/src/helm-charts/elasticsearch8/helmup.plugin +18 -1
- package/src/helmup.sh +4 -2
- package/src/helm-charts/elasticsearch/.nohelm +0 -0
- package/src/helm-charts/elasticsearch/elasticsearch-local.yaml +0 -38
- package/src/helm-charts/elasticsearch/helmup.plugin +0 -16
- package/src/helm-charts/elasticsearch-cluster/.nohelm +0 -0
- package/src/helm-charts/elasticsearch-cluster/elasticsearch-client.yaml +0 -51
- package/src/helm-charts/elasticsearch-cluster/elasticsearch-data.yaml +0 -51
- package/src/helm-charts/elasticsearch-cluster/elasticsearch-master.yaml +0 -51
- package/src/helm-charts/elasticsearch-cluster/helmup.plugin +0 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.43.1",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
16
|
"build-tools": "src/build-tools.mjs",
|
|
17
|
+
"chart-to-registry": "src/chart-to-registry.mjs",
|
|
17
18
|
"circleate": "src/circleate.sh",
|
|
18
19
|
"decrypt-secrets": "src/decrypt-secrets.sh",
|
|
19
20
|
"dirty-git": "src/dirty-git.sh",
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* chart-to-registry will...
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import chalk from 'chalk'
|
|
7
|
+
import commandLineArgs from 'command-line-args'
|
|
8
|
+
import commandLineUsage from 'command-line-usage'
|
|
9
|
+
import ms from 'ms'
|
|
10
|
+
import { lt as semverLt } from 'semver'
|
|
11
|
+
|
|
12
|
+
import { debug, log, shellCmd } from './Utils.mjs'
|
|
13
|
+
|
|
14
|
+
const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
|
|
15
|
+
/* eslint-disable max-len */
|
|
16
|
+
{
|
|
17
|
+
name : 'project',
|
|
18
|
+
type : String,
|
|
19
|
+
default : false,
|
|
20
|
+
description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name : 'help',
|
|
24
|
+
type : Boolean,
|
|
25
|
+
default : false,
|
|
26
|
+
description : '{green display this help screen}',
|
|
27
|
+
},
|
|
28
|
+
/* eslint-enable max-len */
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const sections = [
|
|
32
|
+
{
|
|
33
|
+
header : 'Leverege Helm Chart to Artifact Registry',
|
|
34
|
+
content : `{green This tool helps ...
|
|
35
|
+
... multi-line helm.}`
|
|
36
|
+
},
|
|
37
|
+
{ header : 'Options',
|
|
38
|
+
optionList : commandLineOptions,
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
const args = commandLineArgs( commandLineOptions, { camelCase : true, partial : true } )
|
|
43
|
+
const usage = commandLineUsage( sections )
|
|
44
|
+
|
|
45
|
+
if ( args.help ) {
|
|
46
|
+
log( usage )
|
|
47
|
+
process.exit( 0 )
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* eslint-disable no-underscore-dangle */
|
|
51
|
+
if ( args._unknown ) {
|
|
52
|
+
log( usage )
|
|
53
|
+
log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
|
|
54
|
+
process.exit( 1 )
|
|
55
|
+
}
|
|
56
|
+
/* eslint-enable no-underscore-dangle */
|
|
57
|
+
|
|
58
|
+
const gcpProject = args.project ? args.project : process.env.HELM_CHART_REGISTRY || 'leverege-registry'
|
|
59
|
+
|
|
60
|
+
if ( semverLt( process.version, '18.0.0' ) ) {
|
|
61
|
+
log( chalk.red( '\n\n***ERROR: must be running at least node 18\n' ) )
|
|
62
|
+
process.exit( 1 )
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const getGcpSecretCommand = ( secretName ) => {
|
|
66
|
+
return `gcloud secrets versions access latest --project=${gcpProject} --secret=${secretName}`
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
log( chalk.yellow( '\n\n***WARNING: Under Construction' ) )
|
|
@@ -9,7 +9,24 @@ LOCAL_ES_VALUES="elasticsearch8/elasticsearch-local-dev.yaml"
|
|
|
9
9
|
addBitnamiRepo latest
|
|
10
10
|
helm upgrade --install elasticsearch8 bitnami/elasticsearch \
|
|
11
11
|
--namespace elastic --create-namespace \
|
|
12
|
-
--version 19
|
|
12
|
+
--version 19 \
|
|
13
13
|
--values $LOCAL_ES_VALUES $HELM_WHAT
|
|
14
14
|
|
|
15
15
|
removeHelmRepo bitnami
|
|
16
|
+
|
|
17
|
+
## Installing ES8 exporter
|
|
18
|
+
addHelmRepo prometheus-community https://prometheus-community.github.io/helm-charts
|
|
19
|
+
helm upgrade --install elasticsearch8-exporter prometheus-community/prometheus-elasticsearch-exporter \
|
|
20
|
+
--namespace monitoring \
|
|
21
|
+
--version 5 \
|
|
22
|
+
-f - <<ELASTIC8_EXPORTER_CHART_MOD
|
|
23
|
+
fullnameOverride: elasticsearch8-exporter
|
|
24
|
+
|
|
25
|
+
service:
|
|
26
|
+
annotations:
|
|
27
|
+
prometheus.io/port: "9108"
|
|
28
|
+
prometheus.io/scrape: "true"
|
|
29
|
+
es:
|
|
30
|
+
uri: http://elasticsearch8.elastic.svc.cluster.local:9200
|
|
31
|
+
ELASTIC8_EXPORTER_CHART_MOD
|
|
32
|
+
removeHelmRepo prometheus-community
|
package/src/helmup.sh
CHANGED
|
@@ -51,7 +51,7 @@ SYSTEM=(
|
|
|
51
51
|
|
|
52
52
|
function isLeveregeService() {
|
|
53
53
|
local answer=0
|
|
54
|
-
[[ ${PLATFORM[@]} =~ $1 || ${AUXILIARY[@]} =~ $1 ]] && answer=1
|
|
54
|
+
[[ ${PLATFORM[@]} =~ $1 || ${AUXILIARY[@]} =~ $1 || ${SYSTEM[@]} =~ $1 ]] && answer=1
|
|
55
55
|
echo $answer
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -271,6 +271,8 @@ function installMonitoringEnvironment() {
|
|
|
271
271
|
--namespace monitoring \
|
|
272
272
|
--version 5 \
|
|
273
273
|
-f - <<ELASTIC_EXPORTER_CHART_MOD
|
|
274
|
+
fullnameOverride: elasticsearch8-exporter
|
|
275
|
+
|
|
274
276
|
service:
|
|
275
277
|
annotations:
|
|
276
278
|
prometheus.io/port: "9108"
|
|
@@ -634,7 +636,7 @@ function doInstall() {
|
|
|
634
636
|
[ "$INVOKED_AS" == "helmwhat" ] && HELM_WHAT="--dry-run --debug"
|
|
635
637
|
|
|
636
638
|
# helminit is used to redeploy an existing service
|
|
637
|
-
if [ "$INVOKED_AS" == "helminit" ] && [
|
|
639
|
+
if [ "$INVOKED_AS" == "helminit" ] && [[ $(isLeveregeService $SERVICE) -eq 1 ]];
|
|
638
640
|
then
|
|
639
641
|
yesToContinue "if are you `color y certain` you want to run `color y helminit`"
|
|
640
642
|
local BACKUP_DIR="$SERVICE-bak"
|
|
File without changes
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Foundation Chart: https://artifacthub.io/packages/helm/elastic/elasticsearch
|
|
2
|
-
#
|
|
3
|
-
# esJavaOpts: "" # example: "-Xmx1g -Xms1g"
|
|
4
|
-
#
|
|
5
|
-
# resources:
|
|
6
|
-
# requests:
|
|
7
|
-
# cpu: "1000m"
|
|
8
|
-
# memory: "2Gi"
|
|
9
|
-
# limits:
|
|
10
|
-
# cpu: "1000m"
|
|
11
|
-
# memory: "2Gi"
|
|
12
|
-
|
|
13
|
-
tolerations:
|
|
14
|
-
- key: "database"
|
|
15
|
-
operator: "Equal"
|
|
16
|
-
value: "true"
|
|
17
|
-
effect: "NoSchedule"
|
|
18
|
-
|
|
19
|
-
nodeAffinity:
|
|
20
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
21
|
-
nodeSelectorTerms:
|
|
22
|
-
- matchExpressions:
|
|
23
|
-
- key: target-env
|
|
24
|
-
operator: In
|
|
25
|
-
values:
|
|
26
|
-
- database
|
|
27
|
-
|
|
28
|
-
# RecovR Prd Settings - very beefy on an n2-standard-8
|
|
29
|
-
#
|
|
30
|
-
# esJavaOpts: "-Xmx8g -Xms8g"
|
|
31
|
-
#
|
|
32
|
-
# resources:
|
|
33
|
-
# requests:
|
|
34
|
-
# cpu: "6250m"
|
|
35
|
-
# memory: "16Gi"
|
|
36
|
-
# limits:
|
|
37
|
-
# cpu: "6750m"
|
|
38
|
-
# memory: "20Gi"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
# Do not move to 7.17+ until the memory explosion problem is resolved
|
|
4
|
-
#
|
|
5
|
-
showInstalling "Elastic Search"
|
|
6
|
-
|
|
7
|
-
LOCAL_ES_VALUES="elasticsearch/elasticsearch-local.yaml"
|
|
8
|
-
[ ! -f "$LOCAL_ES_VALUES" ] && exitOnError 1 "Missing the local ES config file => `color y $LOCAL_ES_VALUES`"
|
|
9
|
-
|
|
10
|
-
addHelmRepo elastic https://helm.elastic.co
|
|
11
|
-
helm upgrade --install elasticsearch leverege/elasticsearch \
|
|
12
|
-
--version 7.16 \
|
|
13
|
-
--values $LOCAL_ES_VALUES \
|
|
14
|
-
--set volumeClaimTemplate.storageClassName="ssd" $HELM_WHAT
|
|
15
|
-
|
|
16
|
-
removeHelmRepo elastic
|
|
File without changes
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# client / coordinating nodes - smart load balancers
|
|
2
|
-
nodeGroup: "client"
|
|
3
|
-
clusterName: "elasticsearch"
|
|
4
|
-
|
|
5
|
-
#esJavaOpts: "-Xmx1g -Xms1g"
|
|
6
|
-
#
|
|
7
|
-
resources:
|
|
8
|
-
limits: #
|
|
9
|
-
cpu: # 1000m default
|
|
10
|
-
memory: "2Gi" # 2Gi
|
|
11
|
-
requests: # values.yaml defaults
|
|
12
|
-
cpu: "200m" # 1000m
|
|
13
|
-
memory: "1500Mi" # 2Gi
|
|
14
|
-
|
|
15
|
-
volumeClaimTemplate:
|
|
16
|
-
storageClassName: "ssd"
|
|
17
|
-
resources:
|
|
18
|
-
requests:
|
|
19
|
-
storage: "1Gi"
|
|
20
|
-
|
|
21
|
-
roles: # client / coordinator
|
|
22
|
-
master: "false"
|
|
23
|
-
ingest: "false"
|
|
24
|
-
data: "false"
|
|
25
|
-
remote_cluster_client: "false"
|
|
26
|
-
ml: "false"
|
|
27
|
-
|
|
28
|
-
replicas: 3
|
|
29
|
-
antiAffinity: "hard" # hard is default
|
|
30
|
-
|
|
31
|
-
esConfig:
|
|
32
|
-
elasticsearch.yml: |
|
|
33
|
-
xpack.security.enabled: false
|
|
34
|
-
|
|
35
|
-
persistence:
|
|
36
|
-
enabled: false
|
|
37
|
-
|
|
38
|
-
tolerations:
|
|
39
|
-
- key: "elastic"
|
|
40
|
-
operator: "Equal"
|
|
41
|
-
value: "true"
|
|
42
|
-
effect: "NoSchedule"
|
|
43
|
-
|
|
44
|
-
nodeAffinity:
|
|
45
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
46
|
-
nodeSelectorTerms:
|
|
47
|
-
- matchExpressions:
|
|
48
|
-
- key: target-env
|
|
49
|
-
operator: In
|
|
50
|
-
values:
|
|
51
|
-
- elastic
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
nodeGroup: "data"
|
|
3
|
-
clusterName: "elasticsearch"
|
|
4
|
-
|
|
5
|
-
esJavaOpts: "-Xmx4g -Xms4g"
|
|
6
|
-
|
|
7
|
-
resources:
|
|
8
|
-
limits: #
|
|
9
|
-
cpu: # 1000m default
|
|
10
|
-
memory: "8Gi" # 2Gi
|
|
11
|
-
requests: # values.yaml defaults
|
|
12
|
-
cpu: "1000m" # 1000m
|
|
13
|
-
memory: "4Gi" # 2Gi
|
|
14
|
-
|
|
15
|
-
volumeClaimTemplate:
|
|
16
|
-
storageClassName: "ssd"
|
|
17
|
-
resources:
|
|
18
|
-
requests:
|
|
19
|
-
storage: "64Gi"
|
|
20
|
-
|
|
21
|
-
roles: # data
|
|
22
|
-
master: "false"
|
|
23
|
-
ingest: "true"
|
|
24
|
-
data: "true"
|
|
25
|
-
remote_cluster_client: "false"
|
|
26
|
-
ml: "false"
|
|
27
|
-
|
|
28
|
-
replicas: 3
|
|
29
|
-
antiAffinity: "soft" # hard is default
|
|
30
|
-
|
|
31
|
-
esConfig:
|
|
32
|
-
elasticsearch.yml: |
|
|
33
|
-
xpack.security.enabled: false
|
|
34
|
-
|
|
35
|
-
persistence:
|
|
36
|
-
enabled: true
|
|
37
|
-
|
|
38
|
-
tolerations:
|
|
39
|
-
- key: "elastic"
|
|
40
|
-
operator: "Equal"
|
|
41
|
-
value: "true"
|
|
42
|
-
effect: "NoSchedule"
|
|
43
|
-
|
|
44
|
-
nodeAffinity:
|
|
45
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
46
|
-
nodeSelectorTerms:
|
|
47
|
-
- matchExpressions:
|
|
48
|
-
- key: target-env
|
|
49
|
-
operator: In
|
|
50
|
-
values:
|
|
51
|
-
- elastic
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# master - manages indexes, tracks nodes and shards
|
|
2
|
-
nodeGroup: "master"
|
|
3
|
-
clusterName: "elasticsearch"
|
|
4
|
-
|
|
5
|
-
#esJavaOpts: "-Xmx1g -Xms1g"
|
|
6
|
-
#
|
|
7
|
-
resources:
|
|
8
|
-
limits: #
|
|
9
|
-
cpu: # 1000m default
|
|
10
|
-
memory: "2Gi" # 2Gi
|
|
11
|
-
requests: # values.yaml defaults
|
|
12
|
-
cpu: "100m" # 1000m
|
|
13
|
-
memory: "1500Mi" # 2Gi
|
|
14
|
-
|
|
15
|
-
volumeClaimTemplate:
|
|
16
|
-
storageClassName: "ssd"
|
|
17
|
-
resources:
|
|
18
|
-
requests:
|
|
19
|
-
storage: "4Gi"
|
|
20
|
-
|
|
21
|
-
roles: # master
|
|
22
|
-
master: "true"
|
|
23
|
-
ingest: "false"
|
|
24
|
-
data: "false"
|
|
25
|
-
remote_cluster_client: "false"
|
|
26
|
-
ml: "false"
|
|
27
|
-
|
|
28
|
-
replicas: 3
|
|
29
|
-
antiAffinity: "hard" # hard is default
|
|
30
|
-
|
|
31
|
-
esConfig:
|
|
32
|
-
elasticsearch.yml: |
|
|
33
|
-
xpack.security.enabled: false
|
|
34
|
-
|
|
35
|
-
persistence:
|
|
36
|
-
enabled: true
|
|
37
|
-
|
|
38
|
-
tolerations:
|
|
39
|
-
- key: "elastic"
|
|
40
|
-
operator: "Equal"
|
|
41
|
-
value: "true"
|
|
42
|
-
effect: "NoSchedule"
|
|
43
|
-
|
|
44
|
-
nodeAffinity:
|
|
45
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
46
|
-
nodeSelectorTerms:
|
|
47
|
-
- matchExpressions:
|
|
48
|
-
- key: target-env
|
|
49
|
-
operator: In
|
|
50
|
-
values:
|
|
51
|
-
- elastic
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
# Do not move to 7.17+ until the memory explosion problem is resolved
|
|
4
|
-
#
|
|
5
|
-
ES_VERSION="7.16"
|
|
6
|
-
|
|
7
|
-
showInstalling "Elastic Search Cluster v${ES_VERSION}"
|
|
8
|
-
|
|
9
|
-
addHelmRepo elastic https://helm.elastic.co
|
|
10
|
-
|
|
11
|
-
deployES() {
|
|
12
|
-
ES_TYPE="elasticsearch-${1}"
|
|
13
|
-
printf "\n Deploying ES cluster component: `color y "$ES_TYPE"`\n"
|
|
14
|
-
helm upgrade --install $ES_TYPE elastic/elasticsearch \
|
|
15
|
-
--version $ES_VERSION \
|
|
16
|
-
--values elasticsearch-cluster/$ES_TYPE.yaml $HELM_WHAT
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
deployES "master"
|
|
20
|
-
deployES "client"
|
|
21
|
-
deployES "data"
|
|
22
|
-
|
|
23
|
-
removeHelmRepo elastic
|