@leverege/build-tools 2.88.2 → 2.89.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 +5 -5
- package/src/build-cnpg-image.mjs +2 -1
- package/src/chart-to-registry.mjs +2 -2
- package/src/clone-cnpg-from-snapshot.mjs +3 -1
- package/src/count-lines-of-code.mjs +1 -0
- package/src/custom-images/bitnami-audits/bitnami-audit.mjs +1 -0
- package/src/docker-to-registry-py.mjs +1 -1
- package/src/docker-to-registry.mjs +0 -1
- package/src/fetch-awesome-alerts.mjs +1 -0
- package/src/getjson.mjs +1 -0
- package/src/helm-audit.mjs +1 -0
- package/src/helm-charts/prom-operator/rules/cadvisor-rules.yaml +1 -1
- package/src/helm-charts/prom-operator/rules/kubestate-rules.yaml +20 -3
- package/src/helm-charts/prom-operator/rules/prometheus-rules.yaml +3 -3
- package/src/helm-charts/prom-operator/rules/velero-rules.yaml +1 -1
- package/src/helmup.sh +1 -1
- package/src/hook-and-release.mjs +0 -1
- package/src/k8x.sh +4 -0
- package/src/modify-gcs-access.mjs +1 -0
- package/src/refresh-py-idx.sh +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.89.1",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
"glob": "^11.0.3",
|
|
77
77
|
"handlebars": "^4.7.8",
|
|
78
78
|
"ignore": "^7.0.5",
|
|
79
|
-
"inquirer": "^12.
|
|
79
|
+
"inquirer": "^12.10.0",
|
|
80
80
|
"js-yaml": "^4.1.0",
|
|
81
81
|
"jsdoc": "^4.0.5",
|
|
82
82
|
"ms": "^2.1.3",
|
|
83
83
|
"npm-registry-fetch": "^19.0.0",
|
|
84
84
|
"ora": "^9.0.0",
|
|
85
|
-
"p-limit": "^7.
|
|
85
|
+
"p-limit": "^7.2.0",
|
|
86
86
|
"package-up": "^5.0.0",
|
|
87
87
|
"readline-sync": "^1.4.10",
|
|
88
88
|
"semver": "^7.7.3",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"simple-git": "^3.28.0",
|
|
91
91
|
"sloc": "^0.3.2",
|
|
92
92
|
"toml": "^3.0.0",
|
|
93
|
-
"zx": "^8.8.
|
|
93
|
+
"zx": "^8.8.5"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
-
"@leverege/eslint-config-leverege": "^5.1.
|
|
96
|
+
"@leverege/eslint-config-leverege": "^5.1.1",
|
|
97
97
|
"npm": "^11.6.2"
|
|
98
98
|
}
|
|
99
99
|
}
|
package/src/build-cnpg-image.mjs
CHANGED
|
@@ -102,7 +102,8 @@ 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"
|
|
105
|
+
"postgresql-\${PG_MAJOR}-repack" \\
|
|
106
|
+
"postgresql-\${PG_MAJOR}-squeeze"; \\
|
|
106
107
|
ln -s /usr/lib/postgresql/\${PG_MAJOR}/bin/pg_repack /usr/local/bin/pg_repack || true; \\
|
|
107
108
|
rm -fr /tmp/*; \\
|
|
108
109
|
rm -rf /var/lib/apt/lists/*;
|
|
@@ -106,12 +106,12 @@ debug( {
|
|
|
106
106
|
registryRepository,
|
|
107
107
|
ociPushEndpoint }, '<==Parsed package and chart' )
|
|
108
108
|
|
|
109
|
-
// gcloud auth print-access-token | helm registry login -u oauth2accesstoken \
|
|
109
|
+
// gcloud auth application-default print-access-token | helm registry login -u oauth2accesstoken \
|
|
110
110
|
// -p ${password} https://us-docker.pkg.dev
|
|
111
111
|
//
|
|
112
112
|
// Get the current access token and use it to login to the registry with helm.
|
|
113
113
|
try {
|
|
114
|
-
const accessToken = await shellCmd( 'gcloud auth print-access-token' )
|
|
114
|
+
const accessToken = await shellCmd( 'gcloud auth application-default print-access-token' )
|
|
115
115
|
// -p is frowned upon but using a pipe | is problematic with shellCmd (execa)
|
|
116
116
|
const registryLoginCommand = `helm registry login -u oauth2accesstoken -p ${accessToken}`
|
|
117
117
|
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import fs from 'node:fs/promises'
|
|
6
6
|
import path from 'node:path'
|
|
7
|
-
import ora from 'ora'
|
|
8
7
|
|
|
8
|
+
import ora from 'ora'
|
|
9
9
|
import { program } from 'commander'
|
|
10
10
|
import chalk from 'chalk'
|
|
11
11
|
import YAML from 'js-yaml'
|
|
12
|
+
|
|
12
13
|
import {
|
|
13
14
|
// condir,
|
|
14
15
|
debug,
|
|
@@ -88,6 +89,7 @@ const writeApplyScript = async ( dir ) => {
|
|
|
88
89
|
#
|
|
89
90
|
# Apply VolumeSnapshot resources prior to deploying the CNPG cluster
|
|
90
91
|
#
|
|
92
|
+
overwhelm
|
|
91
93
|
kubectl apply -f ${dir}/volumesnapshotclass.yaml
|
|
92
94
|
kubectl apply -f ${dir}/volumesnapshotcontent.yaml
|
|
93
95
|
kubectl apply -f ${dir}/volumesnapshot.yaml
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* DEPRECATED - DO NOT MODIFY
|
|
4
4
|
*/
|
|
5
5
|
import fs from 'node:fs'
|
|
6
|
+
|
|
6
7
|
import toml from 'toml'
|
|
7
8
|
import chalk from 'chalk'
|
|
8
9
|
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
parseHelmChart,
|
|
15
16
|
proceed,
|
|
16
17
|
shellCmd } from './Utils.mjs'
|
|
17
|
-
|
|
18
18
|
import Docker from './DockerPy.mjs'
|
|
19
19
|
|
|
20
20
|
// refresh-npm-token does not throw so no need to try, but it emits in debug
|
package/src/getjson.mjs
CHANGED
package/src/helm-audit.mjs
CHANGED
|
@@ -165,7 +165,7 @@ spec:
|
|
|
165
165
|
LABELS = {{ $labels }}
|
|
166
166
|
- alert: KubernetesHpaScaleInability
|
|
167
167
|
expr: (kube_horizontalpodautoscaler_spec_max_replicas - kube_horizontalpodautoscaler_status_desired_replicas) * on (horizontalpodautoscaler,namespace) (kube_horizontalpodautoscaler_status_condition{condition="ScalingLimited", status="true"} == 1) == 0
|
|
168
|
-
for:
|
|
168
|
+
for: 15m # awesome was => 2m
|
|
169
169
|
labels:
|
|
170
170
|
severity: warning
|
|
171
171
|
annotations:
|
|
@@ -295,7 +295,7 @@ spec:
|
|
|
295
295
|
LABELS = {{ $labels }}
|
|
296
296
|
- alert: KubernetesDaemonsetRolloutStuck
|
|
297
297
|
expr: kube_daemonset_status_number_ready / kube_daemonset_status_desired_number_scheduled * 100 < 100 or kube_daemonset_status_desired_number_scheduled - kube_daemonset_status_current_number_scheduled > 0
|
|
298
|
-
for: 10m
|
|
298
|
+
for: 15m # awesome was 10m
|
|
299
299
|
labels:
|
|
300
300
|
severity: warning
|
|
301
301
|
annotations:
|
|
@@ -349,7 +349,24 @@ spec:
|
|
|
349
349
|
VALUE = {{ $value }}
|
|
350
350
|
LABELS = {{ $labels }}
|
|
351
351
|
- alert: KubernetesApiClientErrors
|
|
352
|
-
|
|
352
|
+
# awesome expr: (sum(rate(rest_client_requests_total{code=~"(4|5).."}[1m])) by (instance, job) / sum(rate(rest_client_requests_total[1m])) by (instance, job)) * 100 > 1
|
|
353
|
+
expr: |
|
|
354
|
+
(
|
|
355
|
+
(
|
|
356
|
+
sum by (instance, job) (
|
|
357
|
+
rate(
|
|
358
|
+
rest_client_requests_total{
|
|
359
|
+
code=~"(4|5)..",
|
|
360
|
+
code!~"403|404|409"
|
|
361
|
+
}[5m]
|
|
362
|
+
)
|
|
363
|
+
)
|
|
364
|
+
/
|
|
365
|
+
sum by (instance, job) (
|
|
366
|
+
rate(rest_client_requests_total[5m])
|
|
367
|
+
)
|
|
368
|
+
) * 100
|
|
369
|
+
) > 1
|
|
353
370
|
for: 5m
|
|
354
371
|
labels:
|
|
355
372
|
severity: critical
|
|
@@ -130,10 +130,10 @@ spec:
|
|
|
130
130
|
VALUE = {{ $value }}
|
|
131
131
|
LABELS = {{ $labels }}
|
|
132
132
|
- alert: PrometheusRuleEvaluationFailures
|
|
133
|
-
expr: increase(prometheus_rule_evaluation_failures_total[5m]) >
|
|
134
|
-
for:
|
|
133
|
+
expr: increase(prometheus_rule_evaluation_failures_total[5m]) > 5
|
|
134
|
+
for: 10m # awesome was 0m
|
|
135
135
|
labels:
|
|
136
|
-
severity: critical
|
|
136
|
+
severity: warning # awesome was critical
|
|
137
137
|
annotations:
|
|
138
138
|
summary: Prometheus rule evaluation failures (instance {{ $labels.instance }})
|
|
139
139
|
description: |-
|
|
@@ -9,7 +9,7 @@ spec:
|
|
|
9
9
|
- name: Velero
|
|
10
10
|
rules:
|
|
11
11
|
- alert: VeleroBackupFailure
|
|
12
|
-
expr: (time() - velero_backup_last_successful_timestamp
|
|
12
|
+
expr: (time() - velero_backup_last_successful_timestamp > 108000) and (velero_backup_success_total{schedule!=""} != 0)
|
|
13
13
|
for: 5m
|
|
14
14
|
labels:
|
|
15
15
|
severity: warning
|
package/src/helmup.sh
CHANGED
|
@@ -12,7 +12,7 @@ REGISTRY_DOMAIN="us-docker.pkg.dev"
|
|
|
12
12
|
# open container initiative (oci) => https://opencontainers.org/
|
|
13
13
|
ARTIFACT_REGISTRY="oci://$REGISTRY_DOMAIN/leverege-registry"
|
|
14
14
|
# login to the registry in the background
|
|
15
|
-
gcloud auth print-access-token | helm registry login \
|
|
15
|
+
gcloud auth application-default print-access-token | helm registry login \
|
|
16
16
|
-u oauth2accesstoken --password-stdin $REGISTRY_DOMAIN &> $DEVNULL
|
|
17
17
|
|
|
18
18
|
# make sure we have a current npmrc file
|
package/src/hook-and-release.mjs
CHANGED
package/src/k8x.sh
CHANGED
package/src/refresh-py-idx.sh
CHANGED
|
@@ -11,7 +11,7 @@ exit 1
|
|
|
11
11
|
|
|
12
12
|
function leveregeBuildToolsRefreshPyIdx() {
|
|
13
13
|
# Execute gcloud command to get the token
|
|
14
|
-
local TOKEN=$(gcloud auth print-access-token)
|
|
14
|
+
local TOKEN=$(gcloud auth application-default print-access-token)
|
|
15
15
|
|
|
16
16
|
# Write to pip.conf
|
|
17
17
|
local PIP_CONFIG_DIR="$HOME/.config/pip"
|