Bug 1798924

Summary: PVCs/PVs are recreated if we don't use the default PVC prefix for Prometheus/Alertmanager
Product: OpenShift Container Platform Reporter: Junqi Zhao <juzhao>
Component: MonitoringAssignee: Lili Cosic <lcosic>
Status: CLOSED DUPLICATE QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: alegrand, anpicker, erooth, kakkoyun, lcosic, mloibl, pkrupa, surbania
Target Milestone: ---Keywords: Regression
Target Release: 4.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-10 06:29:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Junqi Zhao 2020-02-06 10:40:21 UTC
Note: Should be the same bug as Bug 1793328, if confirmed, could be closed ad duplicate
Description of problem:
1. Attach PVs for monitoring, and set "name: prometheus" for Prometheus PVCs, each PV is 10Gi
2. Set "name: alertmanager" for Alertmanager PVCs, each PV is 4Gi
3. Upgrade from 4.3.1 to 4.4.0-0.nightly-2020-02-06-041236 and check PVCs
find PVCs/PVs are recreated, and use default PVC prefix  "alertmanager-main-db" for Alertmanager, and default PVC prefix "prometheus-k8s-db" for Prometheus

# oc get sc
NAME                 PROVISIONER            RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
standard (default)   kubernetes.io/cinder   Delete          WaitForFirstConsumer   true                   5h27m



# oc -n openshift-monitoring get cm cluster-monitoring-config -oyaml
apiVersion: v1
data:
  config.yaml: |
    prometheusK8s:
      retention: 3h
      volumeClaimTemplate:
        metadata:
          name: prometheus
        spec:
          storageClassName: standard
          volumeMode: Filesystem
          resources:
            requests:
              storage: 10Gi
    alertmanagerMain:
      volumeClaimTemplate:
        metadata:
          name: alertmanager
        spec:
          storageClassName: standard
          volumeMode: Filesystem
          resources:
            requests:
              storage: 4Gi
kind: ConfigMap


# oc -n openshift-monitoring get pvc
NAME                                       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
alertmanager-alertmanager-main-0           Bound    pvc-486a5ccb-c9a3-4c55-9f9e-c1f6f24f82f6   4Gi        RWO            standard       5h5m
alertmanager-alertmanager-main-1           Bound    pvc-e45d59e1-44aa-4115-84a0-febf2b70f18a   4Gi        RWO            standard       5h5m
alertmanager-alertmanager-main-2           Bound    pvc-db1101f9-68fb-4169-b0fd-da0083c68b7a   4Gi        RWO            standard       5h5m
alertmanager-main-db-alertmanager-main-0   Bound    pvc-87939abe-e16b-4789-adfd-aea8882b7de0   4Gi        RWO            standard       92m
alertmanager-main-db-alertmanager-main-1   Bound    pvc-e0756091-da0a-4869-a06b-0f4fbf222c51   4Gi        RWO            standard       92m
alertmanager-main-db-alertmanager-main-2   Bound    pvc-8c55e7a6-8400-44bb-adf9-485c4147d78b   4Gi        RWO            standard       92m
prometheus-k8s-db-prometheus-k8s-0         Bound    pvc-7f688ff2-6c0a-407c-9899-6241a314f910   10Gi       RWO            standard       91m
prometheus-k8s-db-prometheus-k8s-1         Bound    pvc-7a8f1220-99a9-4287-8676-ec1b85b388db   10Gi       RWO            standard       91m
prometheus-prometheus-k8s-0                Bound    pvc-50b2c023-b782-48c6-88c0-344f1ee818cf   10Gi       RWO            standard       5h4m
prometheus-prometheus-k8s-1                Bound    pvc-d03adb14-a25f-428d-ae5e-c06528dfa8ce   10Gi       RWO            standard       5h4m




# for i in alertmanager-main-0 alertmanager-main-1 alertmanager-main-2 prometheus-k8s-0 prometheus-k8s-1; do echo $i; oc -n openshift-monitoring get pod $i -oyaml | grep persistentVolumeClaim -A1;done
alertmanager-main-0
    persistentVolumeClaim:
      claimName: alertmanager-main-db-alertmanager-main-0
alertmanager-main-1
    persistentVolumeClaim:
      claimName: alertmanager-main-db-alertmanager-main-1
alertmanager-main-2
    persistentVolumeClaim:
      claimName: alertmanager-main-db-alertmanager-main-2
prometheus-k8s-0
    persistentVolumeClaim:
      claimName: prometheus-k8s-db-prometheus-k8s-0
prometheus-k8s-1
    persistentVolumeClaim:
      claimName: prometheus-k8s-db-prometheus-k8s-1

Version-Release number of selected component (if applicable):
Upgrade from 4.3.1 to 4.4.0-0.nightly-2020-02-06-041236

How reproducible:
Always

Steps to Reproduce:
1. attache PVs for monitoring and upgrade from 4.3.1 to 4.4.0-0.nightly-2020-02-06-041236
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Junqi Zhao 2020-02-10 06:29:28 UTC

*** This bug has been marked as a duplicate of bug 1793328 ***