Skip to content

Commit 733dc12

Browse files
committed
Merge branch 'improvement/add-argument-exclude-selected-pvcs' into tmp/octopus/w/132.0/improvement/add-argument-exclude-selected-pvcs
2 parents 1ee8035 + 1b4766e commit 733dc12

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
- Do not deploy Loki ingress when Loki addon is not enabled
2222
(PR[#4725](https://github.com/scality/metalk8s/pull/4725))
2323

24+
### Enhancements
25+
26+
- Add a patch to the `kube-prometheus-stack` chart to add
27+
the `--metric-labels-allowlist=persistentvolumeclaims=[excluded-from-alerts]`
28+
argument to the `kube-state-metrics` container to exclude PVCs
29+
from the `kube-state-metrics` metrics.
30+
(PR[#4723](https://github.com/scality/metalk8s/pull/4723))
31+
2432
## Release 131.0.5
2533

2634
## Release 131.0.4

charts/kube-prometheus-stack.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ kube-state-metrics:
246246
registry: '__var__(repo.registry_endpoint)'
247247
repository: '__image_no_reg__(kube-state-metrics)'
248248

249+
metricLabelsAllowlist:
250+
- persistentvolumeclaims=[excluded-from-alerts]
251+
249252
nodeSelector:
250253
node-role.kubernetes.io/infra: ''
251254

docs/operation/cluster_monitoring/alerting.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,39 @@ Simple Rules
4040
.. jinja:: alerting
4141
:file: _jinja/alerting/simple-rulelist.rst.j2
4242
:header_char: "
43+
44+
Excluding PersistentVolumeClaims from Storage Alerts
45+
-----------------------------------------------------
46+
47+
MetalK8s monitors PersistentVolumeClaim (PVC) storage usage and generates
48+
alerts when volumes are filling up. To exclude specific PVCs from these
49+
storage-related alerts (such as ``KubePersistentVolumeFillingUp`` and
50+
``KubePersistentVolumeInodesFillingUp``), add the ``excluded-from-alerts``
51+
label with the value ``"true"`` to the PVC.
52+
53+
.. code-block:: yaml
54+
55+
---
56+
apiVersion: v1
57+
kind: PersistentVolumeClaim
58+
metadata:
59+
name: <pvc-name>
60+
namespace: <namespace-name>
61+
labels:
62+
excluded-from-alerts: "true"
63+
spec:
64+
# ... PVC specification ...
65+
66+
To add this label to an existing PVC:
67+
68+
.. code-block:: shell
69+
70+
root@bootstrap $ kubectl --kubeconfig=/etc/kubernetes/admin.conf \
71+
label pvc <pvc-name> -n <namespace-name> \
72+
excluded-from-alerts=true
73+
74+
.. note::
75+
76+
This feature is particularly useful for data disks that are expected to
77+
be nearly full or for volumes where storage alerts are managed by
78+
application-specific monitoring.

salt/metalk8s/addons/prometheus-operator/deployed/chart.sls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71798,6 +71798,7 @@ spec:
7179871798
- args:
7179971799
- --port=8080
7180071800
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments
71801+
- --metric-labels-allowlist=persistentvolumeclaims=[excluded-from-alerts]
7180171802
image: {% endraw -%}{{ repo.registry_endpoint }}{%- raw %}/{% endraw -%}{{ build_image_name("kube-state-metrics", False, False) }}{%- raw %}:v2.13.0
7180271803
imagePullPolicy: IfNotPresent
7180371804
livenessProbe:

0 commit comments

Comments
 (0)