New to KubeDB? Please start here.


What is Redis

Redis is a Kubernetes Custom Resource Definitions (CRD). It provides declarative configuration for Redis in a Kubernetes native way. You only need to describe the desired database configuration in a Redis object, and the KubeDB operator will create Kubernetes objects in the desired state for you.

Redis Spec

As with all other Kubernetes objects, a Redis needs apiVersion, kind, and metadata fields. It also needs a .spec section. Below is an example Redis object.

kind: Redis
  name: r1
  namespace: demo
  version: 4
    storageClassName: "standard"
    - ReadWriteOnce
        storage: 50Mi
    disktype: ssd
  doNotPause: true
    agent: coreos-prometheus-operator
      namespace: demo
        app: kubedb
      interval: 10s
      memory: "64Mi"
      cpu: "250m"
      memory: "128Mi"
      cpu: "500m"


spec.version is a required field specifying the version of Redis database. Official Redis docker images will be used for the specific version.

Since 0.8.0, is a required field that specifies the StorageClass of PVCs dynamically allocated to store data for the database. This storage spec will be passed to the StatefulSet created by KubeDB operator to run database pods. You can specify any StorageClass available in your cluster with appropriate resource requests.

  • is the name of the StorageClass used to provision PVCs. PVCs don’t necessarily have to request a class. A PVC with its storageClassName set equal to “” is always interpreted to be requesting a PV with no class, so it can only be bound to PVs with no class (no annotation or one set equal to “”). A PVC with no storageClassName is not quite the same and is treated differently by the cluster depending on whether the DefaultStorageClass admission plugin is turned on.
  • uses the same conventions as Kubernetes PVCs when requesting storage with specific access modes.
  • can be used to request specific quantities of storage. This follows the same resource model used by PVCs.

To learn how to configure, please visit the links below:


spec.nodeSelector is an optional field that specifies a map of key-value pairs. For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels (it can have additional labels as well). To learn more, see here .


spec.doNotPause is an optional field that tells KubeDB operator that if this Redis object is deleted, whether it should be reverted automatically. This should be set to true for production databases to avoid accidental deletion. If not set or set to false, deleting a Redis object put the database into a dormant state. The StatefulSet for a DormantDatabase is deleted but the underlying PVCs are left intact. This allows user to resume the database later.


KubeDB provides the flexibility of deploying Redis database from a private Docker registry. To learn how to deploym Redis from a private registry, please visit here.


Redis managed by KubeDB can be monitored with builtin-Prometheus and CoreOS-Prometheus operator out-of-the-box. To learn more,


spec.resources is an optional field. This can be used to request compute resources required by the database pods. To learn more, visit here.

Next Steps

  • Learn how to use KubeDB to run a Redis database here.
  • Wondering what features are coming next? Please visit here.
  • Want to hack on KubeDB? Check our contribution guidelines.