How to Increase the CouchDB storage in a Hybrid Environment

1) Increase Memory:

For memory, look at adjusting the limits and requests for your pods.

Here's how you can do that:

  • Edit your Deployment:
oc edit statefulset [YOUR-COUCHDB-STATEFULSET-NAME]
  • OR if you're using a StatefulSet:
oc edit statefulset [YOUR-COUCHDB-STATEFULSET-NAME]
          
  • Modify the YAML:

           Find the section in the YAML that looks like this:

resources: requests: memory: "XGi" limits: memory: "YGi"

           Modify the values X and Y to increase the memory requests and limits. Save and exit the editor. OpenShift Container Platform handles the rolling
           update of your pods, respecting the configured deployment strategy.
 

2) Increase Storage:

Here's a general approach:

  • Backup your data: Before making changes, ensure you have a recent backup of your CouchDB data.

  • If you're using Persistent Volume Claims (PVCs) with dynamic provisioning:

    • Edit the PVC:
               
oc edit pvc [YOUR-COUCHDB-PVC-NAME]

               Increase the size value under spec.resources.requests.storage.
 
  • Note: Not all storage provisioners support resizing. If you're using one that does not, you need to create a new PVC with the desired size. Then, attach it to a new pod, and migrate the data over.

  • If you're using PVCs with static provisioning:

    • You might need to resize the underlying storage, which depends on your cloud provider or storage solution.
    • Then, edit the PVC as in step 2 to reflect the increased size.
       

Recognize New Storage Space:

  • After resizing, ensure CouchDB recognizes the new storage space. You might need to restart the CouchDB pod to get it to recognize the new storage:
          
oc delete pod [YOUR-COUCHDB-POD-NAME]

        
           It will be re-created by the Deployment or StatefulSet with the new storage space.

Note:

Always test these changes in a non-production environment first to ensure you understand the implications and can address any potential issues. It's essential to ensure that your storage can be resized without data loss and that your CouchDB configuration and version are compatible with resizing operations.