Uploaded image for project: 'OpenShift Pipelines'
  1. OpenShift Pipelines
  2. SRVKP-7447

Define storage class for postgredb-tekton-results-postgres-0 sts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • Operator
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • Release Note Not Required
    • Hide

      Is there any workaround available to the best of your knowledge?

      Yes. 

      Workaround #1
      For the PVC in a pending state, we can define the storage class in the yaml spec. Once the storage class is defined, the PVC goes into a `Bound` state and the pod subsequently starts running successfully.

      Workaround #2

      (1) Currently I have no default storage class leading to the PVC to go into a pending state
      ~~~
      NAME      PROVISIONER       RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
      gp2-csi   ebs.csi.aws.com   Delete          WaitForFirstConsumer   true                   4d2h
      gp3-csi   ebs.csi.aws.com   Delete          WaitForFirstConsumer   true                   4d2h
      NAME                                  STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
      postgredb-tekton-results-postgres-0   Pending                                                     <unset>                 59
      NAME                      READY   AGE
      tekton-results-postgres   0/1     59m
      ~~~
      (2) Find the owner of the statefulset
      ~~~
      $ oc get sts tekton-results-postgres -oyaml -n openshift-pipelines | yq .metadata.ownerReferences
      - apiVersion: operator.tekton.dev/v1alpha1
        blockOwnerDeletion: true
        controller: true
        kind: TektonInstallerSet
        name: result-pre-rzl59
        uid: be763b3f-21cf-45b4-a7d3-a5a905de413c
      ~~~
      (3) Edit the owner of the statefulset
      ~~~
      $ oc edit tektoninstallerset result-pre-rzl59 -n openshift-pipelines
      <removed-for-space>
            volumeClaimTemplates:  
            - metadata:            
                creationTimestamp: null
                name: postgredb    
              spec:                
                storageClassName: <storage-class-name> <--- define a storageclass
                accessModes:       
                - ReadWriteOnce    
                resources:         
                  requests:        
                    storage: 1Gi   
              status: {}           
          status:                  
            availableReplicas: 0   
            replicas: 0    
      <removed-for-space>
      ~~~
      (4) Delete the sts and the corresponding PVC
      ~~~
      $ oc delete sts tekton-results-postgres -n openshift-pipelines
      $ oc delete pvc postgredb-tekton-results-postgres-0 -n openshift-pipelines
      ~~~
      (5) Verify that the PVC and sts are recreated. In my cluster I defined gp3-csi as the storageclass.
      ~~~
      NAME                      READY   AGE
      tekton-results-postgres   1/1     18s
      NAME                                  STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
      postgredb-tekton-results-postgres-0   Bound    pvc-4de5fb21-5d3a-4fa4-98dd-a4bfb8ab9f11   1Gi        RWO            gp3-csi        <unset>                 21s
      ~~~
      
      Show
      Is there any workaround available to the best of your knowledge? Yes.  Workaround #1 For the PVC in a pending state, we can define the storage class in the yaml spec. Once the storage class is defined, the PVC goes into a `Bound` state and the pod subsequently starts running successfully. Workaround #2 (1) Currently I have no default storage class leading to the PVC to go into a pending state ~~~ NAME      PROVISIONER       RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE gp2-csi   ebs.csi.aws.com   Delete          WaitForFirstConsumer   true                   4d2h gp3-csi   ebs.csi.aws.com   Delete          WaitForFirstConsumer   true                   4d2h NAME                                  STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE postgredb-tekton-results-postgres-0   Pending                                                     <unset>                 59 NAME                      READY   AGE tekton-results-postgres   0/1     59m ~~~ (2) Find the owner of the statefulset ~~~ $ oc get sts tekton-results-postgres -oyaml -n openshift-pipelines | yq .metadata.ownerReferences - apiVersion: operator .tekton.dev/v1alpha1   blockOwnerDeletion: true   controller: true   kind: TektonInstallerSet   name: result-pre-rzl59   uid: be763b3f-21cf-45b4-a7d3-a5a905de413c ~~~ (3) Edit the owner of the statefulset ~~~ $ oc edit tektoninstallerset result-pre-rzl59 -n openshift-pipelines <removed- for -space>       volumeClaimTemplates:         - metadata:                       creationTimestamp: null           name: postgredb             spec:                           storageClassName: <storage- class- name> <--- define a storageclass           accessModes:                  - ReadWriteOnce               resources:                      requests:                       storage: 1Gi            status: {}                status:                         availableReplicas: 0          replicas: 0     <removed- for -space> ~~~ (4) Delete the sts and the corresponding PVC ~~~ $ oc delete sts tekton-results-postgres -n openshift-pipelines $ oc delete pvc postgredb-tekton-results-postgres-0 -n openshift-pipelines ~~~ (5) Verify that the PVC and sts are recreated. In my cluster I defined gp3-csi as the storageclass. ~~~ NAME                      READY   AGE tekton-results-postgres   1/1     18s NAME                                  STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE postgredb-tekton-results-postgres-0   Bound    pvc-4de5fb21-5d3a-4fa4-98dd-a4bfb8ab9f11   1Gi        RWO            gp3-csi        <unset>                 21s ~~~
    • Hide

      Steps to Reproduce:

      1. Ensure no default storage class is defined
      2. Install the openshift-pipelines operator
      3. The pod and pvc will be in a pending state in the openshift-pipelines namespace 

      Show
      Steps to Reproduce: 1. Ensure no default storage class is defined 2. Install the openshift-pipelines operator 3. The pod and pvc will be in a pending state in the openshift-pipelines namespace 
    • 3
    • Ranked Issues

      Description of problem - Provide a detailed description of the issue encountered, including logs/command-output snippets and screenshots if the issue is observed in the UI:

      When installing the openshift-pipelines operator it creates a PVC using the default storage class. The customer has decided not to define a default storage class causing the PVC and the respective pod to go into a `Pending` state. The customer would like the ability to define the storage class in this statefulset via ConfigMap or other method.

      Does this issue impact your ability to continue to work with the product?

      Not currently as the customer has two viable workarounds to circumvent this issue.

      1. Acceptance criteria
      • Be able to configure storage class for results postgres instance on first installation of results
      • Documentation related to moving between storage configurations

       
       

              rh-ee-abghosh Abhishek Ghosh
              rhn-support-rlaberin Ryan Laberinto
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 3 minutes
                  3m
                  Remaining:
                  Remaining Estimate - 3 minutes
                  3m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified