Skip to content

Commit

Permalink
GITBOOK-1057: Persistent storage - review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Suseela-S authored and gitbook-bot committed Sep 4, 2024
1 parent a83a79b commit 61bfc5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
* [No Space Left on the Device Warning](deployment/deployment-guide/troubleshooting/no-space-left-on-the-device-warning.md)
* [Restart Deployment or StatefulSets to Redistribute Pods across Nodes](deployment/deployment-guide/redistribute-pods-across-nodes-by-restarting-deployment-statefulsets.md)
* [Rerun Jobs in Kubernetes Cluster](deployment/deployment-guide/rerun-jobs-in-kubernetes-cluster.md)
* [Persistent Storage - OpenG2P System](deployment/persistent-storage-openg2p-system.md)
* [Persistent Storage](deployment/persistent-storage.md)
* [Documentation Guides](documentation-guides/README.md)
* [Documentation Guidelines](documentation-guides/documentation-guidelines/README.md)
* [Embed a Miro diagram](documentation-guides/documentation-guidelines/embed-a-miro-diagram.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,23 @@ layout:
visible: true
---

# Persistent Storage - OpenG2P System
# Persistent Storage

This document provides information on all the Persistent storages, i.e., PVs (Persistent Volume) and PVCs (Persistent Volume Claim), in OpenG2P deployments. It describes the type of storage, deletion behavior, and how to identify which PV belongs to which pod. It also defines and highlights the specific behavior of the stateful sets and deployments.

## **Overview of Persistent storage in OpenG2P system**

<table><thead><tr><th width="167">Types of PVs</th><th width="430">Purpose</th><th>Type</th></tr></thead><tbody><tr><td>Postgres</td><td>Stores database data for the application.</td><td>StatefulSet</td></tr><tr><td>OpenSearch</td><td>Stores indexing data, logs, and search-related data.</td><td>StatefulSet</td></tr><tr><td>Minio</td><td>Stores object data, files, and backups.</td><td>Deployment</td></tr><tr><td>SoftHSM</td><td><ul><li>Stores cryptographic key data used for secure key storage and management. </li><li>SoftHSM acts as a software-based Hardware Security Module (HSM) for the application.</li></ul></td><td>Deployment</td></tr><tr><td>Kafka</td><td><ul><li>Stores Kafka logs and messages, ensuring durability and persistence of data in the event of a pod restart or failure.</li><li>Kafka's stateful nature requires persistent storage to maintain message integrity.</li></ul></td><td>StatefulSet</td></tr><tr><td>Odoo</td><td>Stores database data, files, and other persistent configurations for the Odoo ERP system and ensures that data is retained across pod during restarting and upgrades.</td><td>Deployment</td></tr></tbody></table>
This document provides information on all the Persistent storages, i.e., PVs (Persistent Volume) and PVCs (Persistent Volume Claim), in OpenG2P deployments. It describes the type of storage, deletion behavior, and how to identify which PV belongs to which pod. It also defines and highlights the specific behavior of the StatefulSets and Deployments.

### **Types of persistent storage**

<table><thead><tr><th width="141"></th><th width="318">Statefulset attached storage</th><th>Deployment attached storage</th></tr></thead><tbody><tr><td>Definition</td><td>Statefulsets are used for applications that require stable network identities and persistent storage. The pods in a StatefulSet have unique identities and their storage is tied to their lifecycle. When a pod in a StatefulSet is deleted, the storage (PV) remains intact unless explicitly deleted.</td><td>In stateless applications, deployments are used so that any pod can be replaced by another. The storage associated with a deployment is generally ephemeral unless PVs are explicitly attached.</td></tr><tr><td>Deletion behavior</td><td>By default, the storage attached to a StatefulSet is retained even after the pod is deleted. This is crucial for stateful applications where data persistence is critical.</td><td>If PVs are attached to a deployment, the storage may be deleted when the deployment is deleted, depending on the reclaim policy. Unlike StatefulSets, Deployments do not guarantee data persistence when pods are scaled down or deleted.</td></tr><tr><td>Examples</td><td>Postgres, OpenSearch, and Minio.</td><td>Some auxiliary services might use Deployment-based storage, but it is less common for critical data.</td></tr></tbody></table>
<table><thead><tr><th width="162">Storage type</th><th width="306">Definition</th><th>Deletion behavior</th></tr></thead><tbody><tr><td>StatefulSet attached storage</td><td><p>StatefulSets are used for applications that require stable network identities and persistent storage. The pods in a StatefulSet have unique identities and their storage is tied to their lifecycle. When a pod in a StatefulSet is deleted, the storage (PV) remains intact unless explicitly deleted. </p><p></p><p>Examples: Postgres, OpenSearch, and Minio.</p></td><td>By default, the storage attached to a StatefulSet is retained even after the pod is deleted. This is crucial for stateful applications where data persistence is critical.</td></tr><tr><td>Deployment attached storage</td><td><p>In stateless applications, deployments are used so that any pod can be replaced by another. The storage associated with a deployment is generally ephemeral unless PVs are explicitly attached. </p><p></p><p>Examples: Some auxiliary services might use Deployment-based storage, but it is less common for critical data. </p></td><td>If PVs are attached to a deployment, the storage may be deleted when the deployment is deleted, depending on the reclaim policy. Unlike StatefulSets, Deployments do not guarantee data persistence when pods are scaled down or deleted.</td></tr></tbody></table>

### **Persistent Volume Reclaim Policies: Retain vs. Delete**
### Types of PVs

<table><thead><tr><th width="167">Types of PVs</th><th width="430">Purpose</th><th>Type</th></tr></thead><tbody><tr><td>Postgres</td><td>Stores database data for the application.</td><td>StatefulSet</td></tr><tr><td>OpenSearch</td><td>Stores indexing data, logs, and search-related data.</td><td>StatefulSet</td></tr><tr><td>Minio</td><td>Stores object data, files, and backups.</td><td>Deployment</td></tr><tr><td>SoftHSM</td><td><ul><li>Stores cryptographic key data used for secure key storage and management. </li><li>SoftHSM acts as a software-based Hardware Security Module (HSM) for the application.</li></ul></td><td>Deployment</td></tr><tr><td>Kafka</td><td><ul><li>Stores Kafka logs and messages, ensuring durability and persistence of data in the event of a pod restart or failure.</li><li>Kafka's stateful nature requires persistent storage to maintain message integrity.</li></ul></td><td>StatefulSet</td></tr><tr><td>Odoo</td><td>Stores database data, files, and other persistent configurations for the Odoo ERP system and ensures that data is retained across pod during restarting and upgrades.</td><td>Deployment</td></tr></tbody></table>

<table><thead><tr><th width="154"></th><th>Retain</th><th>Delete</th></tr></thead><tbody><tr><td>Behavior</td><td>When a PVC is deleted, the associated PV is not automatically deleted. This is helpful if you want to reattach the PV to another PVC in the future or as a backup.</td><td>When a PVC is deleted, the associated PV is also automatically deleted. This is more suitable for temporary or non-critical data.</td></tr><tr><td>Use Case</td><td>Critical data that you may want to preserve even after deleting the PVC or StatefulSet.</td><td>Ephemeral or temporary data where automatic cleanup is preferred.</td></tr></tbody></table>
### **Persistent volume reclaim policies: retain vs. delete**

### **Procedure**
<table><thead><tr><th width="154">Reclaim policy</th><th>Behavior</th><th>Use case</th></tr></thead><tbody><tr><td>Retain</td><td>When a PVC is deleted, the associated PV is not automatically deleted. This is helpful if you want to reattach the PV to another PVC in the future or as a backup.</td><td>Critical data that you may want to preserve even after deleting the PVC or StatefulSet.</td></tr><tr><td>Delete</td><td>When a PVC is deleted, the associated PV is also automatically deleted. This is more suitable for temporary or non-critical data.</td><td>Ephemeral or temporary data where automatic cleanup is preferred.</td></tr></tbody></table>

#### How to check which PV belongs to which Pod&#x20;
### Checking which PV belongs to which pod&#x20;

In Rancher, follow the below steps to check which PV is associated with a particular pod.

Expand Down

0 comments on commit 61bfc5e

Please sign in to comment.