Home > Workload Solutions > Container Platforms > Red Hat OpenShift Container Platform > Archive > Implementation Guide—Red Hat OpenShift Container Platform 4.6 on Dell Infrastructure > Adding storage for monitoring pods
By default, alert and metrics data are stored in an empty directory. When you delete the pods, the data is also deleted. We recommend that you save the data in PVs.
To add PV storage to Prometheus and Alert Manager pods:
[core@csah-pri ~] oc create -f <YAML file>
Notes:
In the following YAML file, all the pods are 40 G and the storage class is isilon-nfs. Manually add the content that is yellow-highlighted in the following extract.
Using block storage with no read/write permissions to groups resulted in failure, as described in this file in GitHub. We therefore switched to Isilon-nfs storage class, which has RW permissions to group by default.
[core@csah-pri pmax]$ oc edit configmap cluster-monitoring-config -n openshift-monitoring
apiVersion: v1
data:
config.yaml: |
prometheusk8s:
volumeClaimTemplate:
metadata:
name: prometheusdb
spec:
storageClassName: isilon-nfs
resources:
requests:
storage: 40Gi
alertmanagerMain:
volumeClaimTemplate:
metadata:
name: alertmanager
spec:
storageClassName: isilon-nfs
resources:
requests:
storage: 40Gi
kind: ConfigMap
metadata:
creationTimestamp: "2020-12-10T19:06:05Z"
name: cluster-monitoring-config
namespace: openshift-monitoring
resourceVersion: "4150896"
selfLink: /api/v1/namespaces/openshift-monitoring/configmaps/cluster-monitoring-config
uid: 4796aecd-e188-40a6-bfd0-6d069c5d01e5
This step terminates existing Prometheus and Alert Manager pods. New pods with storage added are created and are in the Running state, as shown in the following example:
[core@csah-pri pvcs]$ oc get pods -n openshift-monitoring | grep -i -E "alertmanager|prometheus-k8s"
alertmanager-main-0 3/3 Running 0 4m
alertmanager-main-1 3/3 Running 0 4m
alertmanager-main-2 3/3 Running 0 4m
prometheus-k8s-0 7/7 Running 1 3m50s
prometheus-k8s-1 7/7 Running 1 3m50s