@leverege/build-tools 2.54.0 → 2.55.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.
Files changed (28) hide show
  1. package/package.json +4 -4
  2. package/registry-compass.yaml +20 -0
  3. package/src/build-and-push.sh +2 -7
  4. package/src/chart-compass.mjs +96 -0
  5. package/src/helm-charts/elasticsearch8/helmup.plugin +2 -21
  6. package/src/helm-charts/prom-operator/.nohelm +0 -0
  7. package/src/helm-charts/prom-operator/.nohelmdn +0 -0
  8. package/src/helm-charts/prom-operator/apply-rules +13 -0
  9. package/src/helm-charts/prom-operator/elasticsearch-exporter.yaml +20 -0
  10. package/src/helm-charts/prom-operator/gitignore +2 -0
  11. package/src/helm-charts/prom-operator/helmdn.plugin +17 -0
  12. package/src/helm-charts/prom-operator/helmup.plugin +27 -0
  13. package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +139 -0
  14. package/src/helm-charts/prom-operator/rules/elasticsearch-rules.yaml +111 -0
  15. package/src/helm-charts/prom-operator/rules/gcp-rules.yaml +47 -0
  16. package/src/helm-charts/prom-operator/rules/kubernetes-rules.yaml +112 -0
  17. package/src/helm-charts/prom-operator/rules/kubernetes-rules.yaml.off +112 -0
  18. package/src/helm-charts/prom-operator/rules/leverege-rules.yaml +20 -0
  19. package/src/helm-charts/prom-operator/rules/postgres-rules.yaml +190 -0
  20. package/src/helm-charts/prom-operator/rules/prometheus-rules.yaml +79 -0
  21. package/src/helm-charts/prom-operator/rules/prometheus-rules.yaml.off +79 -0
  22. package/src/helm-charts/prom-operator/rules/redis-rules.yaml +90 -0
  23. package/src/helm-charts/prom-operator/rules/traefik-rules.yaml +28 -0
  24. package/src/helm-charts/prom-operator/rules/velero-rules.yaml +28 -0
  25. package/src/helm-charts/prom-operator/stackdriver-exporter.yaml.ovh +52 -0
  26. package/src/helm-charts/redis/redis-local.yaml +3 -0
  27. package/src/helmup.sh +11 -4
  28. package/src/overwhelm.mjs +8 -1
