Home > Workload Solutions > Container Platforms > Red Hat OpenShift Container Platform > Archive > Deployment Guide--Dell Ready Stack for Red Hat OpenShift Container Platform 4.3 CSI Attached Storage > Adding storage
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 persistent volumes.
Add persistent volume storage to Prometheus and Alertmanager pods:
[core@csah pvcs]$ cat sampleconfigmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
[core@csah pvcs]$ oc get configmap cluster-monitoring-config -n openshift-monitoring
NAME DATA AGE
cluster-monitoring-config 1 2m26s
Note: In the following YAML file, all the pods are 40 G and the storage class is test-powermax-fc.
[core@csah pmax]$ oc edit configmap cluster-monitoring-config -n openshift-monitoring
apiVersion: v1
data:
config.yaml: |
prometheusk8s:
volumeClaimTemplate:
metadata:
name: prometheusdb
spec:
storageClassName: test-powermax-fc
resources:
requests:
storage: 40Gi
alertmanagerMain:
volumeClaimTemplate:
metadata:
name: alertmanager
spec:
storageClassName: test-powermax-fc
resources:
requests:
storage: 40Gi
kind: ConfigMap
metadata:
creationTimestamp: "2020-06-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
Note: This step terminates existing Prometheus and alertmanager pods. New pods with storage added are created and are in the RUNNING state, as shown in the following example.
[core@csah 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