Home > Communication Service Provider Solutions > Telecom Multicloud Foundation > Red Hat > Guides > Red Hat Open Shift Container Platform Guides > Deployment Guide: Red Hat OpenShift Container Platform Reference Architecture for Telecom > 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 persistent volumes.
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. Add manually the content highlighted below.
Using a block storage with no RW permissions to groups, resulted in failure as described here. Hence, switched to Isilon-nfs storage class which by default has RW permissions to group.
[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