OpenEBS for Redis
Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. Redis is deployed usually as a on Kubernetes and requires persistent storage for each instance of Redis Storage Manager instance. OpenEBS provides persistent volumes on the fly when Storage Managers are scaled up.
Advantages of using OpenEBS for Redis:
- No need to manage the local disks, they are managed by OpenEBS
- Start with small storage and add disks as needed on the fly. Sometimes Redis instances are scaled up because of capacity on the nodes. With OpenEBS persistent volumes, capacity can be thin provisioned and disks can be added to OpenEBS on the fly without disruption of service
- Redis sometimes need highly available storage, in such cases OpenEBS volumes can be configured with 3 replicas.
- If required, take backup of the Redis data periodically and back them up to S3 or any object storage so that restoration of the same data is possible to the same or any other Kubernetes cluster
Note: Redis can be deployed both as Deployment
or as . When Redis deployed as StatefulSet
, you don’t need to replicate the data again at OpenEBS level. When Redis is deployed as , consider 3 OpenEBS replicas, choose the StorageClass accordingly.
Deployment model
Install OpenEBS
If OpenEBS is not installed in your K8s cluster, this can done from . If OpenEBS is already installed, go to the next step.
-
After OpenEBS installation, cStor pool has to be configured. If cStor Pool is not configured in your OpenEBS cluster, this can be done from here. Sample YAML named openebs-config.yaml for configuring cStor Pool is provided in the Configuration details below. During cStor Pool creation, make sure that the maxPools parameter is set to >=3. If cStor pool is already configured, go to the next step.
Launch and test Redis
Use stable Redis image with helm to deploy Redis in your cluster using the following command. In the following command, it will create a PVC with 8G size for data volume.
For more information on installation, see Redis .
Reference at
Deployment YAML spec files for Redis and OpenEBS resources are found here
Monitor OpenEBS Volume size
It is not seamless to increase the cStor volume size (refer to the roadmap item). Hence, it is recommended that sufficient size is allocated during the initial configuration.
Monitor cStor Pool size
As in most cases, cStor pool may not be dedicated to just Redis database alone. It is recommended to watch the pool capacity and add more disks to the pool before it hits 80% threshold. See cStorPool metrics.
Configuration details
openebs-sc-disk.yaml