@@ -0,0 +1,28 @@
1
+ apiVersion: monitoring.coreos.com/v1
2
+ kind: PrometheusRule
3
+ metadata:
4
+ name: traefik-rules
5
+ namespace: prometheus
6
+
7
+ spec:
8
+ groups:
9
+ - name: Traefik Alerts
10
+ rules:
11
+ - alert: TraefikConfigReloadFailed
12
+ expr: traefik_config_last_reload_failure > 0
13
+ for: 1m
14
+ labels:
15
+ severity: warning
16
+ annotations:
17
+ summary: "Traefik config failed to reload"
18
+ description: "New config file for Traefik is invalid or Traefik encountered an error"
19
+
20
+ # - alert: TraefikHighHttp4xxError
21
+ # expr: sum(rate(traefik_service_requests_total{code=~"4.*"}[3m])) by (service) / sum(rate(traefik_service_requests_total[3m])) by (service) * 100 > 10
22
+ # for: 5m
23
+ # labels:
24
+ # severity: error
25
+ # annotations:
26
+ # summary: "Traefik high HTTP 4xx error rate on {{ $labels.service }}"
27
+ # description: "Traefik backend 4xx error rate is above 10% (currently at {{ $value }}%)"
28
+ # dashboard: "OVH:<MONITORING>/traefik"
@@ -0,0 +1,28 @@
1
+ apiVersion: monitoring.coreos.com/v1
2
+ kind: PrometheusRule
3
+ metadata:
4
+ name: velero-rules
5
+ namespace: prometheus
6
+
7
+ spec:
8
+ groups:
9
+ - name: Velero
10
+ rules:
11
+ - alert: VeleroBackupFailure
12
+ expr: (time() - velero_backup_last_successful_timestamp{schedule_version=~"2.[0]"} > 108000) and (velero_backup_success_total{schedule!=""} != 0)
13
+ for: 5m
14
+ labels:
15
+ severity: warning
16
+ annotations:
17
+ summary: "Velero schedule {{ $labels.schedule }} backup failed to execute properly"
18
+ description: "It has been over 30 hours since the last successful backup"
19
+ dashboard: "OVH:<MONITORING>/velero"
20
+ - alert: NoVeleroBackups
21
+ expr: velero_backup_success_total{schedule!=""} == 0
22
+ for: 30h
23
+ labels:
24
+ severity: warning
25
+ annotations:
26
+ summary: "Velero has not made any backups yet"
27
+ description: "No backups have successfully been made since velero was initialized (or restarted), go check it out ASAP"
28
+ dashboard: "OVH:<MONITORING>/velero"
@@ -0,0 +1,52 @@
1
+ #
2
+ # to force a reinstall of this service simply remove or rename this
3
+ # stackdriver-exporter subdirectory and rerun helmup stackdriver-exporter
4
+ #
5
+ fullnameOverride: "prometheus-stack-stackdriver-metrics"
6
+
7
+ stackdriver:
8
+ projectId: "OVH:<PROJECT_NAME>"
9
+ metrics:
10
+ typePrefixes: "pubsub.googleapis.com/subscription/oldest_unacked_message_age,pubsub.googleapis.com/subscription/num_undelivered_messages,pubsub.googleapis.com/subscription/pull_ack_request_count,pubsub.googleapis.com/subscription/streaming_pull_ack_request_count,pubsub.googleapis.com/topic/message_sizes,pubsub.googleapis.com/topic/send_request_count,firebasedatabase.googleapis.com/io/database_load,firebasedatabase.googleapis.com/network/sent_bytes_count,firebasedatabase.googleapis.com/network/active_connections"
11
+
12
+ # https://artifacthub.io/packages/helm/prometheus-community/prometheus-stackdriver-exporter?modal=values&path=serviceMonitor
13
+ serviceMonitor:
14
+ enabled: true
15
+ namespace: prometheus
16
+ interval: 20s
17
+
18
+ annotations:
19
+ prometheus.io/port: "9255"
20
+ prometheus.io/scrape: "true" # this is a string annotation - so quoted!
21
+
22
+ tolerations:
23
+ - key: "preemptible"
24
+ operator: "Equal"
25
+ value: "true"
26
+ effect: "NoSchedule"
27
+
28
+ affinity:
29
+ nodeAffinity:
30
+ requiredDuringSchedulingIgnoredDuringExecution:
31
+ nodeSelectorTerms:
32
+ - matchExpressions:
33
+ - key: target-env
34
+ operator: In
35
+ values:
36
+ - preemptible
37
+
38
+ resources:
39
+ requests:
40
+ cpu: 50m
41
+ memory: 32Mi
42
+
43
+ # NOTE to future selves - the exporter's helm chart does not have a clue
44
+ # regarding workload identity, which means the gcloud and k8s service
45
+ # accounts have to be managed outside of the chart by helmup. In order to get
46
+ # the linkages from the SA to the service we specify the SA name here, but
47
+ # disable the creation of the SA since it will have already have been created
48
+ # and bound by the helmup installStackdriverExporterEnvironment function.
49
+ #
50
+ serviceAccount:
51
+ create : false # this is a flag to helm - so unquoted ... da F?!
52
+ name: "stackdriver-exporter"
@@ -70,3 +70,6 @@ networkPolicy:
70
70
 
71
71
  metrics:
72
72
  enabled: true
