@leverege/build-tools 2.101.1 → 2.102.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 +8 -8
- package/src/Utils.mjs +5 -0
- package/src/bash-funcs +27 -0
- package/src/dashboard/DashboardManager.mjs +192 -17
- package/src/dashboard/dashboard.mjs +29 -4
- package/src/dashboard/json/{standard/noc-rows-12.json → devops/devops-noc.json} +801 -61
- package/src/dashboard/json/{standard/pvc-all-usage.json → devops/pvc-usage.json} +2 -2
- package/src/dashboard/json/leverege/leverege-noc.json +2364 -0
- package/src/dashboard/json/{standard/redis.json → leverege/leverege-rule-engine.json} +695 -646
- package/src/dashboard/json/leverege/leverege-services.json +4757 -0
- package/src/dashboard/json/recovr/recovr-locators.json +1227 -0
- package/src/dashboard/json/recovr/recovr-noc.json +1949 -0
- package/src/dashboard/json/recovr/recovr-position-srvr.json +339 -0
- package/src/dashboard/json/recovr/recovr-server.json +1127 -0
- package/src/dashboard/json/siren/siren-services.json +2066 -0
- package/src/dashboard/json/{standard/cloudnative-pg-20417-rev4.json → system/cloudnative-pg.json} +241 -243
- package/src/dashboard/json/{standard → system}/elasticsearch8.json +123 -72
- package/src/dashboard/json/system/stackdriver.json +1189 -0
- package/src/dashboard/json/{standard/traefik-op.json → system/traefik.json} +44 -56
- package/src/dashboard/json/{standard → system}/valkey.json +91 -86
- package/src/dashboard/json/{standard → tpi}/gpu-autoscaling-dashboard-ui-import.json +1 -1
- package/src/dashboard/json/tpi/leverege-noc.json +3624 -0
- package/src/helm-charts/cnpg-operator/helmup.bootstrap +19 -21
- package/src/helm-charts/eso/helmup.bootstrap +4 -2
- package/src/helm-charts/prom-operator/README-CRD-UPGRADES.md +105 -0
- package/src/helm-charts/prom-operator/helmup.bootstrap +22 -14
- package/src/helm-charts/prom-operator/helmup.plugin +1 -1
- package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +23 -45
- package/src/helm-charts/prom-operator/rules/gke-maintenance-rules.yaml +19 -0
- package/src/helm-charts/prom-operator/stackdriver-exporter.yaml.ovh +3 -2
- package/src/helm-charts/valkey/valkey-local.yaml +1 -0
- package/src/helm-charts/velero/helmup.bootstrap +2 -0
- package/src/helmup.sh +31 -4
- package/src/init-my-chart/Chartwright.mjs +2 -2
- package/src/init-my-chart/leaf-chart-templates/templates/extraobjects.yaml +1 -0
- package/src/init-my-chart/leaf-chart-templates/templates/ingressroute.yaml +1 -0
- package/src/overwhelm.mjs +5 -5
- package/src/service-man/config/secrets/npmrc.json +14 -0
- package/src/service-man/config/secrets/tsdb-dense-password.json +13 -0
- package/src/dashboard/json/standard/stackdriver.json +0 -624
- package/src/docker-to-registry-py.mjs +0 -287
- /package/src/dashboard/json/{standard → devops}/k8s-api-latency.json +0 -0
|
@@ -26,34 +26,33 @@ function installCnpgOperatorEnvironment() {
|
|
|
26
26
|
#
|
|
27
27
|
# kubectl delete serviceaccounts -n $CNPG_NAMESPACE $CNPG_SVC_ACCT &> $DEVNULL
|
|
28
28
|
# gcloud --quiet iam service-accounts delete $CNPG_SVC_EMAIL --project $GCP_PROJECT_ID&> $DEVNULL
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
createNamespaceIfNeeded $CNPG_NAMESPACE
|
|
31
|
+
|
|
32
|
+
# Guard against accidental SA deletion on re-runs. Check the GCP SA (not the
|
|
33
|
+
# k8s SA) — consistent with ESO bootstrap pattern and correct for new clusters
|
|
34
|
+
# where the GCP SA exists but the k8s SA does not yet.
|
|
35
|
+
gcloud iam service-accounts describe $CNPG_SVC_EMAIL --project $GCP_PROJECT_ID &> $DEVNULL
|
|
30
36
|
if [ $? -eq 0 ];
|
|
31
37
|
then
|
|
32
38
|
cat<<SKIP_CNPG_SA_CREATION
|
|
33
39
|
|
|
34
|
-
$YELO_WARN The CNPG SA $CNPG_SVC_ACCT already exists
|
|
40
|
+
$YELO_WARN The CNPG SA `color y $CNPG_SVC_ACCT` already exists - skipping creation
|
|
35
41
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
in place. To force a clean reinstall, delete both the k8s and gcp SA for
|
|
39
|
-
CNPG and try again. (see comments in helmup for more info)
|
|
42
|
+
To force a clean reinstall, delete both the GCP and k8s SAs for CNPG and
|
|
43
|
+
re-run helmup cnpg-operator.
|
|
40
44
|
|
|
41
45
|
SKIP_CNPG_SA_CREATION
|
|
42
|
-
|
|
46
|
+
else
|
|
47
|
+
printf "\nCreating the gcloud `color g $CNPG_SVC_ACCT` service account (SA)\n"
|
|
48
|
+
gcloud iam service-accounts create $CNPG_SVC_ACCT \
|
|
49
|
+
--project "$GCP_PROJECT_ID" \
|
|
50
|
+
--description "CNPG Operands SA" \
|
|
51
|
+
--display-name "CNPG Operands SA" &> $DEVNULL
|
|
52
|
+
exitOnError $? "Failed to create GCP SA `color y $CNPG_SVC_ACCT`"
|
|
53
|
+
waitForSA "$CNPG_SVC_ACCT" "$GCP_PROJECT_ID" 60
|
|
43
54
|
fi
|
|
44
55
|
|
|
45
|
-
# Create the operands namespace and annotate to allow redis access
|
|
46
|
-
createNamespaceIfNeeded $CNPG_NAMESPACE
|
|
47
|
-
|
|
48
|
-
# Create GCP SA and bind policies
|
|
49
|
-
printf "\nCreating the gcloud `color g $CNPG_SVC_ACCT` service account (SA)\n"
|
|
50
|
-
gcloud iam service-accounts create $CNPG_SVC_ACCT \
|
|
51
|
-
--project "$GCP_PROJECT_ID" \
|
|
52
|
-
--description "CNPG Operands SA" \
|
|
53
|
-
--display-name "CNPG Operands SA" &> $DEVNULL
|
|
54
|
-
warnOnError $? "the GCP SA `color y $CNPG_SVC_ACCT` may already exist"
|
|
55
|
-
waitForSA "$CNPG_SVC_ACCT" "$GCP_PROJECT_ID" 60
|
|
56
|
-
|
|
57
56
|
CNPG_OPS_ROLE="cnpg.operands"
|
|
58
57
|
printf "\nCreating the `color g $CNPG_OPS_ROLE` IAM role\n"
|
|
59
58
|
## Attach roles
|
|
@@ -136,7 +135,6 @@ driver: pd.csi.storage.gke.io
|
|
|
136
135
|
deletionPolicy: Retain
|
|
137
136
|
EOSNAPSC
|
|
138
137
|
|
|
139
|
-
sleep 2 # hold up processing for a moment to allow IAM mods to propagate
|
|
140
138
|
}
|
|
141
139
|
|
|
142
140
|
# this function is a little convoluted in the way it attempts to install the
|
|
@@ -184,7 +182,7 @@ CNPG_FETCH_CLEANUP_CRONJOB_YAML
|
|
|
184
182
|
--project="$GCP_PROJECT_ID" \
|
|
185
183
|
--description="Used for cronjob cleanup with Workload Identity" \
|
|
186
184
|
--display-name="CNPG Cleanup SA" &> $DEVNULL
|
|
187
|
-
|
|
185
|
+
warnOnError $? "the GCP SA $CNPG_CLEANUP_SA may already exist"
|
|
188
186
|
waitForSA "$CNPG_CLEANUP_SA" "$GCP_PROJECT_ID" 60
|
|
189
187
|
|
|
190
188
|
gcloud projects add-iam-policy-binding "$GCP_PROJECT_ID" \
|
|
@@ -11,6 +11,8 @@ function installEsoEnvironment() {
|
|
|
11
11
|
ESO_SA="eso-sa"
|
|
12
12
|
ESO_SA_EMAIL="$ESO_SA@$GCP_PROJECT_ID.iam.gserviceaccount.com"
|
|
13
13
|
|
|
14
|
+
createNamespaceIfNeeded $ESO_NAMESPACE
|
|
15
|
+
|
|
14
16
|
# Guard against accidental SA deletion on re-runs (see cnpg-operator for war story)
|
|
15
17
|
gcloud iam service-accounts describe $ESO_SA_EMAIL --project $GCP_PROJECT_ID &> $DEVNULL
|
|
16
18
|
if [ $? -eq 0 ];
|
|
@@ -50,8 +52,8 @@ SKIP_ESO_SA_CREATION
|
|
|
50
52
|
--member "serviceAccount:$GCP_PROJECT_ID.svc.id.goog[$ESO_NAMESPACE/external-secrets]" \
|
|
51
53
|
--role roles/iam.workloadIdentityUser $ESO_SA_EMAIL
|
|
52
54
|
warnOnError $? "gcloud workload identity binding may have failed"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
waitForSAIAM "$ESO_SA" "$GCP_PROJECT_ID" "roles/iam.workloadIdentityUser" \
|
|
56
|
+
"serviceAccount:$GCP_PROJECT_ID.svc.id.goog[$ESO_NAMESPACE/external-secrets]" 60
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
installEsoEnvironment
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# CRD Upgrades — kube-prometheus-stack
|
|
2
|
+
|
|
3
|
+
## Why this exists
|
|
4
|
+
|
|
5
|
+
Helm can install CustomResourceDefinitions (CRDs) but will not upgrade them
|
|
6
|
+
when you bump chart versions. This chart ships a CRD upgrade job that uses
|
|
7
|
+
server-side apply (SSA) to reconcile CRDs to the versions bundled with the
|
|
8
|
+
chart.
|
|
9
|
+
|
|
10
|
+
## Default: disabled
|
|
11
|
+
|
|
12
|
+
The CRD upgrade job is disabled by default (`crds.enabled: false`) because it
|
|
13
|
+
requires cluster-admin level permissions to run. Specifically, it creates and
|
|
14
|
+
deletes ClusterRole and ClusterRoleBinding resources as pre-upgrade Helm hooks,
|
|
15
|
+
which requires `container.clusterRoles.delete` in GCP IAM. Only enable it when
|
|
16
|
+
explicitly bumping the chart version, and only a devops engineer should run
|
|
17
|
+
`helmup prom-operator` when it is enabled.
|
|
18
|
+
|
|
19
|
+
## Settings
|
|
20
|
+
|
|
21
|
+
**`crds.enabled`** — controls whether the chart manages CRDs at all. When
|
|
22
|
+
`false`, the CRD upgrade job and its associated hook resources are not rendered.
|
|
23
|
+
Default: `false`.
|
|
24
|
+
|
|
25
|
+
**`crds.upgradeJob.enabled`** — controls whether the SSA upgrade job hook runs.
|
|
26
|
+
Must be `true` for CRDs to be reconciled on upgrade. Default: `false`.
|
|
27
|
+
|
|
28
|
+
**`crds.upgradeJob.forceConflicts`** — adds `--force-conflicts` to the SSA
|
|
29
|
+
apply, overriding fields owned by another field manager. Use only for a one-time
|
|
30
|
+
conflict resolution. Revert to `false` immediately after. Default: `false`.
|
|
31
|
+
|
|
32
|
+
## Permissions requirement
|
|
33
|
+
|
|
34
|
+
The upgrade job runs as a pair of Helm pre-upgrade hooks that create a
|
|
35
|
+
ClusterRole and ClusterRoleBinding. Helm's `before-hook-creation` delete policy
|
|
36
|
+
causes it to attempt deletion of these resources before creating them — even if
|
|
37
|
+
they don't yet exist in the cluster. The GCP IAM permission check fires before
|
|
38
|
+
the existence check, so a 403 is returned for users without
|
|
39
|
+
`container.clusterRoles.delete` regardless of whether the resources are present.
|
|
40
|
+
|
|
41
|
+
The `admission-webhooks/job-patch` hooks have the same requirement and are
|
|
42
|
+
always present, making `helmup prom-operator` a full-devops-only operation
|
|
43
|
+
regardless of the CRD upgrade setting.
|
|
44
|
+
|
|
45
|
+
## Hook lifecycle
|
|
46
|
+
|
|
47
|
+
The ClusterRole and ClusterRoleBinding created by the upgrade job are ephemeral.
|
|
48
|
+
They are deleted automatically after the job succeeds via the
|
|
49
|
+
`hook-delete-policy: hook-succeeded` annotation. You will not see them in
|
|
50
|
+
`kubectl get clusterrole` after a successful run.
|
|
51
|
+
|
|
52
|
+
## Switching from enabled to disabled
|
|
53
|
+
|
|
54
|
+
If `crds.enabled` was previously `true` and a successful upgrade ran, the CRD
|
|
55
|
+
hook resources are recorded in the Helm release manifest even though they no
|
|
56
|
+
longer exist in the cluster. Switching to `false` and running `helmup` will
|
|
57
|
+
cause Helm to attempt to delete those orphaned hook resources from the previous
|
|
58
|
+
release — again requiring cluster-admin permissions for that one transition run.
|
|
59
|
+
|
|
60
|
+
To verify what hooks are currently stored in the release:
|
|
61
|
+
```bash
|
|
62
|
+
helm get hooks prometheus-stack -n prometheus | grep ^"# Source"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After a devops engineer runs `helmup prom-operator` with `crds.enabled: false`,
|
|
66
|
+
the hooks will be cleared from the release manifest and subsequent runs will not
|
|
67
|
+
require cluster-admin permissions (beyond the always-present admission-webhook
|
|
68
|
+
hooks).
|
|
69
|
+
|
|
70
|
+
## Runbook — bumping the chart version
|
|
71
|
+
|
|
72
|
+
1. **Preflight** — confirm current CRD state:
|
|
73
|
+
```bash
|
|
74
|
+
kubectl get crd | grep monitoring.coreos.com
|
|
75
|
+
kubectl apply --server-side --dry-run=server -f <crd-dir/>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. **Enable** — set both flags in `prometheus-stack.yaml.ovh`:
|
|
79
|
+
```yaml
|
|
80
|
+
crds:
|
|
81
|
+
enabled: true
|
|
82
|
+
upgradeJob:
|
|
83
|
+
enabled: true
|
|
84
|
+
forceConflicts: false
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
3. **Run** — as a devops engineer:
|
|
88
|
+
```bash
|
|
89
|
+
helmup prom-operator
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
4. **If the job fails with field-manager conflicts:**
|
|
93
|
+
- Confirm no other source manages these CRDs
|
|
94
|
+
- Temporarily set `forceConflicts: true` for this run only
|
|
95
|
+
- Revert to `false` immediately after
|
|
96
|
+
|
|
97
|
+
5. **Post-check:**
|
|
98
|
+
```bash
|
|
99
|
+
kubectl get crd | grep monitoring.coreos.com
|
|
100
|
+
# verify CRDs show Established: True
|
|
101
|
+
# verify operator pod is healthy
|
|
102
|
+
# verify alerts and rules are normal
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
6. **Disable** — revert both flags to `false` before committing.
|
|
@@ -17,11 +17,14 @@ function installStackdriverExporterEnvironment() {
|
|
|
17
17
|
|
|
18
18
|
createNamespaceIfNeeded $SDEXP_NS
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
# used to remove this to avoid weird behavior when attempting to reboot
|
|
21
|
+
# the service with udated configs - no longer doing this (for now)
|
|
22
|
+
#
|
|
23
|
+
# guarantee any previous remnants of the exporter are gone
|
|
24
|
+
# printf "\n*** Removing the previous $SDEXP_SA installation...\n"
|
|
25
|
+
# helm uninstall -n $SDEXP_NS "stackdriver-exporter" &> $DEVNULL
|
|
26
|
+
# kubectl delete serviceaccounts -n $SDEXP_NS $SDEXP_SA &> $DEVNULL
|
|
27
|
+
# printf "*** Deleting the gcloud SA $SDEXP_EM\n"
|
|
25
28
|
# gcloud --quiet iam service-accounts delete $SDEXP_EM \
|
|
26
29
|
# --project $GCP_PROJECT_ID &> $DEVNULL
|
|
27
30
|
|
|
@@ -58,18 +61,19 @@ function createGrafanaOAuthSecret() {
|
|
|
58
61
|
printf "\nCreating placeholder `color g grafana-google-oauth` secret in prometheus namespace\n"
|
|
59
62
|
kubectl create secret generic grafana-google-oauth \
|
|
60
63
|
--namespace prometheus \
|
|
61
|
-
--from-literal=GF_AUTH_GOOGLE_CLIENT_ID='' \
|
|
62
|
-
--from-literal=GF_AUTH_GOOGLE_CLIENT_SECRET=''
|
|
64
|
+
--from-literal=GF_AUTH_GOOGLE_CLIENT_ID='bootstrap id' \
|
|
65
|
+
--from-literal=GF_AUTH_GOOGLE_CLIENT_SECRET='boostrap secret'
|
|
63
66
|
warnOnError $? "Failed to create grafana-google-oauth placeholder secret"
|
|
64
67
|
else
|
|
65
68
|
printf "\n`color g grafana-google-oauth` secret already exists - skipping\n"
|
|
66
69
|
fi
|
|
67
70
|
|
|
68
|
-
# Wire up the ExternalSecret
|
|
69
|
-
#
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
# Wire up the ExternalSecret only if ESO is enabled for this cluster.
|
|
72
|
+
# Set ESO_ENABLED=true in overwhelm.yaml to activate (default: false).
|
|
73
|
+
if [ "${ESO_ENABLED}" = "true" ];
|
|
74
|
+
then
|
|
75
|
+
showInstalling "Grafana Google OAuth ExternalSecret"
|
|
76
|
+
cat<<GRAFANA_OAUTH_SECRET | kubectl apply -f -
|
|
73
77
|
apiVersion: external-secrets.io/v1
|
|
74
78
|
kind: ExternalSecret
|
|
75
79
|
metadata:
|
|
@@ -86,11 +90,15 @@ spec:
|
|
|
86
90
|
data:
|
|
87
91
|
- secretKey: GF_AUTH_GOOGLE_CLIENT_ID
|
|
88
92
|
remoteRef:
|
|
89
|
-
key:
|
|
93
|
+
key: GF_AUTH_GOOGLE_CLIENT_ID
|
|
90
94
|
- secretKey: GF_AUTH_GOOGLE_CLIENT_SECRET
|
|
91
95
|
remoteRef:
|
|
92
|
-
key:
|
|
96
|
+
key: GF_AUTH_GOOGLE_CLIENT_SECRET
|
|
93
97
|
GRAFANA_OAUTH_SECRET
|
|
98
|
+
else
|
|
99
|
+
printf "\n`color y '***WARNING:'` ESO_ENABLED is not set - skipping Grafana OAuth ExternalSecret\n"
|
|
100
|
+
printf " Set ESO_ENABLED=true in overwhelm.yaml and re-run helmup prom-operator to wire up the OAuth secret.\n\n"
|
|
101
|
+
fi
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
installStackdriverExporterEnvironment
|
|
@@ -8,7 +8,7 @@ showInstalling "The Prometheus Operator (kube-prometheus-stack)"
|
|
|
8
8
|
|
|
9
9
|
# https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack
|
|
10
10
|
OCI_CHART="oci://ghcr.io/prometheus-community/charts/kube-prometheus-stack"
|
|
11
|
-
[ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="
|
|
11
|
+
[ -z "$PROMETHEUS_STACK_CHART_VERSION" ] && PROMETHEUS_STACK_CHART_VERSION="85.0.2"
|
|
12
12
|
helm upgrade $NS --install prometheus-stack $OCI_CHART \
|
|
13
13
|
--values prom-operator/prometheus-stack.yaml \
|
|
14
14
|
--version $PROMETHEUS_STACK_CHART_VERSION $HELM_WHAT
|
|
@@ -1,50 +1,13 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Apparently you must have devops access in order to deploy the prometheus
|
|
3
|
+
# operator since it attempts to create cluster roles during deployment.
|
|
4
|
+
#
|
|
1
5
|
crds:
|
|
2
|
-
#
|
|
3
|
-
# CRD MANAGEMENT — kube-prometheus-stack
|
|
4
|
-
#
|
|
5
|
-
# Why this exists
|
|
6
|
-
# Helm can install CustomResourceDefinitions (CRDs) but will not upgrade them
|
|
7
|
-
# when you bump chart versions. This chart ships a CRD upgrade job that uses
|
|
8
|
-
# server-side apply (SSA) to reconcile CRDs to the versions bundled with the
|
|
9
|
-
# chart.
|
|
10
|
-
#
|
|
11
|
-
# Safe operating model
|
|
12
|
-
# ✅ Leave the upgrade job ENABLED if this chart is the sole owner of the
|
|
13
|
-
# Prometheus Operator CRDs.
|
|
14
|
-
# ⚠️ Keep "forceConflicts" DISABLED unless you hit a specific field-manager
|
|
15
|
-
# conflict that you’ve reviewed and want this chart to own.
|
|
16
|
-
# ❌ If another source manages CRDs (e.g., a separate CRD chart, GitOps
|
|
17
|
-
# bootstrap, platform repo), DISABLE the job to avoid ownership fights.
|
|
18
|
-
#
|
|
19
|
-
# Settings
|
|
20
|
-
# enabled: runs the SSA job on chart upgrade to reconcile CRDs.
|
|
21
|
-
# Recommended: true if chart owns the CRDs; false if
|
|
22
|
-
# another tool owns them.
|
|
23
|
-
#
|
|
24
|
-
# forceConflicts: adds `--force-conflicts` to SSA, overriding fields owned by
|
|
25
|
-
# another controller. Use only for a one-time conflict
|
|
26
|
-
# resolution. Can overwrite annotations and mask real
|
|
27
|
-
# incompatibilities if left true.
|
|
28
|
-
#
|
|
29
|
-
# Recommended defaults
|
|
30
|
-
# enabled: true
|
|
31
|
-
# forceConflicts: false
|
|
32
|
-
#
|
|
33
|
-
# Mini-runbook
|
|
34
|
-
# 1) Preflight:
|
|
35
|
-
# kubectl get crd | grep monitoring.coreos.com
|
|
36
|
-
# kubectl apply --server-side --dry-run=server -f <crd-dir/>
|
|
37
|
-
# 2) Upgrade with enabled: true, forceConflicts: false.
|
|
38
|
-
# 3) If job fails with conflicts:
|
|
39
|
-
# - confirm no other source manages these CRDs
|
|
40
|
-
# - temporarily set forceConflicts: true for this upgrade only
|
|
41
|
-
# - revert to false afterwards
|
|
42
|
-
# 4) Post-check: CRDs Established, operator healthy, alerts/rules normal
|
|
43
|
-
# ─────────────────────────────────────────────────────────────────────────────
|
|
6
|
+
# See README-CRD-UPGRADES.md — disabled by default, full-devops only
|
|
44
7
|
enabled: true
|
|
45
8
|
upgradeJob:
|
|
46
9
|
enabled: true
|
|
47
|
-
forceConflicts: false
|
|
10
|
+
forceConflicts: false
|
|
48
11
|
|
|
49
12
|
kubeControllerManager:
|
|
50
13
|
enabled: false
|
|
@@ -180,13 +143,19 @@ grafana:
|
|
|
180
143
|
sidecar:
|
|
181
144
|
dashboards:
|
|
182
145
|
enabled: true
|
|
146
|
+
folderAnnotation: grafana_folder
|
|
147
|
+
provider:
|
|
148
|
+
foldersFromFilesStructure: true
|
|
183
149
|
# Credentials are injected from the grafana-google-oauth k8s secret, which is
|
|
184
150
|
# managed by the ExternalSecret in helmup.plugin once ESO is deployed.
|
|
185
151
|
# On first install, the secret is a placeholder created by helmup.bootstrap.
|
|
152
|
+
grafana.ini:
|
|
153
|
+
feature_toggles:
|
|
154
|
+
ssoSettingsApi: false
|
|
186
155
|
envFromSecret: grafana-google-oauth
|
|
187
156
|
env:
|
|
188
157
|
GF_SERVER_ROOT_URL: https://${PROJECT_NAME}-monitoring.${HOST}.com
|
|
189
|
-
GF_AUTH_GOOGLE_ENABLED: "
|
|
158
|
+
GF_AUTH_GOOGLE_ENABLED: "${ESO_ENABLED}"
|
|
190
159
|
GF_AUTH_GOOGLE_SCOPES: "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"
|
|
191
160
|
GF_AUTH_GOOGLE_AUTH_URL: "https://accounts.google.com/o/oauth2/auth"
|
|
192
161
|
GF_AUTH_GOOGLE_TOKEN_URL: "https://accounts.google.com/o/oauth2/token"
|
|
@@ -284,7 +253,7 @@ alertmanager:
|
|
|
284
253
|
{{- end }}
|
|
285
254
|
|
|
286
255
|
{{- if .Labels.pod }}
|
|
287
|
-
*Pod Link:* *<https://console.cloud.google.com/kubernetes/pod/${GCE_REGION}/${CLUSTER_NAME}/{{ .Labels.namespace }}/{{ .Labels.pod }}?project=${
|
|
256
|
+
*Pod Link:* *<https://console.cloud.google.com/kubernetes/pod/${GCE_REGION}/${CLUSTER_NAME}/{{ .Labels.namespace }}/{{ .Labels.pod }}?project=${PROJECT_ID}|`{{ .Labels.pod }}`>*
|
|
288
257
|
{{- end }}
|
|
289
258
|
|
|
290
259
|
*Status:* `{{ .Status }}` | *Severity:* `{{ .Labels.severity }}` {{- if .Labels.container }} *Container:* `{{ .Labels.container }}` {{- end }}
|
|
@@ -347,6 +316,15 @@ alertmanager:
|
|
|
347
316
|
- namespace
|
|
348
317
|
- alertname
|
|
349
318
|
|
|
319
|
+
# GKE node upgrade/maintenance suppresses expected churn alerts.
|
|
320
|
+
# PVC, disk pressure, and other infrastructure alerts are intentionally
|
|
321
|
+
# excluded so genuine storage/capacity problems are never silenced.
|
|
322
|
+
- source_matchers:
|
|
323
|
+
- alertname="GKEMaintenanceInProgress"
|
|
324
|
+
- maintenance="true"
|
|
325
|
+
target_matchers:
|
|
326
|
+
- alertname=~"KubernetesNodeNotReady|KubernetesPodNotHealthy|KubernetesPodCrashLooping|frequent_app_restarts"
|
|
327
|
+
|
|
350
328
|
route:
|
|
351
329
|
receiver: slack # default for everything
|
|
352
330
|
group_by: ["alertname", "namespace"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
apiVersion: monitoring.coreos.com/v1
|
|
2
|
+
kind: PrometheusRule
|
|
3
|
+
metadata:
|
|
4
|
+
name: gke-maintenance-rules
|
|
5
|
+
namespace: prometheus
|
|
6
|
+
|
|
7
|
+
spec:
|
|
8
|
+
groups:
|
|
9
|
+
- name: GKE Maintenance
|
|
10
|
+
rules:
|
|
11
|
+
- alert: GKEMaintenanceInProgress
|
|
12
|
+
expr: sum(kube_node_spec_unschedulable) > 0
|
|
13
|
+
for: 3m
|
|
14
|
+
labels:
|
|
15
|
+
severity: info
|
|
16
|
+
maintenance: "true"
|
|
17
|
+
annotations:
|
|
18
|
+
summary: "GKE node maintenance in progress"
|
|
19
|
+
description: "{{ $value }} node(s) are currently unschedulable — GKE upgrade or cordon in progress"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
fullnameOverride: "prometheus-stack-stackdriver-metrics"
|
|
6
6
|
|
|
7
7
|
stackdriver:
|
|
8
|
-
projectId: "${
|
|
8
|
+
projectId: "${PROJECT_ID}"
|
|
9
9
|
metrics:
|
|
10
10
|
typePrefixes: >
|
|
11
11
|
agent.googleapis.com/cpu/utilization,
|
|
@@ -19,7 +19,8 @@ stackdriver:
|
|
|
19
19
|
kubernetes.io/container/accelerator/duty_cycle,
|
|
20
20
|
kubernetes.io/container/accelerator/memory_total,
|
|
21
21
|
kubernetes.io/container/accelerator/memory_used,
|
|
22
|
-
|
|
22
|
+
pubsub.googleapis.com/subscription/backlog_bytes,
|
|
23
|
+
pubsub.googleapis.com/subscription/dead_letter_message_count,
|
|
23
24
|
pubsub.googleapis.com/subscription/num_undelivered_messages,
|
|
24
25
|
pubsub.googleapis.com/subscription/oldest_unacked_message_age,
|
|
25
26
|
pubsub.googleapis.com/subscription/pull_ack_request_count,
|
|
@@ -86,6 +86,8 @@ function installVeleroEnvironment() {
|
|
|
86
86
|
--role roles/iam.workloadIdentityUser \
|
|
87
87
|
$SERVICE_ACCOUNT_EMAIL
|
|
88
88
|
warnOnError $? "gcloud workload identity binding may have failed"
|
|
89
|
+
waitForSAIAM "velero" "$GCP_PROJECT_ID" "roles/iam.workloadIdentityUser" \
|
|
90
|
+
"serviceAccount:$GCP_PROJECT_ID.svc.id.goog[velero/velero]" 60
|
|
89
91
|
|
|
90
92
|
printf "\nCreate and annotate the k8s SA\n"
|
|
91
93
|
kubectl create serviceaccount velero --namespace velero
|
package/src/helmup.sh
CHANGED
|
@@ -20,6 +20,7 @@ function giveHelp() {
|
|
|
20
20
|
`color g "--k8s-match"` Only proceed if k8s context is correctly set
|
|
21
21
|
`color g "--dry-run"` Show what helm would do without applying changes
|
|
22
22
|
`color g "--debug"` Enable verbose debug output
|
|
23
|
+
`color g "--mutate"` Forces a deployment mutation
|
|
23
24
|
`color g "--help"` Show this help message
|
|
24
25
|
|
|
25
26
|
Invocation Modes:
|
|
@@ -48,6 +49,9 @@ for arg in "$@"; do
|
|
|
48
49
|
--k8s-match)
|
|
49
50
|
export OVERWHELM_ARGS="--matchk8s"
|
|
50
51
|
;;
|
|
52
|
+
--mutate)
|
|
53
|
+
MUTATE_DEPLOYMENT=1
|
|
54
|
+
;;
|
|
51
55
|
--help|-h)
|
|
52
56
|
giveHelp && exit 0
|
|
53
57
|
;;
|
|
@@ -135,7 +139,7 @@ SYSTEM=(
|
|
|
135
139
|
cnpg-operator
|
|
136
140
|
preemptible-killer
|
|
137
141
|
zombie-killer
|
|
138
|
-
|
|
142
|
+
# reflector
|
|
139
143
|
reloader
|
|
140
144
|
velero
|
|
141
145
|
cnpg-db-psql-stack
|
|
@@ -218,8 +222,8 @@ WORKLOAD_ID
|
|
|
218
222
|
--member "serviceAccount:$GCP_PROJECT_ID.svc.id.goog[${NAMESPACE}/${BOUND_SVC_ACCT}]" \
|
|
219
223
|
--role roles/iam.workloadIdentityUser $SVC_ACCT_EMAIL
|
|
220
224
|
warnOnError $? "gcloud workload identity binding may have failed"
|
|
221
|
-
|
|
222
|
-
|
|
225
|
+
waitForSAIAM "$SVC_ACCT" "$GCP_PROJECT_ID" "roles/iam.workloadIdentityUser" \
|
|
226
|
+
"serviceAccount:$GCP_PROJECT_ID.svc.id.goog[${NAMESPACE}/${BOUND_SVC_ACCT}]" 60
|
|
223
227
|
|
|
224
228
|
# Verify the Kubernetes SA and create it if necessary
|
|
225
229
|
printf "\nChecking for the `color g $NAMESPACE/$SVC_ACCT` k8s SA\n"
|
|
@@ -622,6 +626,25 @@ function doHelmup() {
|
|
|
622
626
|
local from=
|
|
623
627
|
[ ! -z "$FROM_VERSIONS" ] && from="`color y \"<= from Versions.json\"`"
|
|
624
628
|
printf "$doing $from\n"
|
|
629
|
+
if [[ $MUTATE_DEPLOYMENT -eq 1 ]];
|
|
630
|
+
then
|
|
631
|
+
cat<<MUTATION_MSG
|
|
632
|
+
|
|
633
|
+
`color y "WARNING: About to delete the $SERVICE k8s deployment object!
|
|
634
|
+
This will cause brief downtime while helm recreates it. The service
|
|
635
|
+
and any LoadBalancer/static IP will be unaffected."`
|
|
636
|
+
|
|
637
|
+
MUTATION_MSG
|
|
638
|
+
yesToContinue "to delete the $SERVICE deployment and proceed with upgrade"
|
|
639
|
+
kubectl delete deployments.apps $SERVICE
|
|
640
|
+
cat<<DELETE_WAIT
|
|
641
|
+
|
|
642
|
+
`color y " Waiting for $SERVICE deployment to be fully removed..."`
|
|
643
|
+
|
|
644
|
+
DELETE_WAIT
|
|
645
|
+
kubectl wait --for=delete deployment/$SERVICE --timeout=120s
|
|
646
|
+
fi
|
|
647
|
+
|
|
625
648
|
# plugins pass HELMUP as a single quoted string - split it into args without using eval
|
|
626
649
|
[[ $# -eq 1 ]] && set -- $1
|
|
627
650
|
"$@" --set "helmup.culprit=$culprit" --set "helmup.deployT=$deployT"
|
|
@@ -811,7 +834,7 @@ REBOOTSTRAP
|
|
|
811
834
|
}
|
|
812
835
|
|
|
813
836
|
# ---------- helmup MAIN ----------
|
|
814
|
-
helm repo update &>/dev/null & # see comments in the doInstall function for rationale
|
|
837
|
+
helm repo update leverege &>/dev/null & # see comments in the doInstall function for rationale
|
|
815
838
|
|
|
816
839
|
overwhelm $OVERWHELM_ARGS
|
|
817
840
|
[ $? -ne 0 ] && printf "\n\n***Aborting helmup...\n\n" && exit 1
|
|
@@ -821,6 +844,10 @@ export GCP_PROJECT_ID="$(getProjectIdFromK8sContext)"
|
|
|
821
844
|
# Same for the region, but not as prevalent
|
|
822
845
|
export GCE_REGION=`overwhelm -k GCE_REGION`
|
|
823
846
|
|
|
847
|
+
# TODO: Temporary, until ESO is widely deployed, then the ESO_ENABLED logic
|
|
848
|
+
# can be removed from the configs entirely.
|
|
849
|
+
export ESO_ENABLED=`overwhelm -k ESO_ENABLED`
|
|
850
|
+
|
|
824
851
|
doInstall "${SERVICES[@]}"
|
|
825
852
|
|
|
826
853
|
displayBanner
|
|
@@ -13,11 +13,11 @@ const hbsContext = {
|
|
|
13
13
|
hbsChartName : '',
|
|
14
14
|
hbsChartVersion : '1.0.0',
|
|
15
15
|
hbsChartAppVersion : 'v1.0.0',
|
|
16
|
-
hbsArtifactRegistry : 'us-docker.pkg.dev/leverege-registry/
|
|
16
|
+
hbsArtifactRegistry : 'us-docker.pkg.dev/leverege-registry/FOLDER/images',
|
|
17
17
|
hbsPartOf : '',
|
|
18
18
|
hbsServicePreemptible : true,
|
|
19
19
|
hbsRedisEnabled : true,
|
|
20
|
-
|
|
20
|
+
hbsAutoscalingEnabled : true,
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const PRESERVE_SECTIONS = new Set( [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ include "leverege.extraObjects" . }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ include "leverege.ingressroute" . }}
|
package/src/overwhelm.mjs
CHANGED
|
@@ -250,14 +250,14 @@ const buildYaml = ( yamls, replacements ) => {
|
|
|
250
250
|
const values = buildYaml( yams, over )
|
|
251
251
|
|
|
252
252
|
// Check to see if someone is requesting a value from the yaml.
|
|
253
|
+
// Uses the fully merged+resolved `over` object so context-specific keys are found.
|
|
253
254
|
if ( args.key ) {
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
debug( { keys }, '<==Replacements' )
|
|
255
|
+
const val = over[args.key] ?? ''
|
|
256
|
+
debug( { over }, '<==Replacements' )
|
|
257
257
|
if ( args.export ) {
|
|
258
|
-
log( `export ${args.key}=${
|
|
258
|
+
log( `export ${args.key}=${val}` )
|
|
259
259
|
} else {
|
|
260
|
-
log(
|
|
260
|
+
log( val )
|
|
261
261
|
}
|
|
262
262
|
if ( !args.continue ) process.exit()
|
|
263
263
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "managed",
|
|
3
|
+
"name": "NPMRC",
|
|
4
|
+
"source": "leverege-registry:DEPRECATED_NPMRC",
|
|
5
|
+
"k8s": { "secret": "npmrc", "key": "key" },
|
|
6
|
+
"labels": {
|
|
7
|
+
"env-type": "string"
|
|
8
|
+
},
|
|
9
|
+
"annotations": {
|
|
10
|
+
"description": "a deprecated npmrc key",
|
|
11
|
+
"owner": "platform-team",
|
|
12
|
+
"source": "service-man"
|
|
13
|
+
}
|
|
14
|
+
}
|