New to KubeDB? Please start here.


What is Memcached

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

Memcached Spec

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

kind: Memcached
  name: mc1
  namespace: demo
  replicas: 3
  version: 1.5.3-alpine
    disktype: ssd
  doNotPause: true
    agent: coreos-prometheus-operator
      namespace: demo
        app: kubedb
      interval: 10s
      memory: "64Mi"
      cpu: "250m"
      memory: "128Mi"
      cpu: "500m"


spec.replicas is an optional field that specifies the number of desired Instances/Replicas of Memcached database. If you do not specify .spec.replicas, then it defaults to 1.


spec.version is a required field specifying the version of Memcached database. Here the database version is 1.5.3-alpine.


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 Memcached 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 Memcached object put the database into a dormant state.


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


Memcached 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 Memcached database here.
  • Wondering what features are coming next? Please visit here.
  • Want to hack on KubeDB? Check our contribution guidelines.