You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For monitoring components to use a persistent volume (PV), you must configure a persistent volume claim (PVC).
10
+
To use a persistent volume (PV) for monitoring components, you must configure a persistent volume claim (PVC).
15
11
16
12
.Prerequisites
17
13
@@ -52,18 +48,21 @@ metadata:
52
48
namespace: openshift-monitoring
53
49
data:
54
50
config.yaml: |
55
-
<component>:
51
+
<component>: #<1>
56
52
volumeClaimTemplate:
57
53
spec:
58
-
storageClassName: <storage_class>
54
+
storageClassName: <storage_class> #<2>
59
55
resources:
60
56
requests:
61
-
storage: <amount_of_storage>
57
+
storage: <amount_of_storage> #<3>
62
58
----
59
+
<1> Specify the core monitoring component for which you want to configure the PVC.
60
+
<2> Specify an existing storage class. If a storage class is not specified, the default storage class is used.
61
+
<3> Specify the amount of required storage.
63
62
+
64
63
See the link:https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims[Kubernetes documentation on PersistentVolumeClaims] for information on how to specify `volumeClaimTemplate`.
65
64
+
66
-
The following example configures a PVC that claims local persistent storage for the Prometheus instance that monitors core {product-title} components:
65
+
The following example configures a PVC that claims persistent storage for the Prometheus instance that monitors core {product-title} components:
67
66
+
68
67
[source,yaml]
69
68
----
@@ -77,33 +76,11 @@ data:
77
76
prometheusK8s:
78
77
volumeClaimTemplate:
79
78
spec:
80
-
storageClassName: local-storage
79
+
storageClassName: my-storage-class
81
80
resources:
82
81
requests:
83
82
storage: 40Gi
84
83
----
85
-
+
86
-
In the above example, the storage class created by the Local Storage Operator is called `local-storage`.
87
-
+
88
-
The following example configures a PVC that claims local persistent storage for Alertmanager:
89
-
+
90
-
[source,yaml]
91
-
----
92
-
apiVersion: v1
93
-
kind: ConfigMap
94
-
metadata:
95
-
name: cluster-monitoring-config
96
-
namespace: openshift-monitoring
97
-
data:
98
-
config.yaml: |
99
-
alertmanagerMain:
100
-
volumeClaimTemplate:
101
-
spec:
102
-
storageClassName: local-storage
103
-
resources:
104
-
requests:
105
-
storage: 10Gi
106
-
----
107
84
108
85
** *To configure a PVC for a component that monitors user-defined projects*:
109
86
endif::openshift-dedicated,openshift-rosa[]
@@ -125,58 +102,21 @@ metadata:
125
102
namespace: openshift-user-workload-monitoring
126
103
data:
127
104
config.yaml: |
128
-
<component>:
105
+
<component>: #<1>
129
106
volumeClaimTemplate:
130
107
spec:
131
-
storageClassName: <storage_class>
108
+
storageClassName: <storage_class> #<2>
132
109
resources:
133
110
requests:
134
-
storage: <amount_of_storage>
111
+
storage: <amount_of_storage> #<3>
135
112
----
113
+
<1> Specify the component for user-defined monitoring for which you want to configure the PVC.
114
+
<2> Specify an existing storage class. If a storage class is not specified, the default storage class is used.
115
+
<3> Specify the amount of required storage.
136
116
+
137
117
See the link:https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims[Kubernetes documentation on PersistentVolumeClaims] for information on how to specify `volumeClaimTemplate`.
138
118
+
139
-
The following example configures a PVC that claims
140
-
ifndef::openshift-dedicated,openshift-rosa[]
141
-
local
142
-
endif::openshift-dedicated,openshift-rosa[]
143
-
persistent storage for the Prometheus instance that monitors user-defined projects:
144
-
+
145
-
[source,yaml]
146
-
----
147
-
apiVersion: v1
148
-
kind: ConfigMap
149
-
metadata:
150
-
name: user-workload-monitoring-config
151
-
namespace: openshift-user-workload-monitoring
152
-
data:
153
-
config.yaml: |
154
-
prometheus:
155
-
volumeClaimTemplate:
156
-
spec:
157
-
ifndef::openshift-dedicated,openshift-rosa[]
158
-
storageClassName: local-storage
159
-
endif::openshift-dedicated,openshift-rosa[]
160
-
ifdef::openshift-dedicated,openshift-rosa[]
161
-
storageClassName: gp3
162
-
endif::openshift-dedicated,openshift-rosa[]
163
-
resources:
164
-
requests:
165
-
storage: 40Gi
166
-
----
167
-
+
168
-
ifndef::openshift-dedicated,openshift-rosa[]
169
-
In the above example, the storage class created by the Local Storage Operator is called `local-storage`.
170
-
endif::openshift-dedicated,openshift-rosa[]
171
-
ifdef::openshift-dedicated,openshift-rosa[]
172
-
The above example uses the `gp3` storage class.
173
-
endif::openshift-dedicated,openshift-rosa[]
174
-
+
175
-
The following example configures a PVC that claims
176
-
ifndef::openshift-dedicated,openshift-rosa[]
177
-
local
178
-
endif::openshift-dedicated,openshift-rosa[]
179
-
persistent storage for Thanos Ruler:
119
+
The following example configures a PVC that claims persistent storage for Thanos Ruler:
Copy file name to clipboardExpand all lines: modules/monitoring-configuring-persistent-storage.adoc
+7-12Lines changed: 7 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -11,31 +11,26 @@ Run cluster monitoring with persistent storage to gain the following benefits:
11
11
* Protect your metrics and alerting data from data loss by storing them in a persistent volume (PV). As a result, they can survive pods being restarted or recreated.
12
12
* Avoid getting duplicate notifications and losing silences for alerts when the Alertmanager pods are restarted.
13
13
14
-
For production environments, it is highly recommended to configure persistent storage. Because of the high IO demands, it is advantageous to use local storage.
14
+
For production environments, it is highly recommended to configure persistent storage.
15
15
16
-
[id="persistent-storage-prerequisites"]
16
+
[id="persistent-storage-prerequisites_{context}"]
17
17
== Persistent storage prerequisites
18
18
19
19
ifdef::openshift-dedicated,openshift-rosa[]
20
20
* Use the block type of storage.
21
21
endif::openshift-dedicated,openshift-rosa[]
22
22
23
23
ifndef::openshift-dedicated,openshift-rosa[]
24
-
* Dedicate sufficient local persistent storage to ensure that the disk does not become full. How much storage you need depends on the number of pods.
25
-
26
-
* Verify that you have a persistent volume (PV) ready to be claimed by the persistent volume claim (PVC), one PV for each replica. Because Prometheus and Alertmanager both have two replicas, you need four PVs to support the entire monitoring stack. The PVs are available from the Local Storage Operator, but not if you have enabled dynamically provisioned storage.
24
+
* Dedicate sufficient persistent storage to ensure that the disk does not become full.
27
25
28
26
* Use `Filesystem` as the storage type value for the `volumeMode` parameter when you configure the persistent volume.
29
27
+
30
-
[NOTE]
31
-
====
32
-
If you use a local volume for persistent storage, do not use a raw block volume, which is described with `volumeMode: Block` in the `LocalVolume` object. Prometheus cannot use raw block volumes.
33
-
====
34
-
+
35
28
[IMPORTANT]
36
29
====
37
-
Prometheus does not support file systems that are not POSIX compliant.
30
+
* Do not use a raw block volume, which is described with `volumeMode: Block` in the `PersistentVolume` resource. Prometheus cannot use raw block volumes.
31
+
32
+
* Prometheus does not support file systems that are not POSIX compliant.
38
33
For example, some NFS file system implementations are not POSIX compliant.
39
34
If you want to use an NFS file system for storage, verify with the vendor that their NFS implementation is fully POSIX compliant.
0 commit comments