73
+ serviceMonitor:
74
+ enabled: false # set to true for prometheus operator
75
+ namespace: "prometheus"
package/src/helmup.sh CHANGED
@@ -296,7 +296,7 @@ function installStackdriverExporterEnvironment() {
296
296
  # Add necessary helm repositories - note that stable is deprecated
297
297
  addHelmRepo prometheus-community https://prometheus-community.github.io/helm-charts
298
298
 
299
- local SDEXP_NS="monitoring"
299
+ local SDEXP_NS=${1:-monitoring}
300
300
  local SDEXP_SA="stackdriver-exporter"
301
301
  local SDEXP_EM="$SDEXP_SA@$GCP_PROJECT_ID.iam.gserviceaccount.com"
302
302
 
@@ -306,7 +306,8 @@ function installStackdriverExporterEnvironment() {
306
306
  printf "\n*** Removing the previous $SDEXP_SA installation...\n"
307
307
  helm uninstall -n $SDEXP_NS $SDEXP_SA &> $DEVNULL
308
308
  kubectl delete serviceaccounts -n $SDEXP_NS $SDEXP_SA &> $DEVNULL
309
- gcloud --quiet iam service-accounts delete $SDEXP_EM &> $DEVNULL
309
+ printf "!!! Skipping deletion of the gcloud SA $SDEXP_EM\n"
310
+ # gcloud --quiet iam service-accounts delete $SDEXP_EM &> $DEVNULL
310
311
 
311
312
  # NOTE: The k8s SA != GCP SA - the former is created by the helm chart
312
313
  # that installs the stackdriver-exporter, the latter is handled here in
@@ -321,7 +322,7 @@ function installStackdriverExporterEnvironment() {
321
322
 
322
323
  printf "\n*** Binding IAM role of $SDEXP_NS viewer to $SDEXP_SA in $GCP_PROJECT_ID\n"
323
324
  gcloud projects add-iam-policy-binding "$GCP_PROJECT_ID" \
324
- --role "roles/$SDEXP_NS.viewer" \
325
+ --role "roles/monitoring.viewer" \
325
326
  --member "serviceAccount:$SDEXP_EM" &> $DEVNULL
326
327
  sleep 2 # give the IAM binding a chance to complete before moving on
327
328
 
@@ -1002,7 +1003,13 @@ CATBACKUP
1002
1003
  bootstrapLocalSetup $SERVICE
1003
1004
  ;;
1004
1005
 
1005
- "prometheus"|"prometheus-operator")
1006
+ "prometheus")
1007
+ installStackdriverExporterEnvironment
1008
+ bootstrapLocalSetup $SERVICE
1009
+ ;;
1010
+
1011
+ "prom-operator")
1012
+ installStackdriverExporterEnvironment prometheus
1006
1013
  bootstrapLocalSetup $SERVICE
1007
1014
  ;;
1008
1015
 
package/src/overwhelm.mjs CHANGED
@@ -206,6 +206,13 @@ const doReplacements = ( yamls, replacements ) => {
206
206
  process.exit( 1 )
207
207
  }
208
208
 
209
+ // Eat any doubly double quoted values such that
210
+ // ""<ovh replace>"" -> "<ovh replace>"
211
+ // but
212
+ // someDefault: ""
213
+ // remains unchanged
214
+ replYaml = replYaml.replace( /""([^"]+)""/g, '"$1"' )
215
+
209
216
  return replYaml
210
217
  }
211
218
 
@@ -307,7 +314,7 @@ ahoy.forEach( ( dir ) => {
307
314
  }
308
315
  } )
309
316
 
310
- // we can also apply replaceables to any top level .ovh files to support top level config maps
317
+ // we can also apply replaceables to all .ovh files in the project
311
318
  glob.sync( '**/*.ovh' ).forEach( ( cfgmap ) => {
312
319
  const target = cfgmap.replace( /.ovh$/, '' )
313
320
  let valuesOut = fs.readFileSync( cfgmap, { encoding : 'utf-8' } )