Skip to main content

Keydb Operator

This operator simplifies the deployment and management of KeyDB, a high-performance, multi-threaded in-memory data store, within Kubernetes environments. It leverages the KeyDB project and offers two deployment configurations:

  • Standalone Mode:
    • Deploys a single KeyDB instance for basic use cases.
    • Suitable for scenarios where read/write performance is the primary concern.
  • Multi-Master Mode:
    • Deploys a cluster with multiple KeyDB instances configured for high availability and fault tolerance.
    • Enables read/write operations on all masters, providing redundancy and improved data availability.

Key Technologies:

  • Kubernetes
  • Ansible Operator SDK
  • Keydb

Installation

Important Note: This Keydb Operator is currently in Beta stage. Proceed with caution in production deployments.

  1. Install Operator:
# Ensure prerequisites are met
kubectl apply -k https://github.com/krestomatio/keydb-operator/config/default?ref=v0.3.14
  1. Configure Keydb Instance:
  • Download and modify this sample file to reflect your specific instance. This file defines the desired configuration for your KeyDB deployment, including the chosen mode (standalone or multi-master).
curl -sSL 'https://raw.githubusercontent.com/krestomatio/keydb-operator/v0.3.14/config/samples/keydb_v1alpha1_keydb.yaml' -o keydb_v1alpha1_keydb.yaml
# modify keydb_v1alpha1_keydb.yaml

# for multimaster mode, use:
# curl -sSL 'https://raw.githubusercontent.com/krestomatio/keydb-operator/v0.3.14/config/samples/keydb_v1alpha1_keydb_multimaster.yaml' -o keydb_v1alpha1_keydb.yaml
  1. Deploy Keydb:
  • Deploy a Keydb instance using the modified configuration:
kubectl apply -f keydb_v1alpha1_keydb.yaml
  1. Monitor Logs:
  • Track the Keydb Operator logs for insights into the deployment process:
kubectl -n keydb-operator-system logs -l control-plane=controller-manager -c manager -f
  • Monitor the status of your deployed Keydb instance:
kubectl get -f keydb_v1alpha1_keydb.yaml -w

Uninstall

  1. Delete Keydb Instance:
# Caution: This step leads to data loss. Proceed with caution.
kubectl delete -f keydb_v1alpha1_keydb.yaml
  1. Uninstall Operator:
kubectl delete -k https://github.com/krestomatio/keydb-operator/config/default?ref=v0.3.14

Configuration

Keydb custom resource (CR) can be configure via its spec field. Keydb CR spec supports all the the variables in v1alpha1.database.keydb ansible role as fields. These variables can be specified directly in the Keydb CR YAML manifest file, allowing for customization of the Keydb instance during deployment. Refer to the official v1alpha1.database.keydb ansible role documentation for a comprehensive list of supported fields.

Contributing

  • Report bugs, request enhancements, or propose new features using GitHub issues.