@leverege/build-tools 2.64.1 → 2.65.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.
@@ -2,12 +2,13 @@
2
2
  #
3
3
  # See => https://cloudnative-pg.io/documentation/current/installation_upgrade/
4
4
  #
5
- OPVER="1.25.1"
5
+ # OPVER="1.25.1"
6
+ OPVER="1.26.0-rc1" # 03/28/2025
6
7
 
7
8
  createNamespaceIfNeeded cnpg-system
8
9
 
9
10
  kubectl apply --server-side -f \
10
- https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-${OPVER%.*}/releases/cnpg-${OPVER}.yaml $K8S_WHAT
11
+ https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-${OPVER}.yaml $K8S_WHAT
11
12
 
12
13
  # Legacy terraformed clusters (like sandbox) may need a special firewall rule
13
14
  # added to the network layer on k8s. It should look like this:
@@ -0,0 +1,326 @@
1
+ # https://samber.github.io/awesome-prometheus-alerts/rules#kubernetes
2
+ apiVersion: monitoring.coreos.com/v1
3
+ kind: PrometheusRule
4
+ metadata:
5
+ name: awesome-k8s-rules
6
+ namespace: prometheus
7
+
8
+ spec:
9
+ groups:
10
+ - name: Awesome Kubernetes
11
+ rules:
12
+ - alert: KubernetesNodeNotReady
13
+ expr: kube_node_status_condition{condition="Ready",status="true"} == 0
14
+ for: 10m
15
+ labels:
16
+ severity: critical
17
+ annotations:
18
+ summary: Kubernetes Node not ready (instance {{ $labels.instance }})
19
+ description: "Node {{ $labels.node }} has been unready for a long time\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
20
+
21
+ - alert: KubernetesNodeMemoryPressure
22
+ expr: kube_node_status_condition{condition="MemoryPressure",status="true"} == 1
23
+ for: 2m
24
+ labels:
25
+ severity: critical
26
+ annotations:
27
+ summary: Kubernetes Node memory pressure (instance {{ $labels.instance }})
28
+ description: "Node {{ $labels.node }} has MemoryPressure condition\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
29
+
30
+ - alert: KubernetesNodeDiskPressure
31
+ expr: kube_node_status_condition{condition="DiskPressure",status="true"} == 1
32
+ for: 2m
33
+ labels:
34
+ severity: critical
35
+ annotations:
36
+ summary: Kubernetes Node disk pressure (instance {{ $labels.instance }})
37
+ description: "Node {{ $labels.node }} has DiskPressure condition\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
38
+
39
+ - alert: KubernetesNodeNetworkUnavailable
40
+ expr: kube_node_status_condition{condition="NetworkUnavailable",status="true"} == 1
41
+ for: 2m
42
+ labels:
43
+ severity: critical
44
+ annotations:
45
+ summary: Kubernetes Node network unavailable (instance {{ $labels.instance }})
46
+ description: "Node {{ $labels.node }} has NetworkUnavailable condition\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
47
+
48
+ - alert: KubernetesNodeOutOfPodCapacity
49
+ expr: sum by (node) ((kube_pod_status_phase{phase="Running"} == 1) + on(uid, instance) group_left(node) (0 * kube_pod_info{pod_template_hash=""})) / sum by (node) (kube_node_status_allocatable{resource="pods"}) * 100 > 90
50
+ for: 2m
51
+ labels:
52
+ severity: warning
53
+ annotations:
54
+ summary: Kubernetes Node out of pod capacity (instance {{ $labels.instance }})
55
+ description: "Node {{ $labels.node }} is out of pod capacity\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
56
+
57
+ # - alert: KubernetesContainerOomKiller
58
+ # expr: (kube_pod_container_status_restarts_total - kube_pod_container_status_restarts_total offset 10m >= 1) and ignoring (reason) min_over_time(kube_pod_container_status_last_terminated_reason{reason="OOMKilled"}[10m]) == 1
59
+ # for: 0m
60
+ # labels:
61
+ # severity: warning
62
+ # annotations:
63
+ # summary: Kubernetes Container oom killer (instance {{ $labels.instance }})
64
+ # description: "Container {{ $labels.container }} in pod {{ $labels.namespace }}/{{ $labels.pod }} has been OOMKilled {{ $value }} times in the last 10 minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
65
+
66
+ - alert: KubernetesJobFailed
67
+ expr: kube_job_status_failed > 0
68
+ for: 0m
69
+ labels:
70
+ severity: warning
71
+ annotations:
72
+ summary: Kubernetes Job failed (instance {{ $labels.instance }})
73
+ description: "Job {{ $labels.namespace }}/{{ $labels.job_name }} failed to complete\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
74
+
75
+ - alert: KubernetesJobNotStarting
76
+ expr: kube_job_status_active == 0 and kube_job_status_failed == 0 and kube_job_status_succeeded == 0 and (time() - kube_job_status_start_time) > 600
77
+ for: 0m
78
+ labels:
79
+ severity: warning
80
+ annotations:
81
+ summary: Kubernetes Job not starting (instance {{ $labels.instance }})
82
+ description: "Job {{ $labels.namespace }}/{{ $labels.job_name }} did not start for 10 minutes\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
83
+
84
+ - alert: KubernetesCronjobSuspended
85
+ expr: kube_cronjob_spec_suspend != 0
86
+ for: 0m
87
+ labels:
88
+ severity: warning
89
+ annotations:
90
+ summary: Kubernetes CronJob suspended (instance {{ $labels.instance }})
91
+ description: "CronJob {{ $labels.namespace }}/{{ $labels.cronjob }} is suspended\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
92
+
93
+ - alert: KubernetesPersistentvolumeclaimPending
94
+ expr: kube_persistentvolumeclaim_status_phase{phase="Pending"} == 1
95
+ for: 2m
96
+ labels:
97
+ severity: warning
98
+ annotations:
99
+ summary: Kubernetes PersistentVolumeClaim pending (instance {{ $labels.instance }})
100
+ description: "PersistentVolumeClaim {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is pending\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
101
+
102
+ - alert: KubernetesVolumeOutOfDiskSpace
103
+ expr: kubelet_volume_stats_available_bytes / kubelet_volume_stats_capacity_bytes * 100 < 10
104
+ for: 2m
105
+ labels:
106
+ severity: warning
107
+ annotations:
108
+ summary: Kubernetes Volume out of disk space (instance {{ $labels.instance }})
109
+ description: "Volume is almost full (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
110
+
111
+ # - alert: KubernetesVolumeFullInFourDays
112
+ # expr: predict_linear(kubelet_volume_stats_available_bytes[6h:5m], 4 * 24 * 3600) < 0
113
+ # for: 0m
114
+ # labels:
115
+ # severity: critical
116
+ # annotations:
117
+ # summary: Kubernetes Volume full in four days (instance {{ $labels.instance }})
118
+ # description: "Volume under {{ $labels.namespace }}/{{ $labels.persistentvolumeclaim }} is expected to fill up within four days. Currently {{ $value | humanize }}% is available.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
119
+
120
+ - alert: KubernetesPersistentvolumeError
121
+ expr: kube_persistentvolume_status_phase{phase=~"Failed|Pending", job="kube-state-metrics"} > 0
122
+ for: 0m
123
+ labels:
124
+ severity: critical
125
+ annotations:
126
+ summary: Kubernetes PersistentVolume error (instance {{ $labels.instance }})
127
+ description: "Persistent volume {{ $labels.persistentvolume }} is in bad state\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
128
+
129
+ - alert: KubernetesStatefulsetDown
130
+ expr: kube_statefulset_replicas != kube_statefulset_status_replicas_ready > 0
131
+ for: 1m
132
+ labels:
133
+ severity: critical
134
+ annotations:
135
+ summary: Kubernetes StatefulSet down (instance {{ $labels.instance }})
136
+ description: "StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} went down\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
137
+
138
+ # - alert: KubernetesHpaScaleInability
139
+ # expr: (kube_horizontalpodautoscaler_spec_max_replicas - kube_horizontalpodautoscaler_status_desired_replicas) * on (horizontalpodautoscaler,namespace) (kube_horizontalpodautoscaler_status_condition{condition="ScalingLimited", status="true"} == 1) == 0
140
+ # for: 2m
141
+ # labels:
142
+ # severity: warning
143
+ # annotations:
144
+ # summary: Kubernetes HPA scale inability (instance {{ $labels.instance }})
145
+ # description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to scale\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
146
+
147
+ - alert: KubernetesHpaMetricsUnavailability
148
+ expr: kube_horizontalpodautoscaler_status_condition{status="false", condition="ScalingActive"} == 1
149
+ for: 0m
150
+ labels:
151
+ severity: warning
152
+ annotations:
153
+ summary: Kubernetes HPA metrics unavailability (instance {{ $labels.instance }})
154
+ description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is unable to collect metrics\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
155
+
156
+ # - alert: KubernetesHpaScaleMaximum
157
+ # expr: (kube_horizontalpodautoscaler_status_desired_replicas >= kube_horizontalpodautoscaler_spec_max_replicas) and (kube_horizontalpodautoscaler_spec_max_replicas > 1) and (kube_horizontalpodautoscaler_spec_min_replicas != kube_horizontalpodautoscaler_spec_max_replicas)
158
+ # for: 2m
159
+ # labels:
160
+ # severity: info
161
+ # annotations:
162
+ # summary: Kubernetes HPA scale maximum (instance {{ $labels.instance }})
163
+ # description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} has hit maximum number of desired pods\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
164
+
165
+ - alert: KubernetesHpaUnderutilized
166
+ expr: max(quantile_over_time(0.5, kube_horizontalpodautoscaler_status_desired_replicas[1d]) == kube_horizontalpodautoscaler_spec_min_replicas) by (horizontalpodautoscaler) > 3
167
+ for: 0m
168
+ labels:
169
+ severity: info
170
+ annotations:
171
+ summary: Kubernetes HPA underutilized (instance {{ $labels.instance }})
172
+ description: "HPA {{ $labels.namespace }}/{{ $labels.horizontalpodautoscaler }} is constantly at minimum replicas for 50% of the time. Potential cost saving here.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
173
+
174
+ - alert: KubernetesPodNotHealthy
175
+ expr: sum by (namespace, pod) (kube_pod_status_phase{phase=~"Pending|Unknown|Failed"}) > 0
176
+ for: 15m
177
+ labels:
178
+ severity: critical
179
+ annotations:
180
+ summary: Kubernetes Pod not healthy (instance {{ $labels.instance }})
181
+ description: "Pod {{ $labels.namespace }}/{{ $labels.pod }} has been in a non-running state for longer than 15 minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
182
+
183
+ - alert: KubernetesPodCrashLooping
184
+ expr: increase(kube_pod_container_status_restarts_total[1m]) > 3
185
+ for: 2m
186
+ labels:
187
+ severity: warning
188
+ annotations:
189
+ summary: Kubernetes pod crash looping (instance {{ $labels.instance }})
190
+ description: "Pod {{ $labels.namespace }}/{{ $labels.pod }} is crash looping\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
191
+
192
+ - alert: KubernetesReplicasetReplicasMismatch
193
+ expr: kube_replicaset_spec_replicas != kube_replicaset_status_ready_replicas
194
+ for: 10m
195
+ labels:
196
+ severity: warning
197
+ annotations:
198
+ summary: Kubernetes ReplicaSet replicas mismatch (instance {{ $labels.instance }})
199
+ description: "ReplicaSet {{ $labels.namespace }}/{{ $labels.replicaset }} replicas mismatch\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
200
+
201
+ - alert: KubernetesDeploymentReplicasMismatch
202
+ expr: kube_deployment_spec_replicas != kube_deployment_status_replicas_available
203
+ for: 10m
204
+ labels:
205
+ severity: warning
206
+ annotations:
207
+ summary: Kubernetes Deployment replicas mismatch (instance {{ $labels.instance }})
208
+ description: "Deployment {{ $labels.namespace }}/{{ $labels.deployment }} replicas mismatch\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
209
+
210
+ - alert: KubernetesStatefulsetReplicasMismatch
211
+ expr: kube_statefulset_status_replicas_ready != kube_statefulset_status_replicas
212
+ for: 10m
213
+ labels:
214
+ severity: warning
215
+ annotations:
216
+ summary: Kubernetes StatefulSet replicas mismatch (instance {{ $labels.instance }})
217
+ description: "StatefulSet does not match the expected number of replicas.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
218
+
219
+ - alert: KubernetesDeploymentGenerationMismatch
220
+ expr: kube_deployment_status_observed_generation != kube_deployment_metadata_generation
221
+ for: 10m
222
+ labels:
223
+ severity: critical
224
+ annotations:
225
+ summary: Kubernetes Deployment generation mismatch (instance {{ $labels.instance }})
226
+ description: "Deployment {{ $labels.namespace }}/{{ $labels.deployment }} has failed but has not been rolled back.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
227
+
228
+ - alert: KubernetesStatefulsetGenerationMismatch
229
+ expr: kube_statefulset_status_observed_generation != kube_statefulset_metadata_generation
230
+ for: 10m
231
+ labels:
232
+ severity: critical
233
+ annotations:
234
+ summary: Kubernetes StatefulSet generation mismatch (instance {{ $labels.instance }})
235
+ description: "StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} has failed but has not been rolled back.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
236
+
237
+ - alert: KubernetesStatefulsetUpdateNotRolledOut
238
+ expr: max without (revision) (kube_statefulset_status_current_revision unless kube_statefulset_status_update_revision) * (kube_statefulset_replicas != kube_statefulset_status_replicas_updated)
239
+ for: 10m
240
+ labels:
241
+ severity: warning
242
+ annotations:
243
+ summary: Kubernetes StatefulSet update not rolled out (instance {{ $labels.instance }})
244
+ description: "StatefulSet {{ $labels.namespace }}/{{ $labels.statefulset }} update has not been rolled out.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
245
+
246
+ - alert: KubernetesDaemonsetRolloutStuck
247
+ 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
248
+ for: 10m
249
+ labels:
250
+ severity: warning
251
+ annotations:
252
+ summary: Kubernetes DaemonSet rollout stuck (instance {{ $labels.instance }})
253
+ description: "Some Pods of DaemonSet {{ $labels.namespace }}/{{ $labels.daemonset }} are not scheduled or not ready\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
254
+
255
+ - alert: KubernetesDaemonsetMisscheduled
256
+ expr: kube_daemonset_status_number_misscheduled > 0
257
+ for: 1m
258
+ labels:
259
+ severity: critical
260
+ annotations:
261
+ summary: Kubernetes DaemonSet misscheduled (instance {{ $labels.instance }})
262
+ description: "Some Pods of DaemonSet {{ $labels.namespace }}/{{ $labels.daemonset }} are running where they are not supposed to run\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
263
+
264
+ # Threshold should be customized for each cronjob name.
265
+ - alert: KubernetesCronjobTooLong
266
+ expr: time() - kube_cronjob_next_schedule_time > 3600
267
+ for: 0m
268
+ labels:
269
+ severity: warning
270
+ annotations:
271
+ summary: Kubernetes CronJob too long (instance {{ $labels.instance }})
272
+ description: "CronJob {{ $labels.namespace }}/{{ $labels.cronjob }} is taking more than 1h to complete.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
273
+
274
+ - alert: KubernetesJobSlowCompletion
275
+ expr: kube_job_spec_completions - kube_job_status_succeeded - kube_job_status_failed > 0
276
+ for: 12h
277
+ labels:
278
+ severity: critical
279
+ annotations:
280
+ summary: Kubernetes Job slow completion (instance {{ $labels.instance }})
281
+ description: "Kubernetes Job {{ $labels.namespace }}/{{ $labels.job_name }} did not complete in time.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
282
+
283
+ - alert: KubernetesApiServerErrors
284
+ expr: sum(rate(apiserver_request_total{job="apiserver",code=~"(?:5..)"}[1m])) by (instance, job) / sum(rate(apiserver_request_total{job="apiserver"}[1m])) by (instance, job) * 100 > 3
285
+ for: 2m
286
+ labels:
287
+ severity: critical
288
+ annotations:
289
+ summary: Kubernetes API server errors (instance {{ $labels.instance }})
290
+ description: "Kubernetes API server is experiencing high error rate\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
291
+
292
+ - alert: KubernetesApiClientErrors
293
+ 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
294
+ for: 2m
295
+ labels:
296
+ severity: critical
297
+ annotations:
298
+ summary: Kubernetes API client errors (instance {{ $labels.instance }})
299
+ description: "Kubernetes API client is experiencing high error rate\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
300
+
301
+ - alert: KubernetesClientCertificateExpiresNextWeek
302
+ expr: apiserver_client_certificate_expiration_seconds_count{job="apiserver"} > 0 and histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job="apiserver"}[5m]))) < 7*24*60*60
303
+ for: 0m
304
+ labels:
305
+ severity: warning
306
+ annotations:
307
+ summary: Kubernetes client certificate expires next week (instance {{ $labels.instance }})
308
+ description: "A client certificate used to authenticate to the apiserver is expiring next week.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
309
+
310
+ - alert: KubernetesClientCertificateExpiresSoon
311
+ expr: apiserver_client_certificate_expiration_seconds_count{job="apiserver"} > 0 and histogram_quantile(0.01, sum by (job, le) (rate(apiserver_client_certificate_expiration_seconds_bucket{job="apiserver"}[5m]))) < 24*60*60
312
+ for: 0m
313
+ labels:
314
+ severity: critical
315
+ annotations:
316
+ summary: Kubernetes client certificate expires soon (instance {{ $labels.instance }})
317
+ description: "A client certificate used to authenticate to the apiserver is expiring in less than 24.0 hours.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
318
+
319
+ - alert: KubernetesApiServerLatency
320
+ expr: histogram_quantile(0.99, sum(rate(apiserver_request_duration_seconds_bucket{verb!~"(?:CONNECT|WATCHLIST|WATCH|PROXY)"} [10m])) WITHOUT (subresource)) > 1
321
+ for: 2m
322
+ labels:
323
+ severity: warning
324
+ annotations:
325
+ summary: Kubernetes API server latency (instance {{ $labels.instance }})
326
+ description: "Kubernetes API server has a 99th percentile latency of {{ $value }} seconds for {{ $labels.verb }} {{ $labels.resource }}.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"