
August 22, 2026
8 min read
Table of Contents
By Kokil Thapa | Last reviewed: August 2026
Running stateful applications like MySQL, PostgreSQL, or Redis on Kubernetes requires reliable persistent storage that survives pod restarts and node failures. OpenEBS for Kubernetes Storage solves this by implementing Container Attached Storage (CAS), where storage controllers run as pods rather than relying on external hardware arrays. Whether you need low-latency local disks for databases or replicated volumes for high availability, OpenEBS provides a unified, cloud-native storage layer that integrates directly with your existing cluster infrastructure.
Unlike traditional SAN/NAS solutions that treat storage as an external dependency, OpenEBS runs entirely within Kubernetes. This aligns storage lifecycle management with application deployment, making it ideal for teams managing their own infrastructure. For developers transitioning from monolithic deployments to microservices, understanding this distinction is critical; if you are architecting modern backend systems, reviewing migration strategies for Laravel applications often reveals that storage architecture is the primary bottleneck during stateful service extraction.
How does OpenEBS for Kubernetes Storage architecture differ from CSI drivers?
Most Kubernetes storage plugins are thin wrappers around external storage systems. They translate PVC requests into API calls to AWS EBS, GCE PD, or a hardware SAN. OpenEBS takes a fundamentally different approach by treating storage as a microservice. The data plane runs inside the cluster, consuming local disks or cloud block devices and presenting them as Kubernetes-native volumes.
This architecture offers three distinct engines optimized for different use cases. Understanding which engine to deploy prevents costly re-architecture later.
- LocalPV-Hostpath: Binds a PVC directly to a directory on a specific node. Zero overhead, maximum performance, but no replication. Ideal for development, caching layers, or stateless-like workloads that can tolerate data loss on node failure.
- LocalPV-LVM/ZFS: Uses logical volume management to provide snapshotting, cloning, and capacity quotas on local disks. Adds enterprise features without network replication overhead.
- Mayastor (Replicated PV): A next-generation engine using NVMe-oF over TCP/RDMA. Provides synchronous replication across nodes with near-local performance. Required for production databases and mission-critical stateful sets.
In my experience deploying legal-tech portals and e-commerce platforms on self-managed clusters, LocalPV-Hostpath handles 80% of non-database workloads efficiently. Reserve Mayastor strictly for PostgreSQL/MySQL primaries where RPO=0 is mandatory.
How do you install and configure OpenEBS for Kubernetes Storage in 2026?
Installation has simplified significantly with the consolidated Helm chart. As of 2026, OpenEBS 4.x unifies all engines under a single deployment, eliminating the confusion of choosing between "cStor", "Jiva", or "Mayastor" charts.
Prerequisites and system preparation
Before installing, ensure your nodes meet the engine-specific requirements. Mayastor demands dedicated NVMe drives and hugepages configuration; LocalPV-Hostpath only needs a writable directory.
# Verify Kubernetes version compatibility (1.27+ required for OpenEBS 4.x)
kubectl version --short
# For Mayastor: Enable hugepages on all worker nodes
echo 'vm.nr_hugepages = 1024' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
# Create dedicated storage directories for LocalPV-Hostpath
sudo mkdir -p /var/openebs/local
sudo chown -R $(whoami):$(whoami) /var/openebs/local Helm installation with selective engine enablement
Never enable all engines in production. Each consumes resources even when idle. Select only what your workloads require.
# Add OpenEBS Helm repository
helm repo add openebs https://openebs.github.io/openebs
helm repo update
# Install with only LocalPV-Hostpath enabled (lightweight)
helm install openebs openebs/openebs \
--namespace openebs --create-namespace \
--set engines.localpv.enabled=true \
--set engines.replicated.enabled=false \
--set localpv-provisioner.hostpathClass.enabled=true \
--set localpv-provisioner.hostpathClass.basePath=/var/openebs/local
# OR install with Mayastor for replicated storage
helm install openebs openebs/openebs \
--namespace openebs --create-namespace \
--set engines.replicated.enabled=true \
--set etcd.replicaCount=3 \
--set io-engine.cpu=2 \
--set io-engine.memory=4Gi After installation, verify component health before creating any volumes. A common mistake on client projects is assuming success because the Helm release completed; always validate pod readiness and storage class creation.
# Check all OpenEBS pods are Running
kubectl get pods -n openebs
# Verify StorageClasses were created
kubectl get sc
# Expected output includes:
# NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE
# openebs-hostpath openebs.io/local Delete WaitForFirstConsumer
# mayastor-single-replica io.openebs.csi-mayastor Delete Immediate When should you choose LocalPV-Hostpath versus Mayastor replicated volumes?
Selecting the wrong engine causes either wasted resources or unacceptable risk. Use this decision framework based on real production constraints rather than theoretical capabilities.
| Criteria | LocalPV-Hostpath | Mayastor (Replicated) |
|---|---|---|
| Data Durability | Node-level only. Data lost if node fails. | Synchronous replication across N nodes. Survives node failure. |
| Performance Overhead | Near-zero. Direct filesystem access. | Low (~5-10%). NVMe-oF adds minimal latency vs local. |
| Hardware Requirements | Any disk/directory. No special config. | Dedicated NVMe drives + hugepages + RDMA preferred. |
| Snapshot/Clone Support | No (filesystem-dependent). | Yes. Instant clones for dev/test environments. |
| Best For | Caches, temp data, dev/staging, disposable workers. | Databases, message queues, user uploads, compliance data. |
| Cost (NPR Estimate) | Rs 0 additional. Uses existing disks. | Rs 15,000–30,000/month per TB for NVMe cloud instances. |
For Nepal-based businesses running cost-sensitive infrastructure, LocalPV-Hostpath on standard SSDs often suffices for application caches and session stores. Reserve expensive NVMe-backed Mayastor volumes exclusively for transactional databases. When building database-driven websites, this tiered approach reduces monthly storage costs by 60–70% compared to provisioning replicated storage for every component.
How do you optimize OpenEBS performance for database workloads?
Default configurations prioritize safety over speed. Production databases require explicit tuning to avoid I/O bottlenecks that manifest as slow queries or connection timeouts.
Filesystem and mount options
For LocalPV-Hostpath backing MySQL or PostgreSQL, ext4 with specific mount options outperforms defaults significantly. XFS is preferable for ZFS/LVM engines due to better handling of large files and snapshots.
# Recommended fstab entry for database hostpath volumes
/dev/sdb1 /var/openebs/db ext4 defaults,noatime,nodiratime,discard 0 2
# Verify mount options after reboot
mount | grep openebs
# Expected: /dev/sdb1 on /var/openebs/db type ext4 (rw,noatime,nodiratime,discard) Mayastor IO engine tuning
Mayastor performance depends heavily on CPU pinning and memory allocation. Under-provisioning causes tail latency spikes during peak load.
- CPU Isolation: Dedicate physical cores to io-engine pods. Never share with application workloads. Use
isolcpuskernel parameter and node taints/tolerations. - Memory Reservation: Allocate 4Gi minimum per io-engine instance. Hugepages must be pre-allocated; runtime allocation fails silently and degrades performance.
- Network Bandwidth: Replication traffic competes with application traffic. Use dedicated NICs or VLANs for Mayastor NVMe-oF traffic. Minimum 10Gbps for 3-node clusters.
- Queue Depth: Increase
nexus_max_queue_depthfrom default 32 to 128 for NVMe backends. Matches modern SSD parallelism capabilities.
Monitoring and validation
Install Prometheus exporters included in the Helm chart. Key metrics to alert on include mayastor_pool_usage_percent (>80% triggers expansion), localpv_volume_errors_total (any increase indicates permission/path issues), and io_engine_latency_seconds (p99 >10ms warrants investigation).
What backup and disaster recovery strategies work with OpenEBS?
Storage-level snapshots are necessary but insufficient for disaster recovery. They protect against accidental deletion but not against cluster-wide failures or corruption. Implement layered backups aligned with your RPO/RTO targets.
Velero integration for application-consistent backups
OpenEBS integrates natively with Velero via CSI snapshot support. This captures both PVC data and Kubernetes manifests in a single backup operation.
# Create VolumeSnapshotClass for Mayastor
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: mayastor-snapclass
annotations:
snapshot.storage.kubernetes.io/is-default-class: "true"
driver: io.openebs.csi-mayastor
deletionPolicy: Delete
# Schedule daily backups with Velero
velero schedule create db-daily \
--schedule="0 2 * * *" \
--include-namespaces production \
--snapshot-volumes \
--volume-snapshot-locations default \
--ttl 720h Cross-region replication for DR
For Nepal-based services serving international clients, replicate critical volumes to a secondary region. Mayastor supports asynchronous replication targets. Combine with object storage backups (S3-compatible) for long-term retention at lower cost. Budget approximately Rs 2,000–5,000/month per TB for S3 storage depending on provider.
Test restores quarterly. Untested backups are indistinguishable from no backups. Document restoration procedures alongside your CI/CD pipeline documentation so recovery steps are version-controlled and peer-reviewed.
Implementing OpenEBS for Kubernetes Storage in production environments
Successful adoption requires treating storage as a first-class infrastructure component, not an afterthought. Start with LocalPV-Hostpath for non-critical workloads to build operational familiarity before deploying Mayastor for production databases. Monitor capacity proactively; expanding volumes online works reliably but requires planning. Maintain separate StorageClasses for each performance tier to prevent accidental misallocation. Finally, integrate storage metrics into your existing observability stack—storage failures cascade quickly through dependent services. If you need assistance architecting stateful workloads or evaluating whether OpenEBS fits your specific infrastructure constraints, reach out to discuss your deployment requirements.

